Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/12/2023 in all areas

  1. Got it to work. Tell me about the battle system. Sometimes I'm walking around the map and out of nowhere I am in the middle of a fight. If the opponent kills me I respawn at a location and when I press UP I am again in the middle of a fight and my HP is not restored, it's still zero. I also have to figure out what counter attack I need for each of my opponent attack. Anyway, nice work.
    3 points
  2. Xandy

    Acceptable script?

    My understanding of a nested function would be: Func Fruit() Func Apple() ; Apple Code EndFunc; Apple Func Cavendish() ; Cavendish Code EndFunc; Cavendish EndFunc; Fruit As far as I know, the above would not execute and be improper in AutoIt.
    2 points
  3. The link is in the help file latest SQLite Put the dll in the directories specified in the help file or specify one using the optional parameter.
    1 point
  4. @AndyG I was thinking about but we don't have to move the moon for such a simple task. After all 1ms is already a good speed.
    1 point
  5. averlon

    set printer configuration

    I found a solution. Not the very best, but it seems to work. There is a Microsoft Tool where you can store the printers configuration in a .dat-file. This is what you need to do only once, naturally when the printer settings are according to your needs - duplex: "Installed" - in my case. rundll32.exe printui.dll,PrintUIEntry /Ss /n"<printer name>" /a"<some path to file>\printer_configuration.dat" d You can do this via WINDOWS+R and past the command into the commandline field and ENTER. Now, you have the printer configuration stored in the file specified! Now you can create a autoit script and run the script at "autostart". Run('rundll32.exe printui.dll,PrintUIEntry /Sr /n"<printer name>" /a"<some path to file>\printer_configuration.dat" d') This will restore the configuration to the settings you stored with the commandline shown above. For more information on the printerui see https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/rundll32-printui#related-links So far, I havn't found any way to modify one specific printer property. So the only way is to store and restore the whole configuration!
    1 point
  6. TheDcoder

    Acceptable script?

    @mr-es335 Anything is appropriate if you have the right use case, even some "inappropriate" things like GOTO are appropriate in the right circumstances. (It doesn't exist in AutoIt by the way.)
    1 point
  7. Xandy

    Acceptable script?

    Honestly I don't really know. It's difficult for me to approve your structure logic without the code meat. I worked all day, if there is a slight structure fail. I'm not likely to notice it right now. Best of luck mate. I hope you enjoy your time programming. I always do.
    1 point
  8. Xandy

    Acceptable script?

    No, I don't think so. Seems legit to me. That can certainly be done. DirCreate(path) DirMove(source, dest, flag); use help file for flags FileMove(source, dest, flag); use help file for flags There could be better ways, but those are some tools above.
    1 point
  9. Xandy

    Acceptable script?

    Looks like a good start. Sure, what would you like this script to do? What type of 'call' would you like the script to make? Will it be voice telephone calls, or something else?
    1 point
  10. Thank you! When in certain areas of the map (non village areas) you are randomly thrown into battle encounters. I haven't come up with a fancy way of transitioning. The end goal will be to transition to the battle in a similar fashion as Final Fantasy games. It is definitely a little shaky, I may need to adjust the sensitivity of this. This is handled in RPG-GFX-CORE at line 185 to 193, if you feel like playing around with it. It SHOULD save your current location to $mROM_BPOS, and when battle is over it should spawn you back at that location. If you win the battle, it will display a victory screen that shows experience earned and possible prizes, after going thru that it will do the same and respawn you at the coordinates stored in $mROM_BPOS. The data stored in the variable is a token string: "Blockname,X?Y" If $mROM_BLOCKTYPE = "Wild" Then If Random(1,20,1) = 1 And $Game_Mode = "Free" Then Global $mROM_BPOS = $mROM_CURRENTBLOCK & Chr(44) & $nX & Chr(63) & $nY ;Cons("BPOS: " & $mROM_BPOS) Global $Game_Mode = "Battle" mROM_Load_("MROM-PACK-TEST", "BATTLE001") ;Cons("Battle!!") EndIf EndIf Abilities, OUTSIDE OF BATTLE: If you click the Player Stats & Abilities button in the top tool bar, it will bring up a side menu that lists your abilities and stats. You can select an ability from the lists and click the info button below each list, and ability information will be displayed in the text display. When in battle, on the left menu it will say Turn: Attack or Turn: Defense, then whichever turn you are on, the respective abilities are listed in the drop down, select an ability and click "GO". Keep an eye on your HP meter, when your HP gets low, on Turn: Attack, click the Item button and use "TestPotion" to restore HP, but forfeit that attack turn and you will then cycle to Turn: Defense. HP not being re-filled will need to be fixed. If you wish you fix that yourself it can be found in RPG-B-ARCADE in the EndBattle() function, defeat section is in the bottom ELSE bracket. In RPG-B-ARCADE, replace EndBattle() with this: Func EndBattle() If $OPP1_KO = "True" Then Global $AB_Prizes = NPC_Data($OPP1_NAME, "drop") Global $AB_Gold = NPC_Data($OPP1_NAME, "DGP") Global $AB_EXP = NPC_Data($OPP1_NAME, "dexp") Global $PlayerHP = $P1_HP Global $PlayerMP = $P1_MP ;Release Battle Memory B_GFXSet("RollCall", "0") B_GFXSet("BattleVars", "0") B_GFXSet("StatVars", "0") B_GFXSet("BattleReset", "0") BattlePanel("off") _GDIPlus_GraphicsClear($hcanvas, _color("API")) _GDIPlus_ShutDown() AB_Vic("load") Return Else B_GFXSet("RollCall", "0") B_GFXSet("BattleVars", "0") B_GFXSet("StatVars", "0") B_GFXSet("BattleReset", "0") BattlePanel("off") Global $PlayerHP = $PlayerTHP $HPMeterValue = ($PlayerHP / $PlayerTHP) * 100 GUICtrlSetData($HPMeter, $HPMeterValue) Global $Game_Mode = "Free" _mROM_LOAD("MROM-PACK-TEST", GetTok($mROM_BPOS, "1", "44"), GetTok($mROM_BPOS, "2", "44")) EndIf EndFunc This will give you full HP if you lose a battle (for now.) I have updated the EndBattle() function in my script, and will update that in the GitHub downloads. EDIT: GitHub files have been updated for the EndBattle() function fix. This will be the last revision to v0.01, after this fixes will be discussed and assessed and manually fixed, unless fatal. All revisions and fixes from this point on will be placed manually, to fix your own copy, and fixed in my copy, but won't be automatically updated, and instead released in the next version (0.02 ?)
    1 point
  11. I may have to make the ReadMe.txt in RPGenerator-Source-Package-0-01.zip more understandable... User GUI character creator is not finished, you are supplied with TestDummy character. You need to install the core files: 1) Put RPGSOURCE folder in C:\ - ( it MUST be C:\RPGSOURCE\ ) 2) Run Install.au3 (Running Install.exe should acheive the same result, will place the executable in C:\RPGenerator\ and shortcut on desktop, you may delete the executable and shortcut if you are only going to run off the scripts) All core files are placed in C:\Program Data\.RPG\ by the install script 3) Run RPG-EXE.au3 EDIT: If needed, you may also uninstall all files by running Uninstall.au3.
    1 point
  12. This version works with both 32/64 bit versions: #AutoIt3Wrapper_UseX64=y #include <Memory.au3> $tFile1 = ReadBinaryFile('TestPtrn_1.raw') $tFile2 = ReadBinaryFile('TestPtrn_2_DEh.raw') $Init = TimerInit() $iMaxDiff = CompareData($tFile1, $tFile2) ConsoleWrite("MAX DIFF: " & $iMaxDiff & " digital level" & @CRLF) ConsoleWrite("Time: " & TimerDiff($Init) & " ms" & @CRLF) Func CompareData(Const ByRef $tFile1, Const ByRef $tFile2) Local $sCode, $pMemory, $tBuffer If @AutoItX64 Then $sCode = '0x31C08A440AFF412A4408FF7702F6D838E0720288C4E2EB0FB6C4C3' Else $sCode = '0x8B4C24048B7424088B7C240C31C08A440EFF2A440FFF7702F6D838E0720288C4E2EC0FB6C4C20C00' EndIf Local $dCode = Binary($sCode) Local $iCodeSize = BinaryLen($dCode) $pMemory = _MemVirtualAlloc(0, $iCodeSize, $MEM_COMMIT, $PAGE_EXECUTE_READWRITE) $tBuffer = DllStructCreate('byte Code[' & $iCodeSize & ']', $pMemory) $tBuffer.Code = $dCode Local $aCall = DllCallAddress('int', DllStructGetPtr($tBuffer), _ 'int', DllStructGetSize($tFile1), _ ; Number of bytes 'ptr', DllStructGetPtr($tFile1), _ ; Pointer to first structure 'ptr', DllStructGetPtr($tFile2) _ ; Pointer to second structure ) _MemVirtualFree($pMemory, $iCodeSize, $MEM_DECOMMIT) Return $aCall[0] EndFunc Func ReadBinaryFile($sPath) Local $iSize = FileGetSize($sPath) Local $tFile = DllStructCreate("byte Data[" & $iSize & "]") Local $hFile = FileOpen($sPath, 16) ; FO_READ + FO_BINARY $tFile.Data = FileRead($hFile) FileClose($hFile) Return $tFile EndFunc The results are similar, around 1ms for the files that you provided as samples.
    1 point
  13. Okay, in the mean time, I'll spend some time tonight updating Autoit and install the full SciTE4Autoit and start pecking away at stuff.
    1 point
  14. If you only want to check if two files are different then you can use the memcmp WinAPI function. ;Coded by UEZ build 2023-11-12 #include <WinAPIFiles.au3> #include <WinAPIHObj.au3> Global $fTimer = TimerInit() Global $bIsDifferent = FastBinCompare("TestPtrn_2_DEh.raw", "TestPtrn_1.raw") ConsoleWrite("Time: " & TimerDiff($fTimer) & " ms" & @CRLF) ConsoleWrite("Is different: " & $bIsDifferent & @CRLF) Func FastBinCompare($sFile1, $sFile2) Local $iFileSize = FileGetSize($sFile1) If $iFileSize <> FileGetSize($sFile2) Or Not $iFileSize Then Return SetError(1, -1, -1) Local $tBuffer1 = DllStructCreate("byte[" & $iFileSize & "]"), $tBuffer2 = DllStructCreate("byte[" & $iFileSize & "]") Local $hFile = _WinAPI_CreateFile($sFile1, 2, 2), $nBytes _WinAPI_ReadFile($hFile, $tBuffer1, $iFileSize, $nBytes) _WinAPI_CloseHandle($hFile) $hFile = _WinAPI_CreateFile($sFile2, 2, 2) _WinAPI_ReadFile($hFile, $tBuffer2, $iFileSize, $nBytes) _WinAPI_CloseHandle($hFile) Local $aResult = DllCall("msvcrt.dll", "int:cdecl", "memcmp", "struct*", $tBuffer1, "struct*", $tBuffer2, "uint", DllStructGetSize($tBuffer1)) If @error Or Not IsArray($aResult) Then Return SetError(2, -2, -2) Return $aResult[0] EndFunc Or here regarding image compare:
    1 point
  15. return is working fine , also you can change the color if you want : Func _UIA_DrawRect($tLeft, $tRight, $tTop, $tBottom, $color =0x08B79D, $PenWidth = 4)
    1 point
  16. All this doesn't seem to make sense (for me at least). If you specify reading as binary, all you get is a verbatim (binary) stream of bytes just like you could see using an hex file editor. Mixing file encoding parameters doesn't make sense. I suspect that the core function tries hard to be clever and does overwrite binary flag when ANSI or UTFx are also there, but this is nonsensical. At a restaurant, ask your meat both raw, blue, rare, medium and well done to watch the eyes of the embarrassed waiter. No, it reads the file as binary, verbatim from bytes from disc. A binary file has no encoding, zero, none, nada, ketchi. For instance a jpeg image uses a file format, but no encoding. That question remains yours! You are supposed to know your data and act consistantly: if you read in a .gif, correctly store it as a blob, are you really going to save back the bytes converted to UTF8? File encoding is a metadata and you'd have to handle that extra information by yourself to avoid breaking things down. Suppose I give you a text file without telling you which encoding it was used to create it (e.g. codepage 20905, turkish IBM EBCDIC), then you're unable to process it correctly or, rather, have very little chance of doing so! https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers
    1 point
  17. You can create a script to measure that. Make a script that will run the actual application and measure the time until the process exists. In the same way you can run autoit3.exe with script as parameter and measure the time passed until the process exists. If you want to be even more precise you can write a log with a timestamp from the measuring script when the application is started and from the actual application write also a timestamp when the first line of the script is hit and compare the results. PS: to be relevant probably you should run the tests multiple times and get an average startup time
    1 point
  18. Jon

    Random DoS Attacks

    Hi, some random DoS attacks ongoing at the mo. Server is auto banning, but maybe some outages. Thanks, Jos, for letting me know,
    0 points
×
×
  • Create New...