Leaderboard
Popular Content
Showing content with the highest reputation on 11/19/2023 in all areas
-
UPDATE: Still taking a break from this project, for a little while longer. Sort of, I have been working on IRC stuff, focusing on why IRC stopped working after 3.3.8.1, and now have IRC working wonderfully with the newest version of Autoit, and used to expand Frankenstein UDF, which is now available in the Autoit Examples section. The game currently comes with version 1.0, and all further versions will come with the updated version 1.1+ of Frankenstein. When I really get back into it I am going to first focus on another battle mode, where it will not be turn based and will instead be a screen with enemies, and you are able to maneuver around the screen attacking/dodging enemies, a comparison to this would be like what you see in the old Zelda games. The turn based mode will stay too, of course. Will also expand on stuff that already exists. I may attempt to try adding full screen, tho my previous attempts at this have me thinking that if I do a full screen option, it will be the only screen option. I've found it being very tricky to get dimensions and images sizes correct when switching between full screen and non-full screen. We'll see what I can come up with. Will also be going thru and refining some of the existing code. List of things I want to add later down the road: Swimming/water stuff Character survival (Eating and status ailments) More NPC interaction and locomotion Background animations in Free-mode (currently if you minimize the game and bring it back up the graphics in free roam disappear, because it's not in a constant state of animation.) Shops/Armory Toying with the idea of, if you die in the game your character is sent to the after life which contains a feiry maze full of enemies, if you navigate and survive the maze to the end you are respawned in the overworld alive again, if you die in the maze you respawn at the start. I got this idea from an old Macintosh RPG called TaskMaker. More to come...2 points
-
Latest Version: 1.2 11-26-2023 This is a UDF I've put together over my time using Autoit. Built on needs that I've come across while making scripts, and figure other people could maybe find use of it. Also contains _FileCreate and _IsPressed. Version 1.2 Additions Added some new IRC Functions, IRC_Set_ChanTopic, IRC_Chanserv, IRC_Nickserv, IRC_Change_Nick Added some various time conversion functions, a little more singular than using _TicksToTime. Converts milliseconds, seconds, minutes. It does convert options into hours, but didn't come across a need to convert hours backwards, but will probably be a thing in future versions of this UDF. Made some small refining changes to Token String Functions. No script breakage. I am, currently, always adding new stuff and changes, and will post updates as changes are made or new functions added. It's not quite perfect, but it does work well. Some code could probably be refined, but as I stated, I'm always playing with this UDF. Current Functions Examples (UDF contains documentation on every function and how to use it.) Time Conversion Token Strings IRC Functions Example (uses various functions from Frankenstein.au3) Frankenstein UDF v1.2: Frankenstein.au3 If, for some reason, you would like or need an older version of Frankenstein UDF, feel free to send me a PM.1 point
-
https://learn.microsoft.com/en-us/windows/win32/api/uiautomationclient/ne-uiautomationclient-treescope Its all based on microsoft Windows sdk header and idl files.1 point
-
I needed a tool to test simple assembly code so I end up with this. This is written using fasmg (a bare assembly engine) to generate binary code for various CPU architectures and you can directly call (test) the code with few parameters. Even if it can generate code for various CPUs, use the call/execute functionality just in 32-bit mode (really, don't try to run 64-bit code and then ask why it doesn't work or why it's crashing ). Basically write the asm code in the left edit control and binary code will be generated automatic in the right panel (if you don't have errors). Before writting the asm code make sure you included cpu/x64.inc (or whatever CPU architecture is your CPU) and maybe one of the directive use16, use32, use64 (use32 if you want to execute the code from application). Also if you want to resolve the offset for each line (this is not mandatory), include line.inc after you included all other includes (example below). #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Comment=Real Time Assembler #AutoIt3Wrapper_Res_Description=Real Time Assembler #AutoIt3Wrapper_Res_Fileversion=1.0.0.3 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Res_ProductVersion=1 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include 'BinaryCall.au3' #include 'Fasmg.au3' If @AutoItX64 Then MsgBox(0x10, 'Error', 'This application can run just in 32-bit mode.') ; MB_ICONERROR Exit EndIf Global $hMain, $cCode, $cAsm, $hCode Global $cParam1, $cParam2, $cParam3, $cParam4, $cParam5, $cResult Global $sFont = 'Segoe UI', $iFontSize = 12 Global Const $ParamTypes = 'none|byte|boolean|short|ushort|word|int|long|' & _ 'bool|uint|ulong|dword|int64|uint64|ptr|hwnd|handle|float|double|int_ptr|' & _ 'long_ptr|lresult|lparam|uint_ptr|ulong_ptr|dowrd_ptr|wparam|str|wstr|struct' $hMain = GUICreate('Real Time Assembler', 1000, 600) $cCode = GUICtrlCreateEdit('', 10, 10, 385, 580, 0x00201000) ; WS_VSCROLL + ES_WANTRETURN $cAsm = GUICtrlCreateEdit('', 405, 10, 385, 580, 0x00200800) ; WS_VSCROLL + ES_READONLY $cParamLabel = GUICtrlCreateLabel('Parameters', 800, 10, 200, 20, 0x200) ; SS_CENTERIMAGE $cType1 = GUICtrlCreateCombo('', 800, 40, 190, 30, 0x03) ; CBS_DROPDOWNLIST $cParam1 = GUICtrlCreateInput('', 800, 80, 190, 30) $cType2 = GUICtrlCreateCombo('', 800, 120, 190, 30, 0x03) ; CBS_DROPDOWNLIST $cParam2 = GUICtrlCreateInput('', 800, 160, 190, 30) $cType3 = GUICtrlCreateCombo('', 800, 200, 190, 30, 0x03) ; CBS_DROPDOWNLIST $cParam3 = GUICtrlCreateInput('', 800, 240, 190, 30) $cType4 = GUICtrlCreateCombo('', 800, 280, 190, 30, 0x03) ; CBS_DROPDOWNLIST $cParam4 = GUICtrlCreateInput('', 800, 320, 190, 30) $cType5 = GUICtrlCreateCombo('', 800, 360, 190, 30, 0x03) ; CBS_DROPDOWNLIST $cParam5 = GUICtrlCreateInput('', 800, 400, 190, 30) $cResultLabel = GUICtrlCreateLabel('Result', 800, 440, 190, 20, 0x200) ; SS_CENTERIMAGE $cRetType = GUICtrlCreateCombo('', 800, 470, 190, 30, 0x03) ; CBS_DROPDOWNLIST $cResult = GUICtrlCreateLabel('', 800, 510, 190, 30, 0x1000) ; SS_SUNKEN $cRun = GUICtrlCreateButton('Execute', 845, 560, 100, 30) $hCode = GUICtrlGetHandle($cCode) GUICtrlSetBkColor($cAsm, 0xFFFFFF) GUICtrlSetFont($cCode, $iFontSize, Default, Default, $sFont) GUICtrlSetFont($cAsm, $iFontSize, Default, Default, $sFont) GUICtrlSetFont($cParamLabel, $iFontSize, Default, Default, $sFont) GUICtrlSetFont($cType1, $iFontSize, Default, Default, $sFont) GUICtrlSetFont($cType2, $iFontSize, Default, Default, $sFont) GUICtrlSetFont($cType3, $iFontSize, Default, Default, $sFont) GUICtrlSetFont($cType4, $iFontSize, Default, Default, $sFont) GUICtrlSetFont($cType5, $iFontSize, Default, Default, $sFont) GUICtrlSetFont($cRetType, $iFontSize, Default, Default, $sFont) GUICtrlSetFont($cParam1, $iFontSize, Default, Default, $sFont) GUICtrlSetFont($cParam2, $iFontSize, Default, Default, $sFont) GUICtrlSetFont($cParam3, $iFontSize, Default, Default, $sFont) GUICtrlSetFont($cParam4, $iFontSize, Default, Default, $sFont) GUICtrlSetFont($cParam5, $iFontSize, Default, Default, $sFont) GUICtrlSetFont($cRun, $iFontSize, Default, Default, $sFont) GUICtrlSetFont($cResultLabel, $iFontSize, Default, Default, $sFont) GUICtrlSetFont($cResult, $iFontSize, Default, Default, $sFont) GUICtrlSendMsg($cParam1, 0x1501, False, 'Param# 1') ; EM_SETCUEBANNER GUICtrlSendMsg($cParam2, 0x1501, False, 'Param# 2') ; EM_SETCUEBANNER GUICtrlSendMsg($cParam3, 0x1501, False, 'Param# 3') ; EM_SETCUEBANNER GUICtrlSendMsg($cParam4, 0x1501, False, 'Param# 4') ; EM_SETCUEBANNER GUICtrlSendMsg($cParam5, 0x1501, False, 'Param# 5') ; EM_SETCUEBANNER GUICtrlSetData($cType1, $ParamTypes, 'none') GUICtrlSetData($cType2, $ParamTypes, 'none') GUICtrlSetData($cType3, $ParamTypes, 'none') GUICtrlSetData($cType4, $ParamTypes, 'none') GUICtrlSetData($cType5, $ParamTypes, 'none') GUICtrlSetData($cRetType, $ParamTypes, 'none') GUISetState(@SW_SHOW, $hMain) EnvSet('INCLUDE', @ScriptDir & '\include') $hFasmg = Memory_DllOpen(Base64($Fasmg, False)) ConsoleWrite('Fasmg version: ' & Memory_DllCall($hFasmg, 'str', 'fasmg_GetVersion')[0] & @CRLF) GUIRegisterMsg(0x0111, "WM_COMMAND") ; WM_COMMAND While True Switch GUIGetMsg() Case -3 ; GUI_EVENT_CLOSE ExitLoop Case $cRun CallFunction() EndSwitch Sleep(10) WEnd Memory_DllClose($hFasmg) Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg If $lParam = $hCode And BitShift($wParam, 16) = 0x0300 Then ; EN_CHANGE Local $sBinaryCode = Compile(GUICtrlRead($cCode)) GUICtrlSetData($cAsm, $sBinaryCode) EndIf Return 'GUI_RUNDEFMSG' EndFunc Func Compile($sCode, $iBufferSize = 5000) If Not $sCode Then Return Local $iCodeLines = 0, $iPrefix = 0 Local $iLine = StringRegExp($sCode, '^([\s\S]*)(include ''line.inc'')([\s\S]*)$', 0) Local $iDirective = StringRegExp($sCode, '^([\s\S]*)(use16|use32|use64)([\s\S]*)$', 0) If $iLine Then Local $aCode = StringSplit($sCode, @CRLF, 1) For $Index = 1 To $aCode[0] If StringStripWS($aCode[$Index], 7) = 'include ''line.inc''' Then $iCodeLines = $aCode[0] - $Index + 1 $iPrefix = $aCode[0] - $iCodeLines ExitLoop EndIf Next EndIf Local $tMemory = DllStructCreate('byte Code[' & $iBufferSize & ']') Local $pMemory = DllStructGetPtr($tMemory) Local $tFasmg = DllStructCreate('dword Address; dword Size;') DllStructSetData($tFasmg, 'Address', $pMemory) DllStructSetData($tFasmg, 'Size', DllStructGetSize($tMemory)) Local $aCall = Memory_DllCall($hFasmg, 'int', 'fasmg_Assemble', 'str', $sCode, 'str', Null, 'ptr', DllStructGetPtr($tFasmg), 'str', Null, 'handle', Null, 'handle', Null) If $aCall[0] = 0 Then Local $sResult = '' If $iLine And $iDirective And $iCodeLines Then Local $NextOffset = 1, $CurrentOffset = 0, $PrevOffset = 0 Local $iActualCodeSize = DllStructGetData($tFasmg, 'Size') - ($iCodeLines * 4) Local $tActualCode = DllStructCreate('byte Code[' & $iActualCodeSize & ']', $pMemory) Local $sBinary = DllStructGetData($tActualCode, 'Code') Local $iOffsets = (DllStructGetData($tFasmg, 'Size') - $iActualCodeSize) / 4 Local $tOffsets = DllStructCreate('dword Offset[' & $iOffsets & ']', $pMemory + $iActualCodeSize) For $Index = $iOffsets - 2 to 1 Step -1 $CurrentOffset = Number(DllStructGetData($tOffsets, 'Offset', $Index)) $sResult &= Stylize(BinaryMid($sBinary, $NextOffset, $CurrentOffset - $PrevOffset)) $NextOffset += $CurrentOffset - $PrevOffset $PrevOffset = $CurrentOffset Next For $Index = 1 To $iPrefix + 2 $sResult = @CRLF & $sResult Next Else Local $tCode = DllStructCreate('byte Code[' & DllStructGetData($tFasmg, 'Size') & ']', $pMemory) $sResult = Stylize(DllStructGetData($tCode, 'Code')) EndIf Return $sResult Else Return '' EndIf EndFunc Func Stylize($sBinaryCode) Local $sCode = StringTrimLeft(StringStripWS(String($sBinaryCode), 3), 2) Local $iLen = StringLen($sCode) If Mod($iLen, 2) <> 0 Then Return @CRLF & @CRLF Local $sResult For $Index = 1 To $iLen Step 2 $sResult &= StringMid($sCode, $Index, 2) & ' ' Next Return StringStripWS($sResult, 3) & @CRLF EndFunc Func CallFunction() If @AutoItX64 Or StringInStr(GUICtrlRead($cCode), 'use64') Then GUICtrlSetData($cResult, 'No!') Return EndIf Local $sCode = StringStripWS(GUICtrlRead($cAsm), 8) If Not $sCode Then Return Local $aRet Local $sRetType = GUICtrlRead($cRetType) Local $sType1 = GUICtrlRead($cType1) Local $vParam1 = GUICtrlRead($cParam1) Local $sType2 = GUICtrlRead($cType2) Local $vParam2 = GUICtrlRead($cParam2) Local $sType3 = GUICtrlRead($cType3) Local $vParam3 = GUICtrlRead($cParam3) Local $sType4 = GUICtrlRead($cType4) Local $vParam4 = GUICtrlRead($cParam4) Local $sType5 = GUICtrlRead($cType5) Local $vParam5 = GUICtrlRead($cParam5) Local $dCode = Binary('0x' & $sCode) Local $iSize = BinaryLen($dCode) Local $tCode = DllStructCreate('byte Code[' & $iSize & ']') DllStructSetData($tCode, 'Code', $dCode) Local $sCall = 'DllCallAddress(''' & $sRetType & ''',' & DllStructGetPtr($tCode) & ',' If $vParam1 Then $sCall &= '''' & $sType1 & ''',' & (($sType1 = 'str' Or $sType1 = 'wstr') ? ('''' & $vParam1 & '''') : $vParam1) & ',' EndIf If $vParam2 Then $sCall &= '''' & $sType2 & ''',' & (($sType2 = 'str' Or $sType2 = 'wstr') ? ('''' & $vParam2 & '''') : $vParam2) & ',' EndIf If $vParam3 Then $sCall &= '''' & $sType3 & ''',' & (($sType3 = 'str' Or $sType3 = 'wstr') ? ('''' & $vParam3 & '''') : $vParam3) & ',' EndIf If $vParam4 Then $sCall &= '''' & $sType4 & ''',' & (($sType4 = 'str' Or $sType4 = 'wstr') ? ('''' & $vParam4 & '''') : $vParam4) & ',' EndIf If $vParam5 Then $sCall &= '''' & $sType5 & ''',' & (($sType5 = 'str' Or $sType5 = 'wstr') ? ('''' & $vParam5 & '''') : $vParam5) & ',' EndIf $sCall = StringTrimRight($sCall, 1) & ')' $aRet = Execute($sCall) GUICtrlSetData($cResult, IsArray($aRet) ? $aRet[0] : '') EndFunc To make this work I rewrite ward's BinaryCall UDF to use DllCallAddress() and get rid of kernel API hack, but this can work without this UDF with fasmg.dll as a file (I just prefer to load it from memory). Probably it have some bugs but right now it's a tool that can be used for fast debug of assembly code. A simple example: include 'cpu/x64.inc' include 'line.inc' use32 mov eax, [esp+4] add eax, [esp+8] ret 8 This is a simple function that add two integers Add(int a, int b) and return an integer as result. RTA.zip1 point
-
Anyway I am planning to change the GUI and other parts of the script so the user might be able to define structures and modify the data within and then use the pointers to these structures as parameters in calls. When this changes will take place probably I will replace that part also with better regex patterns.1 point
-
Hi Jos, I think I found another bug.... Calling a function in a function call brings up the wrong call tip. Local $sString Func _FUNC1($sParam1, $sParam2) EndFunc Func _FUNC2($sString1, $sString2) EndFunc _FUNC1($sString, _FUNC2(1 point
-
I meant more on the Autoit TCP/IP stuff, there is definitely something different in newer versions of Autoit, where the socket closes in certain instances where it should stay open, I found that if I set the TCPTimeout to 1500+ ms and add Sleep(100) afte connecting, it works around this issue. Could have just been the way I was writing/using scripts also, but either way I am glad that I got it working for me, as that would've been a major bummer for this project if IRC could not work anymore.1 point
-
It's not needed if you don't wish to authenticate, and the server will definitely disconnect you if you provide invalid credentials like "TestScript" So definitely remove the function calls to Auth functions. Not sure about other UDFs but the documentation on mine should be up to date according to the IRCv3.1 standard, which is fairly modern compared to the older RFCs. The IRC standards committee doesn't use version numbers anymore but everything should be backward compatible.1 point
-
When I was using this function, I felt that including all the extra stuff from File.au3 just to use the one function was a bit overkill. After looking it over, I saw that the only thing that kept it from being universal was the $FO_OVERWRITE constant, which to me seemed unnecessary to use a constant variable here, so I just switched it to the raw value of $FO_OVERWRITE.1 point
-
Func _FileCreate($sFilePath, $data = "", $mode = 2) Local $hOpenFile = FileOpen($sFilePath, $mode) If $hOpenFile = -1 Then Return SetError(1, 0, 0) Local $hWriteFile = FileWrite($hOpenFile, $data) FileClose($hOpenFile) If $hWriteFile = -1 Then Return SetError(2, 0, 0) Return 1 EndFunc ;===> _FileCreate ..is a good expansion/flexibility, for something that's already there.1 point