Leaderboard
Popular Content
Showing content with the highest reputation on 01/12/2016 in all areas
-
Such a pity to have to dust off this section of the forum - is it really nearly 3 months since the last time it was needed? Anyway, posting grossly insulting language when offered pointers to answers which are easily available in the Help file is not something we want to encourage. Amongst the insults you mentioned that you intended to "quit the AutoIt forums" - so I will help you in keeping this New year resolution by banning your account. As all you do is ask about gamebots, I do not think you will be any great loss to the community. M234 points
-
CodeCrypter enables you to encrypt scripts without placing the key inside the script. This is because this key is extracted from the user environment at runtime by, for example: password user query any macro (e.g., @username) any AutoIt function call any UDF call some permanent environment variable on a specific machine (and not created by your script) a server response a device response anything else you can think of, as long as it's not stored in the script any combination of the above You need several scripts to get this to work, and they are scattered over several threads, so here's a single bundle that contains them all (including a patched version of Ward's AES.au3; with many thanks to Ward for allowing me to include this script here): Latest version: 3.4 (3 Dec 2021): please follow this link. Note: if you experience issues under Win8/8.1 (as some users have reported), please upgrade to Win10 (or use Win7) if you can; as far as I can tell, the scripts in the bundle all work under Win7 & Win10 (and XP). Moreover, I have no access to a Win8 box, so these issues will not be fixed, at least not by yours truly. How the bits and pieces fit together: CodeCrypter is a front-end for the MCF UDF library (you need version 1.3 or later). Its thread is here: '?do=embed' frameborder='0' data-embedContent>> The MCF package (also contained in the CodeScannerCrypter bundle) contains MCF.au3 (the library itself) plus a little include file called MCFinclude.au3. The latter you have to include in any script you wish to encrypt. Any code preceding it will not be encrypted, any code following it will be encrypted. You define the dynamic key inside MCFinclude.au3, in the UDF: _MCFCC_Init(). From the same post you can download an MCF Tutorial which I heartily recommend, because encrypting a script requires a number of steps in the right order, namely: In MCFinclude.au3, define and/or choose your dynamic key(s) (skip this step = use default setting) include MCFinclude.au3 in your target script Run CodeScanner (version 2.3+) on your target script, with setting WriteMetaCode=True (see '?do=embed' frameborder='0' data-embedContent>>), then close CodeScanner. Start CodeCrypter press the Source button to load your target file enable Write MCF0 (tick the first option in Main Settings) Enable "Encrypt" (last option in the Main Settings) Go to the Tab Encrypt and set up the encryption the way you want (skip this = use default settings) Return to Main Tab and press "Run" if all goes well, a new script called MCF0test.au3 is created in the same directory as your target. It has no includes and no redundant parts. Please check that it works as normal. (see Remarks if not) It all sounds far more complicated than it is, really. Not convinced? Check out: a simple HowTo Guide: HowToCodeCrypt.pdf an updated and extended Q & A pdf (FAQ, also included in the bundle) to help you get started:CodeCrypterFAQ.pdf For additional explanations/examples in response to specific questions by forum members (how it works, what it can/cannot do), see elsewhere in this thread, notably: Simple analogy of how it works: post #53, second part General Explanation and HowTo: post #9, 51, 75, 185/187, 196, 207, 270, 280 (this gets a bit repetitive) BackTranslation: post #179 Obfuscation: post #36 (general), 49 (selective obfuscation) Specific features and fixes: post #3 (security), 84 (redefining the expected runtime response), 169 (Curl Enum fix), 185/187 (using license keys), 194 (replacing Ward's AES UDF with different encryption/decryption calls), 251 (AV detection issue), 262 (extract key contents to USB on different target machine prior to encryption) Limitations: post #26 (@error/@extended), 149 (FileInstall), 191 (AES.au3 on x64) Not recommended: post #46/249 (static encryption), 102 (programme logic error), 237 (parsing password via cmdline) Technical notes: BackTranslation is a test to check that the MetaCode translation worked. Skip it at your peril. It also turns your multi-include composite script into a single portable file without redundant parts (you can opt to leave the redundant parts in, if you want). CodeCrypter can also obfuscate (vars and UDF names) and replace strings, variable names and UDF names with anything else you provide, for example, for language translation). After CodeScanner separates your target's structure from its contents, CodeCrypter (actually MCF, under the hood) can change any part, and then generate a new script from whichever pieces you define. See the MCF Tutorial for more explanation and examples. Encryption currently relies on Ward's excellent AES UDF and TheXman's sophisticated CryptoNG bundle. You can replace these with any other algorithm you like (but this is not trivial to do: edit MCFinclude.au3 UDF _MCFCC(), and MCF.au3 UDF _EncryptEntry(), see post #194 in this thread). AES by Ward, and CryptoNG by TheXman are also included in the bundle (with many thanks to Ward and TheXman for graciously allowing me to republish their outstanding work). Going to lie down now... RT1 point
-
Don't use send...use ControlGetText, and read in the value of the GuiCtrlRead into $x and $y...but BEFORE you call the internet function. Stick with the _IEFormElementSetValue to actually set the input data...send is unreliable. If you are properly getting the inputs from the website, then this will work: While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $idClose ExitLoop Case $RunProgram $x = GUICtrlRead($hInput1) $y = GUICtrlRead($hInput2) internet() EndSwitch WEnd Yours is sending the text from BOTH inputs into whatever element is in focus, on what ever window is active.1 point
-
You're right jdelaney, it's a good point to accentuate it. Most of the time, these parameters work, for this reason I suggested to try it1 point
-
you used ControlSetText to 'send' the {enter} :)...that's why the text was modified to {enter}...to set the checkbox, look at ControlCommand in the help file. You should never have to send enter to do what you want...you should always use ControlClick if it's a button, or ControlCommand to set check or uncheck on a checkbox (which is also a form of a button) Also, just because an installer is created by installshield, doesn't mean the .iss files are present to do the silent install/update/uninstall...The provider would need to actually record the scenarios, and package them in.1 point
-
jguinch, I believe you refer to my unifuzz SQLite extension; start reading here, then have luck finding the actual post where the extension resides later in this same thread. The new search feature is terrible. For the matter of string comparison outside of SQLite, this post may give something to work with.1 point
-
Comparing strings
Wicked_Caty reacted to JohnOne for a topic
The problem is you're trying to use a variable that is not there. You can solve it by ensuring you do not try to access a non existent variable.1 point -
Comparing strings
Wicked_Caty reacted to kylomas for a topic
Wicked_Caty, $a and $b are NOT arrays. Try it using stringmid like this... #include <MsgBoxConstants.au3> $title = "Similarity" ;~ $a = InputBox($title, "Data 1") ;~ $b = InputBox($title, "Data 2") local $a = 'abcd' local $b = 'abce' $n = 0 $la = StringLen($a) $lb = StringLen($b) $lc = ($la + $lb) / 2 If $la > $lb Then $l = $la ElseIf $lb > $la Then $l = $lb Else $l = $lc EndIf For $i = 1 To $l ConsoleWrite($i & @CRLF) If (stringmid($a,$i,1) = stringmid($b,$i,1)) Then $n = $n + 1 EndIf Next $p = $n / $l * 100 MsgBox($MB_TOPMOST, $title, $a & @CRLF & $b & @CRLF & $title & ":" & @TAB & $p) Exitnote: only strings of equal length tested...input supplied as strings, not user input edit: also your loop should start at position "1" for strings1 point -
If you want to replace some binary inside a file then use that function to write another function. Like this maybe: Func FileBinaryReplace($sFile, $bSearch, $bReplace, $iOccurence = 0) Local $hFile = FileOpen($sFile, 17) ; binary mode, read, write FileSetPos($hFile, 0, 0) Local $bBinary = FileRead($hFile) FileSetPos($hFile, 0, 0) FileWrite($hFile, BinaryReplace($bBinary, $bSearch, $bReplace, $iOccurence)) FileClose($hFile) EndFuncAdd some error checking and you are done.1 point
-
Func BinaryReplace($bBinary, $bSearch, $bReplace, $iOccurence = 0) Local $sString = StringReplace(BinaryToString($bBinary), BinaryToString($bSearch), BinaryToString($bReplace), $iOccurence, 1) Return SetError (@error, @extended, Binary($sString)) EndFunc$bBinary="0x200000200100200200200300200400200500200600200700200800200900201000202000203000204000205000206000207000208000209000200A00200B00200C00200D00200E00200F0020A00020B00020C00020D00020E00020F000" $bSearch = "0x00" $bReplace = "" $bBinary2 = BinaryReplace($bBinary, $bSearch, $bReplace) ConsoleWrite($bBinary & @CRLF) ConsoleWrite($bBinary2 & @CRLF)1 point
-
I think you dont need to use so much regexp, loop and checking... Local $sString="0x200000200100200200200300200400200500200600200700200800200900201000202000203000204000205000206000207000208000209000200A00200B00200C00200D00200E00200F0020A00020B00020C00020D00020E00020F000" ConsoleWrite("+ IN: " & $sString & @CRLF) $sString=BinaryToString($sString) $sString=StringReplace($sString,Chr(0x00),"") ConsoleWrite("!OUT: " & StringToBinary($sString) & @CRLF & @CRLF) Saludos1 point
-
ClipPut () doesn't work properly
argumentum reacted to Raizeno for a topic
I ran this on 2 computers one being a bit old and the other is an i7 laptop 4 gb ram same results . As far as Andy goes it is good for small period of times with a bonus for ease of use. But if your trying to automate something in Andy over a long period of time it has severe memory leaks it goes up to the point it crashes my computer. The best emulator i found so far was Genymotion but it has a more difficult setup than the usual emulators. Might have to get back on that . I tried that too but the ammount of text is about 100 char long and since i want this script to run on my low performance computer it take a lot of time to send that even with SendKeyDelay 0 so i realy need the use of clipboard.1 point -
Your setup seems to be made by Installshield. Usually, an Installshield installation can be automated with something like setup.exe /s /v" /qb /norestart" (or use /qn for a silent install)1 point
-
31290, If you want to prevent sorting certain columns, then just check which column was clicked inside the handler - this prevents the first column being sorted: Case $LVN_COLUMNCLICK ; Get column index Local $iCol = DllStructGetData($tStruct, 5) If $iCol <> 0 Then ; Sort column _GUICtrlListView_SimpleSort($cLV, $aSortSense, $iCol) EndIfM23:1 point
-
Don't use control sends...controlSetText is much better. Specifically, for you checkboxes, use ControlCommand to make the checkbox 'check'ed. I'd also suggest you use the ID of your controls...but installers are fairly stagnant, so it shouldn't matter. Make sure the window you are performing action on is 'active', and the control you are doing action on is focused (controlfocus)...that will help you get up the accuracy. Last suggestion is to use the silent command line params so you don't need to automate any of the app. There are other little pitfalls in automating apps. In the long run, you'll need to create functions to loop for ALL the necessary window states to be present, and another loop to wait for your control to be created. It's possible you are attempting to click a control that hasn't been painted yet.1 point
-
31290, Do you mean that you want to prevent sorting in certain columns? To get the separate items from the data, use StringSplit to get the different elements into an array and then select the ones you want: Case $NM_DBLCLK $iRow = DllStructGetData($tStruct, 4) ; Row 0 in ListView is row 2 in the array $sData = $aLines[$iRow + 2] ; Split $aData = StringSplit($sData, "|") MsgBox($MB_SYSTEMMODAL, "Row Data", $aData[1] & @CRLF & $aData[2] & @CRLF & $aData[3] & @CRLF & $aData[4])By the way, do not use a MsgBox inside the handler in your final script - I only did so here for a quick demonstration. I suggest you set a flag or action a dummy control so that you do not block the handler's return. M231 point
-
31290, Colouring individual sub-items on a line is much more complicated - LarsJ shows how you can do it here. Sorting is done alphabetically - so there is no simple way to avoid that return listing. The alternative would be to extract the data into an array, split the alpha and numeric sections, sort the latter numerically, recombine and then reload the ListView - certainly doable, but a bit of a faff. M231 point
-
Have you tried using the AutoIt3Wrapper directives instead of #pragma? #AutoIt3Wrapper_UseX64=Y #AutoIt3Wrapper_UseUpx=Y1 point
-
31290, This should get you started: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <StringConstants.au3> #include <Array.au3> #include <GuiListView.au3> ; Read file and replace tabs $sContent = StringReplace(FileRead("EPES18.txt"), @TAB, " ") ; Expand possible single space before connection status $sExpanded = StringRegExpReplace($sContent, "(\x20(connected|notconnect|err-disabled))", " $1") ; Replace multiple spaces with | delimiter - max 19 to allow for empty fields $sDelimed = StringRegExpReplace($sExpanded, "(\x20{2,19})", "|") ; Split on @CRLF $aLines = StringSplit($sDelimed, @CRLF, $STR_ENTIRESPLIT) ;_ArrayDisplay($aLines, "", Default, 8) $hGUI = GUICreate("Test", 500, 500) ; Create ListView with first 4 headers $cLV = GUICtrlCreateListView(StringRegExpReplace($aLines[1], "(?U)^(.*\|.*\|.*\|.*)\|.*$", "$1"), 10, 10, 480, 380) GUICtrlSetBkColor($cLV, 0x808080) ; Set column widths For $i = 0 To 3 _GUICtrlListView_SetColumnWidth($cLV, $i, 110) Next ; Add content of first 4 fields in each line For $i = 2 To $aLines[0] $cLVItem = GUICtrlCreateListViewItem(StringRegExpReplace($alines[$i], "(?U)^(.*\|.*\|.*\|.*)\|.*$", "$1"), $cLV) ; Colour according to status If StringInStr($alines[$i], "|connected|") Then GUICtrlSetColor($cLVItem, 0x00FF00) ElseIf StringInStr($alines[$i], "|notconnect|") Then GUICtrlSetColor($cLVItem, 0xFF0000) Else GUICtrlSetColor($cLVItem, 0xC4C4C4) EndIf Next GUISetState() ; Set sort state Local $aSortSense[_GUICtrlListView_GetColumnCount($cLV)] GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _WM_NOTIFY($hWnd, $imsg, $wParam, $lParam) ; Struct = $tagNMHDR and "int Item;int SubItem" from $tagNMLISTVIEW Local $tStruct = DllStructCreate("hwnd;uint_ptr;int_ptr;int;int", $lParam) If @error Then Return Local $iCode = BitAND(DllStructGetData($tStruct, 3), 0xFFFFFFFF) Switch $iCode Case $LVN_COLUMNCLICK ; Get column index Local $iCol = DllStructGetData($tStruct, 5) ; Sort column _GUICtrlListView_SimpleSort($cLV, $aSortSense, $iCol) Case $NM_DBLCLK $iRow = DllStructGetData($tStruct, 4) ; Row 0 in ListView is row 2 in the array MsgBox($MB_SYSTEMMODAL, "Row Data", $aLines[$iRow + 2]) EndSwitch EndFunc M23 Edit; I amended the file slightly to add some "err-disabled" lines:1 point
-
how to save files on LAN?
langthang084 reacted to jguinch for a topic
@langthang084 : read the remarks section in the help page : Starting with Excel 2007 you have to provide both the $iFormat parameter and the correct file extension in $sFilePath. E.g. $iFormat = $xlExcel8 and extension = "xlsx" will return an error. Please see the XlFileFormat enumeration in ExcelConstants.au3 for possible values. Try to change the $iFormat parameter ($xlExcel8 seems to be what you need)1 point -
PEscobar, As all you seem to ask about are gamebots, and now you have decided to grossly insult us all when offered pointers to answers that are easily available in the Help file, I think it best that you do indeed "quit the AutoIt forums". And to help you with this admirable desire, I will now ensure that you do. M231 point
-
works for me. perhaps it's because you are using SciTE-Lite, while i'm using the full SciTE package. even if that's not the cause of your issue, it is strongly advised to use the full SciTE package. it has many useful tools and features. same goes for your other topic. EDIT: you have presented your issue in a very clear and useful manner. well done!1 point
-
ClipPut () doesn't work properly
argumentum reacted to JohnOne for a topic
I honestly don't even know what that means, my first encounter with a PC was windows xp about 7 years ago. If I were to guess though, I'd the likes of send and it's windows api (probably sendinput) do not go near the actual keyboard, which is what I suspect it might have done in the dos. When I've searched in the past for how to avoid automation detection, the same answer always pooped up... "if you want to do that, you need to write your own driver". But when dos was out, probably a driver to me, was the man I paid my bus fare to.1 point -
This code should show why using only the class option is not reliable #include <Array.au3> $aWinList = WinList("[CLASS:#32770]") _ArrayDisplay($aWinList)1 point