Leaderboard
Popular Content
Showing content with the highest reputation on 11/01/2018 in all areas
-
Error message but script works
pixelsearch and one other reacted to FrancescoDiMuro for a topic
@Manu191357 Happy to have helped2 points -
Today I start to have problem with one of mine program. He start to be unresposive. Here is an example script which will show you how it happend and how I solve this problem. #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Global $__g_bTryToAvoidUnresponsiveGUI = ($IDYES == MsgBox($MB_YESNO, 'Choose:', 'Should I try to avoid unresponsive GUI ?')) Global $__g_iMinimalWaitTime = 1 Global $__g_idLabel _Example() AdlibUnRegister(_AdlibRegister_Wrapper) Exit Func _Example() AdlibRegister(_AdlibRegister_Wrapper) ; Create a GUI with various controls. Local $hGUI = GUICreate("Example",400,100) $__g_idLabel = GUICtrlCreateLabel('Wait', 10,10, 380, 80) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) Local $idMsg = 0 ; Loop until the user exits. Local $iStep = 0 While Sleep(100) $iStep += 1 ; Try to focus what is going on with this following line when $__g_bTryToAvoidUnresponsiveGUI = False ConsoleWrite("- $iStep =" & $iStep & @CRLF) ; in case $__g_bTryToAvoidUnresponsiveGUI = False ...... did you saw "- $iStep =10" in console ? If $__g_iMinimalWaitTime < 1000 Then ContinueLoop ; if $__g_bTryToAvoidUnresponsiveGUI = False then the following line after few WhileWend Loop, should never be fired properly anymore $idMsg = GUIGetMsg() ConsoleWrite("- $idMsg = " & $idMsg & @CRLF) Switch $idMsg Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>_Example Func _AdlibRegister_Wrapper() Local Static $iCurrentCallInterval = 250 #Region - calling Inner functions and measuring Time Local $hTimer = TimerInit() _AdlibExample_1() _AdlibExample_2() _AdlibExample_3() Local $fDiff = TimerDiff($hTimer) #EndRegion - calling Inner functions and measuring Time $__g_iMinimalWaitTime = $fDiff ConsoleWrite("+ _AdlibRegister_Wrapper: time " & Round($fDiff) & @CRLF) GUICtrlSetData($__g_idLabel, _ "_AdlibRegister_Wrapper: time " & Round($fDiff) & @CRLF & _ @CRLF & _ "Wait until will be > 1000 and then try to close GUI." _ ) #Region TESTING If $__g_bTryToAvoidUnresponsiveGUI And $fDiff > $iCurrentCallInterval Then $iCurrentCallInterval = Round($fDiff) + 100 ConsoleWrite("! NEW INTERVAL=" & $iCurrentCallInterval & @CRLF) AdlibUnRegister(_AdlibRegister_Wrapper) AdlibRegister(_AdlibRegister_Wrapper, $iCurrentCallInterval) EndIf #EndRegion TESTING EndFunc ;==>_AdlibRegister_Wrapper Func _AdlibExample_1() ; sleep 10 ms longer per each start Local Static $iSleep = 1 Local $hTimer = TimerInit() Sleep($iSleep) Local $fDiff = TimerDiff($hTimer) ConsoleWrite("> Example1: time " & Round($fDiff) & @CRLF) $iSleep += 10 EndFunc ;==>_AdlibExample_1 Func _AdlibExample_2() ; sleep 15 ms longer per each start Local Static $iSleep = 1 Local $hTimer = TimerInit() Sleep($iSleep) Local $fDiff = TimerDiff($hTimer) ConsoleWrite("> Example2: time " & Round($fDiff) & @CRLF) $iSleep += 15 EndFunc ;==>_AdlibExample_2 Func _AdlibExample_3() ; sleep 20 ms longer per each start Local Static $iSleep = 1 Local $hTimer = TimerInit() Sleep($iSleep) Local $fDiff = TimerDiff($hTimer) ConsoleWrite("> Example3: time " & Round($fDiff) & @CRLF) $iSleep += 20 EndFunc ;==>_AdlibExample_3 Regards, mLIpok1 point
-
This is not actually a UDF it is an idea to make HWID protection unable to be hacked if the user managed to Get HWIDs list and modified it to add his HWID the idea is that you modify the real hwid to make new hwid (fake hwid) and modify the (fake hwid) to make (shown hwid) by using StringReplace("","") the (real hwid) and (fake hwid) will not be shown to the user ,but (shown hwid ) will be shown ... when the user gives you his (shown hwid),you modify it back to (fake hwid) the (fake hwid) will be put on the online HWIDs list .. when the user who has bought licence , whose fake hwid was put on the online list , open the program , the program would get the user's fake hwid and compare it with the online list and if it was found, the program would work ... else, the program would ask the user to buy a licence so if the user put his/her ( shown hwid ) on the list, the program would not work as the program looks for the (fake hwid) not the (shown hwid) > i hope you like this idea...this idea can be used in all scripting languages here is the script ;~ By ÅÈÑÇåíã ÚÕÇã ÇáÏíä / ibrahem #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <String.au3> #include <Crypt.au3> #include <Array.au3> CheckForDebuggers() Global $FAKEhwid, $FAKEhwid, $REALhwid, $SHOWNhwid, $RealConvertedHwid, $SHOWNtext, $num, $CheckResult, $SAVEDfakeHWID $num = 0 $REALhwid = _GetHWID() ConvertRealHwidToFakeHwid() ConvertFakeHwidToShownHwid() $SAVEDfakeHWID = $FAKEhwid $SHOWNtext = $SHOWNhwid check() If $CheckResult <> 1 Then LicenceForm() ; If hwid was not found then ask to buy licence Func LicenceForm() MouseMove(MouseGetPos(0), MouseGetPos(1), 1) #Region ### START Koda GUI section ### $regester = GUICreate(" Subscribe Form ", 666, 51, -1, -1) $InputHWID = GUICtrlCreateInput($SHOWNhwid, 96, 8, 489, 32, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif") $buyLicence = GUICtrlCreateButton("Subscribe ", 8, 8, 73, 33) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $copyHWID = GUICtrlCreateButton("Copy", 600, 8, 57, 33) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $copyHWID ClipPut($SHOWNtext) Case $buyLicence ;How users can buy licence.. Ex:Shellexecute("your FB page")..or MsgBox(0,"my phone number", "phone number") ; buy licence action ....etc. EndSwitch WEnd EndFunc ;==>LicenceForm Func check() Do Call("SearchForHwid") If $FAKEhwid = $FAKEhwid[$num] Then MsgBox(0, "", "done") $num = $num + 1 If $FAKEhwid[$num] = "finish" Then ExitLoop If $SAVEDfakeHWID = $FAKEhwid[$num] Then ; What happens (after hwid is found / if th user has licence) $CheckResult = 1 ExitLoop EndIf Until $FAKEhwid = "finsh" EndFunc ;==>check Func SearchForHwid() $Source = BinaryToString(InetRead('link of raw online hwids list', 1));(((((((((((((((((((((((((((link of raw online hwids list))))))))))))))))))))))))) $reader = _StringBetween($Source, '{', '}') For $a In $reader $FAKEhwid = _StringBetween($Source, '{', '}') ConsoleWrite($FAKEhwid[$num] & @CRLF) Next EndFunc ;==>SearchForHwid Func _GetHWID() Local $aDrives = DriveGetDrive('FIXED'), $sOutput = '' If @error = 0 Then For $i = 1 To $aDrives[0] $sOutput &= DriveGetSerial($aDrives[$i]) Next EndIf $aDrives = DriveGetDrive('CDROM') If @error = 0 Then For $i = 1 To $aDrives[0] $sOutput &= DriveGetSerial($aDrives[$i]) Next EndIf Local $aMemory = MemGetStats() $sOutput &= @OSVersion & @OSBuild & @OSArch & @CPUArch & @KBLayout & $aMemory[1] $aMemory = 0 $sOutput = StringStripWS($sOutput, 8) Local $sHash = StringTrimLeft(_Crypt_HashData($sOutput, $CALG_MD5), 2) Return StringMid($sHash, 1, 8) & '-' & StringMid($sHash, 9, 4) & '-' & StringMid($sHash, 13, 4) & '-' & StringMid($sHash, 17, 4) & '-' & StringMid($sHash, 21, 12) EndFunc ;==>_GetHWID Func ConvertRealHwidToFakeHwid() $FAKEhwid = $REALhwid $FAKEhwid = StringReplace($FAKEhwid, "A", "Z") $FAKEhwid = StringReplace($FAKEhwid, "B", "1") $FAKEhwid = StringReplace($FAKEhwid, "C", "M") $FAKEhwid = StringReplace($FAKEhwid, "D", "C") $FAKEhwid = StringReplace($FAKEhwid, "E", "D") $FAKEhwid = StringReplace($FAKEhwid, "F", "H") $FAKEhwid = StringReplace($FAKEhwid, "G", "I") $FAKEhwid = StringReplace($FAKEhwid, "H", "L") $FAKEhwid = StringReplace($FAKEhwid, "I", "O") $FAKEhwid = StringReplace($FAKEhwid, "J", "V") $FAKEhwid = StringReplace($FAKEhwid, "K", "E") $FAKEhwid = StringReplace($FAKEhwid, "L", "Y") $FAKEhwid = StringReplace($FAKEhwid, "M", "U") $FAKEhwid = StringReplace($FAKEhwid, "N", "A") $FAKEhwid = StringReplace($FAKEhwid, "O", "7") $FAKEhwid = StringReplace($FAKEhwid, "P", "2") $FAKEhwid = StringReplace($FAKEhwid, "Q", "3") $FAKEhwid = StringReplace($FAKEhwid, "R", "4") $FAKEhwid = StringReplace($FAKEhwid, "S", "5") $FAKEhwid = StringReplace($FAKEhwid, "T", "P") $FAKEhwid = StringReplace($FAKEhwid, "U", "Q") $FAKEhwid = StringReplace($FAKEhwid, "V", "J") $FAKEhwid = StringReplace($FAKEhwid, "W", "K") $FAKEhwid = StringReplace($FAKEhwid, "X", "N") $FAKEhwid = StringReplace($FAKEhwid, "Y", "9") $FAKEhwid = StringReplace($FAKEhwid, "Z", "X") $FAKEhwid = StringReplace($FAKEhwid, "1", "8") $FAKEhwid = StringReplace($FAKEhwid, "2", "G") $FAKEhwid = StringReplace($FAKEhwid, "3", "W") $FAKEhwid = StringReplace($FAKEhwid, "4", "R") $FAKEhwid = StringReplace($FAKEhwid, "5", "0") $FAKEhwid = StringReplace($FAKEhwid, "6", "B") $FAKEhwid = StringReplace($FAKEhwid, "7", "F") $FAKEhwid = StringReplace($FAKEhwid, "8", "S") $FAKEhwid = StringReplace($FAKEhwid, "9", "6") $FAKEhwid = StringReplace($FAKEhwid, "0", "T") $FAKEhwid = StringReplace($FAKEhwid, "-", "-") EndFunc ;==>ConvertRealHwidToFakeHwid Func ConvertFakeHwidToShownHwid() $SHOWNhwid = $FAKEhwid $SHOWNhwid = StringReplace($SHOWNhwid, "A", "Z") $SHOWNhwid = StringReplace($SHOWNhwid, "B", "1") $SHOWNhwid = StringReplace($SHOWNhwid, "C", "M") $SHOWNhwid = StringReplace($SHOWNhwid, "D", "C") $SHOWNhwid = StringReplace($SHOWNhwid, "E", "D") $SHOWNhwid = StringReplace($SHOWNhwid, "F", "H") $SHOWNhwid = StringReplace($SHOWNhwid, "G", "I") $SHOWNhwid = StringReplace($SHOWNhwid, "H", "L") $SHOWNhwid = StringReplace($SHOWNhwid, "I", "O") $SHOWNhwid = StringReplace($SHOWNhwid, "J", "V") $SHOWNhwid = StringReplace($SHOWNhwid, "K", "E") $SHOWNhwid = StringReplace($SHOWNhwid, "L", "Y") $SHOWNhwid = StringReplace($SHOWNhwid, "M", "U") $SHOWNhwid = StringReplace($SHOWNhwid, "N", "A") $SHOWNhwid = StringReplace($SHOWNhwid, "O", "7") $SHOWNhwid = StringReplace($SHOWNhwid, "P", "2") $SHOWNhwid = StringReplace($SHOWNhwid, "Q", "3") $SHOWNhwid = StringReplace($SHOWNhwid, "R", "4") $SHOWNhwid = StringReplace($SHOWNhwid, "S", "5") $SHOWNhwid = StringReplace($SHOWNhwid, "T", "P") $SHOWNhwid = StringReplace($SHOWNhwid, "U", "Q") $SHOWNhwid = StringReplace($SHOWNhwid, "V", "J") $SHOWNhwid = StringReplace($SHOWNhwid, "W", "K") $SHOWNhwid = StringReplace($SHOWNhwid, "X", "N") $SHOWNhwid = StringReplace($SHOWNhwid, "Y", "9") $SHOWNhwid = StringReplace($SHOWNhwid, "Z", "X") $SHOWNhwid = StringReplace($SHOWNhwid, "1", "8") $SHOWNhwid = StringReplace($SHOWNhwid, "2", "G") $SHOWNhwid = StringReplace($SHOWNhwid, "3", "W") $SHOWNhwid = StringReplace($SHOWNhwid, "4", "R") $SHOWNhwid = StringReplace($SHOWNhwid, "5", "0") $SHOWNhwid = StringReplace($SHOWNhwid, "6", "B") $SHOWNhwid = StringReplace($SHOWNhwid, "7", "F") $SHOWNhwid = StringReplace($SHOWNhwid, "8", "S") $SHOWNhwid = StringReplace($SHOWNhwid, "9", "6") $SHOWNhwid = StringReplace($SHOWNhwid, "0", "T") $SHOWNhwid = StringReplace($SHOWNhwid, "-", "-") EndFunc ;==>ConvertFakeHwidToShownHwid Func CheckForDebuggers() ; this func closes some known proxy debuggers ; Charles If WinExists("Charles") Then WinClose("Charles") If ProcessExists("Charles.exe") Then ProcessClose("Charles") ; Fiddler If WinExists("Fiddler") Then WinClose("Fiddler") If ProcessExists("Fiddler.exe") Then ProcessClose("Fiddler.exe") ; Wireshark If ProcessExists("Wireshark.exe") Then ProcessClose("Wireshark.exe") If WinExists("Wireshark") Then WinClose("Wireshark") ; OllyDbg If WinExists("OllyDbg") Then WinClose("OllyDbg") If ProcessExists("OLLYDBG.EXE") Then ProcessClose("OLLYDBG.EXE") ; just expectation If WinExists("Developer") Then WinClose("Developer") If WinExists("debug") Then WinClose("debug") If WinExists("debugger") Then WinClose("debugger") If WinExists("debuger") Then WinClose("debuger") EndFunc ;==>CheckForDebuggers .. and here is the tool that modifies the ( shown hwid ) back to ( fake hwid ) ,which will be put on the online list warning !!!! : YOU Mustn't Give This Tool To the user ... it is only for you ..if you give it to the user , he/she will be able to put his (fake hwid) on the list #NoTrayIcon AutoItSetOption("trayiconhide", 1) Global $fakehwid, $num, $num1 $num = "" $num1 = "" #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <EditConstants.au3> MouseMove(MouseGetPos(0), MouseGetPos(1), 1) #Region ### START Koda GUI section ### Form= $form = GUICreate(" Convert $SHOWNhwid to $FAKEhwid", 490, 99, -1, -1) $inputhwid = GUICtrlCreateInput("", 8, 8, 473, 32, BitOR($gui_ss_default_input, $es_center, $es_readonly)) GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif") $paste = GUICtrlCreateButton("Paste", 336, 48, 137, 41) GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif") $convert = GUICtrlCreateButton("Convert", 176, 48, 137, 41) GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif") $copy = GUICtrlCreateButton("Copy", 16, 48, 137, 41) GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nmsg = GUIGetMsg() Switch $nmsg Case $gui_event_close Exit Case $paste GUICtrlSetData($inputhwid, ClipGet()) Case $convert convertshownhwidtofakehwid() GUICtrlSetData($inputhwid, $fakehwid) Case $copy ClipPut(GUICtrlRead($inputhwid)) EndSwitch WEnd Func convertshownhwidtofakehwid() $fakehwid = GUICtrlRead($inputhwid) Do $num = $num + 1 $fakehwid = StringReplace($fakehwid, "A", "Z") $fakehwid = StringReplace($fakehwid, "B", "1") $fakehwid = StringReplace($fakehwid, "C", "M") $fakehwid = StringReplace($fakehwid, "D", "C") $fakehwid = StringReplace($fakehwid, "E", "D") $fakehwid = StringReplace($fakehwid, "F", "H") $fakehwid = StringReplace($fakehwid, "G", "I") $fakehwid = StringReplace($fakehwid, "H", "L") $fakehwid = StringReplace($fakehwid, "I", "O") $fakehwid = StringReplace($fakehwid, "J", "V") $fakehwid = StringReplace($fakehwid, "K", "E") $fakehwid = StringReplace($fakehwid, "L", "Y") $fakehwid = StringReplace($fakehwid, "M", "U") $fakehwid = StringReplace($fakehwid, "N", "A") $fakehwid = StringReplace($fakehwid, "O", "7") $fakehwid = StringReplace($fakehwid, "P", "2") $fakehwid = StringReplace($fakehwid, "Q", "3") $fakehwid = StringReplace($fakehwid, "R", "4") $fakehwid = StringReplace($fakehwid, "S", "5") $fakehwid = StringReplace($fakehwid, "T", "P") $fakehwid = StringReplace($fakehwid, "U", "Q") $fakehwid = StringReplace($fakehwid, "V", "J") $fakehwid = StringReplace($fakehwid, "W", "K") $fakehwid = StringReplace($fakehwid, "X", "N") $fakehwid = StringReplace($fakehwid, "Y", "9") $fakehwid = StringReplace($fakehwid, "Z", "X") $fakehwid = StringReplace($fakehwid, "1", "8") $fakehwid = StringReplace($fakehwid, "2", "G") $fakehwid = StringReplace($fakehwid, "3", "W") $fakehwid = StringReplace($fakehwid, "4", "R") $fakehwid = StringReplace($fakehwid, "5", "0") $fakehwid = StringReplace($fakehwid, "6", "B") $fakehwid = StringReplace($fakehwid, "7", "F") $fakehwid = StringReplace($fakehwid, "8", "S") $fakehwid = StringReplace($fakehwid, "9", "6") $fakehwid = StringReplace($fakehwid, "0", "T") $fakehwid = StringReplace($fakehwid, "-", "-") Until $num = 209 $num = 0 EndFunc The online list of HWiDs must be written like this : {start} {(Fake HWiD 1)} {(Fake HWiD 2)} {(Fake HWiD 3)} {(...etc)} {finish} if you like it . give me a "like" 🙏 sorry for bad English1 point
-
Monitoring a web page for real time update
Davidowicza reacted to FrancescoDiMuro for a topic
@Davidowicza How are you still alive? I aimed at your head By the way, that's the right path that he has to follow... You only confirmed it1 point -
Monitoring a web page for real time update
FrancescoDiMuro reacted to Davidowicza for a topic
Have you done any work on your own? If so, please show it so we can help. We are a community that helps people build their own script, not build it for them. If you haven't done anything yet, try starting with using _IE functions @FrancescoDiMuro fast with the draw I see... haha1 point -
Monitoring a web page for real time update
Davidowicza reacted to FrancescoDiMuro for a topic
Hi @DavidES61 It's possible to do it with AutoIt... But you have to put some effort in it, so, start to look at _IE* functions to interact with IE. Then, post your script here1 point -
EXE files are very badly secured
FrancescoDiMuro reacted to Jos for a topic
That topic has been beaten to dead. *click*1 point -
First of all, you told the snapshot function to take a snapshot of the whole screen, try limiting that. Second, your False parameter is in the wrong place, if you don't want it to not take a new snapshot, you need to add the ShadeVariation entry, if the False is for the shadevariation, try using 0 instead. FFNearestSpot(10, 5,1112,703, 0xED1C24, 0, False) Something like that, untested. N.B. I've never used this UDF so I'm going by what's in the help file, which you should have read by now.1 point
-
How to automate button click in a GUI?
Iulia_Vascan reacted to junkew for a topic
Read this carefully to see how to change your registry so that your uiwrappers.au3 does not have to be in same folder as your script https://www.autoitscript.com/autoit3/docs/keywords/include.htm simplespy generates generic identification so if you have empty on properties Title:=;controltype:=UIA_CustomControlTypeId;class:= you can change it to controltype:=UIA_CustomControlTypeId which will only work if there is one control or its the first on this level1 point -
How to automate button click in a GUI?
Iulia_Vascan reacted to Earthshine for a topic
Uiawrapper should be in same directory yiur script runs from1 point -
How to automate button click in a GUI?
Iulia_Vascan reacted to FrancescoDiMuro for a topic
@Iulia_Vascan If you click on the file of the include ( .au3 ), and then press Ctrl + I, you'll open the include file, in which you should find _UIA_setVar() function. Maybe it is called in another way, or maybe you have to include another "library"1 point -
Possible to retrieve html into text file?
FrancescoDiMuro reacted to Danp2 for a topic
Yes.... Post a script that will actually run Add some error checking Stop asking "Does anyone have any suggestions?"1 point -
never say "unhackable". I can think of several ways this concept can be defeated. You posted the script here so a user can get it memory reading google - researching on how to get around the problem Good idea on how to stop most of them though.1 point
-
Error message but script works
Manu191357 reacted to FrancescoDiMuro for a topic
@Manu191357 Yes, it was a typo! I edited the code in the previous post, so copy-paste it again1 point -
Error message but script works
Manu191357 reacted to FrancescoDiMuro for a topic
@error is a code that is returned almost from every function in AutoIt. It indicates that has been an error when you called your function, and, the error code, tells you where the error "appeared". To debug error codes, just add an If...Else...EndIf statement to your script... Something like this: Local $intLinksNumber = 0 $tags = _IELinkGetCollection($oIE) ; Start error checking of the calling of the previous function $intLinksNumber = @extended If @error Then ConsoleWrite("Error while calling the function '_IELinkGetCollection()'. Error: " & @error & @CRLF) Else ConsoleWrite("There have been found '" & $intLinksNumber "' links in the web-page." & @CRLF) For $tag in $tags $class_value = $tag.className If $class_value = "btn-go-to-search-page" Then _IEAction ($tag,"click") ; You could do the same here _IELoadWait($oIE,4000) ; You could do the same here Local $linkButton = _IEGetObjById($oIE,"logout") ; You could do the same here _IEAction ($linkButton,"click") ; You could do the same here EndIf Next EndIf1 point -
Error message but script works
Manu191357 reacted to FrancescoDiMuro for a topic
@Manu191357 Try to use _IETagNameGetCollection(), so you can see if it is returned correctly a collection. And, as I always reccomend, use @error debugging, so you can see if there is any error when you call you functions EDIT: Or, even better, _IELinkGetCollection()1 point -
Error on _IEFormElementSetValue
Manu191357 reacted to FrancescoDiMuro for a topic
@Manu191357 Replace the "=(" with "(" in the calling of _IEFormElementSetValue()1 point -
Danyfirex, thank you very much. The variables used to close the program are $bExit and $aData[2]: ; $aItems, $aColors and $bExit Local $psaItemsData, $psaColorsData, $bExit = False $aData[2] = DllStructGetPtr( DllStructCreate( $tagVARIANT ) ) AccArrays03( Copy, $aItems, $aColors, $bExit ) The Copy() function that's executed by AccArrays03() copies $bExit to $aData[2] in this way: VariantCopy( $aData[2], $pvExit ) Now $aData[2] is a real windows variant that can be accessed from both AutoIt and C/C++. This means that $aData[2] is a pointer to a variant structure defined by $tagVARIANT. And since it's copied from $bExit which is a boolean (False/True or 0/1), $aData[2] is a variant of type $VT_BOOL: Global Const $tagVARIANT = _ "word vt;" & _ ; 2 bytes, contains the value $VT_BOOL (= 11 = 0x000B) for $aData[2] "word r1;" & _ ; 2 bytes, reserved for Windows "word r2;" & _ ; 2 bytes, reserved for Windows "word r3;" & _ ; 2 bytes, reserved for Windows "ptr data; ptr" ; 8 (32 bit) or 16 (64 bit) bytes data field Because $aData[2] is a boolean variant, only the first two bytes of the data field is used to store the boolean value (usually 0 or 1, but any non-zero value that fits into two bytes can be used instead of 1). And these two bytes are interpreted as a short. That's the Microsoft definition. Because $aData[2] is a pointer to the start of the variant structure, $aData[2] + 8 is a pointer directly to the data field. This means that the value of the data field (the boolean value) can be read this way: $tShort = DllStructCreate( "short", $aData[2] + 8 ) $bValue = DllStructGetData( $tShort, 1 ) Or simply: $bValue = DllStructGetData( DllStructCreate( "short", $aData[2] + 8 ), 1 ) And since $bValue is a boolean (True/False or 1/0 or non-zero/zero) it can simply be tested this way: If $bValue Then ... Or: If DllStructGetData( DllStructCreate( "short", $aData[2] + 8 ), 1 ) Then ... You can read more about variants (and safearrays) in Accessing AutoIt Variables. Now to the error. Replace this line in ListView2.au3: $aData[2] = DllStructGetPtr( DllStructCreate( $tagVARIANT ) ) With these two lines: Local $tVARIANT = DllStructCreate( $tagVARIANT ) $aData[2] = DllStructGetPtr( $tVARIANT ) A structure must be assigned to a variable to prevent the allocated memory to be used for something else. And that was exactly what was happening. When the two bytes given by $aData[2] + 8 were filled with a non-zero value in a very random way, the program immediately closed. If you were lucky. In worst case it would crash with some kind of memory access violation error. 0xC0000005 or something. New zip-file with updated ListView2.au3 in bottom of first post.1 point
-
Since you asked, I have a few -- Try running the code as provided so that we can actually help you. Modifying it and then complaining that it doesn't work doesn't get you anywhere. Stick to one thread. It gets repetitive when you keep posting the same requests in multiple places Try something different. Perhaps there's an issue with your current workstation. Try running the script in another environment Finally, here's a way to retrieve the data without having to page through it all -- #include <Array.au3> #include <IE.au3> _IEErrorNotify(True) Global $oIE = _IECreate("http://www.aastocks.com/en/stocks/analysis/transaction.aspx?symbol=00005", 1) Global $jsEval, $iLen, $iIndex, $sData $oIE.document.parentWindow.setTimeout('document.head.eval = eval', 0) Do Sleep(250) $jsEval = Execute('$oIE.Document.head.eval') Until IsObj($jsEval) Do Sleep(250) Until $jsEval("RawSummary.totalVol") <> 0 $sData = $jsEval("JSON.stringify(RawSummary.filterData)") $sPattern = "(?:\""|\')(?:[^""]*)(?:\""|\')(?=:)(?:\:\s*)(?:\"")?(true|false|[-0-9]+[\.]*[\d]*(?=,)|[0-9a-zA-Z\(\)\@\:\,\/\!\+\-\.\$\ \\\']*)(?:\"")?" $aData = StringRegExp($sData, $sPattern, $STR_REGEXPARRAYGLOBALMATCH) _ArrayDisplay($aData)1 point
-
How to automate button click in a GUI?
Iulia_Vascan reacted to Earthshine for a topic
yeah, run simplespy, move your mouse over the app and press Ctrl-W, then paste the code to your AutoIt editor and start playing around. IUIAutomation is not really that difficult when you figure out what you looking for. I suggest going through all the examples and getting stuff to work and start learning that way. if you need more help, post back. One thing I have done to really get into @junkew's IUIAutomation is study his actual UDF code. it's a gold mine. but that comes later, for now, get the samples to work, we can help with that. post back if you need help. That Dolomites program is pretty cool actually. Playing with coils... sweet.1 point -
How to automate button click in a GUI?
Iulia_Vascan reacted to caramen for a topic
He just used the IUIAutomation UDF. That is allowing you to automate.net windows that autoIT cannot automate. This UDF request some training. Mail you can search in my precedent posts. I have a topic named IUIAutomation learning. It will show you how i learned it and what issue i encoutered and how i resolved them. You will have to face on this if you want to use IUIA UDF. Here you go :1 point -
Python To Autoit
FrancescoDiMuro reacted to TheDcoder for a topic
I polished up @mLipok's script to look more like what a normal AutoIt script would look like instead of being an exact translation Local $degree = InputBox("Enter the degree [BA / BSC / BIS / BBA] :", '') Local $name = "" Local $maxEnrollment = 80 If $degree = "BA" Or $degree = "BSC" Or $degree = "BIS" Or $degree = "BBA" Then If $degree = "BA" Then $name = "Department of Bachelor of Arts" ElseIf $degree = "BSC" Then $name = "Department of Bachelor of Science" ElseIf $degree = "BIS" Then $name = "Department of Information Systems" ElseIf $degree = "BBA" Then $name = "Department of Bachelor of Administration" Else ConsoleWrite(@CRLF & "INVALID DEGREE PROGRAM - PLEASE ENTER A NEW DEGREE PROGRAM") EndIf EndIf Few things to note: The equal operator can be used for both comparison and assignment in AutoIt, the meaning changes based on the context No string substitution is done in AutoIt, so you have to manually construct a string by the concatenation/joining operator (&) @CRLF is a special variable (called a macro) which is equal to /r/n in python string substitution. (@LF is equal to just \n) Most AutoIt development is done on a GUI basis rather than console-based input/output, ConsoleWrite is used for quick runtime debugging or to output fairly technical information, most of the time you would be using the MsgBox and InputBox functions to interact with the users. Don't under-estimate the awesome help file which is an all round reference to the AutoIt language, it comes installed with AutoIt and you can press F1 in SciTE to open it By the way welcome to AutoIt Forums.1 point -
Hello! Please test my FunSkin UDF and tell me what you think about it. You will need the WinAPIEx UDF. FunSkin UDF V0.0.0.4 FunSkin UDF 0.0.0.4.rar1 point
-
Hi! Today I want to show you my current AutoIt project: The ISN AutoIt Studio. The ISN AutoIt Studio is a complete IDE made with AutoIt, for AutoIt! It includes a GUI designer, a code editor (with syntax highlighting, auto complete & intelisense), a file viewer, a backup system, trophies and a lot more features!! Here are some screenshots: Here some higlights: -> easy to create/manage/public your AutoIt-projects! ->integrated GUI-Editor (ISN Form Studio 2) ->integrated - file & projectmanager ->auto backupfunction for your Projects ->extendable with plugins! ->available in several languages ->trophies ->Syntax highlighting /Autocomplete / Intelisense ->Dynamic Script ->detailed overview of the project (total working hours, total size...) And much more!!! -> -> Click here to download ISN AutoIt Studio <- <- Here is the link to the german autoit forum where I posted ISN AutoIt Studio the first time: http://autoit.de/index.php?page=Thread&threadID=29742&pageNo=1 For more information visit my Homepage: https://www.isnetwork.at So….have fun with ISN AutoIt Studio! PS: Sorry for my bad English! ^^1 point
-
1 point
-
1 point
-
Hehe, this is one of my very first programs. It's very simple, not like the ones above. nandc.zip Edit Actually it's nostalgic to look at this again. Watching the engine play itself on easy level is quite neat - with the forced winning continuations shown in blue, drawn continuations in yellow and loosing continuations in red. It's like watching a disco light show. Does not use minimax which would reduce the variety of playing lines.1 point
-
Working with Internet Explorer Tabs
boomingranny reacted to MilesAhead for a topic
I suggest you use the window spy tool, IE and figure it out. Trial and error is like 90% of programming. Getting other people to do it for you is more appropriate to a forum on management techniques.1 point -
SMTP Server Tester
boomingranny reacted to DeltaRocked for a topic
SMTP Server Audit, contains a part of your code. http://www.autoitscript.com/forum/index.php?showtopic=119933&st=0&p=833298&hl=SMTP%20Server%20Audit&fromsearch=1&#entry833298 Hope you find this useful. Regards Deltarocked.1 point -
@ibrahem, I see you did not read those rules, to which I linked, very carefully - you missed the part that says: "Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above" Do NOT start another thread on this - our patience has limits. Jos0 points
-
Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. The Moderation team0 points