
buzz44
Active Members-
Posts
1,349 -
Joined
-
Last visited
Everything posted by buzz44
-
STILL having problems with stdoutread
buzz44 replied to t0ddie's topic in AutoIt General Help and Support
Interesting... After more experimentation I found out you could just simulate the keypress by closing the window . The below code will display exactly as it would if you opened up cmd and done it manually. Enjoy! #include <Constants.au3> $InstallDir = "C:\Program Files\Diablo II\" $Foo = Run(@ComSpec & " /c title Get Diablo II Cdkey&&showcdkey.exe", $InstallDir, @SW_HIDE, $STDOUT_CHILD) WinWait("Get Diablo II Cdkey") WinClose("Get Diablo II Cdkey") MsgBox(0, "Diablo II Cdkey's", StdoutRead($Foo)) -
STILL having problems with stdoutread
buzz44 replied to t0ddie's topic in AutoIt General Help and Support
Np, I like challenging myself . I'll see if I can make an 'improved' version like what DaveF said using StdinWrite(), not much experience with StdXX() functions but I'll give it ago unless someone beats me to it -
The label's in the beta have a transparent background, the stable release of AutoIt doesn't. So it appear's to me that when you compile using CTRL + F5 it is compiling using the stable version, not the beta. Sorry don't know how to change the compiler dir, should ask JdeB or someone who is involved with SciTe, but atleast you know the problem .
-
? GUIGetCursorInfo() is the appropriate function to use in this case. As stated above, in your first post, you are looking to see if your cursor is over the 'go' button. The fourth element contain's the controlID that the cursor is currently over and will work. As for... 1. You are wrong so please don't say my script is.2. Did you even bother to look in the help file under GUIGetCursorInfo()? I think not, and if you did you must of forgotten your eyes. From the help file: Note: "returns a two-element" should be "returns a four-element", it is a small help file type which I will submit after this post. What was that you were saying? Thats right... But wait! Whats this in the help file? OMG! The function I am talking about, the one you say doesn't return the mouse postion DOES return the mouse position... interesting. 3. You have no idea what you are taking about, the information returned from GUIGetCursorInfo() has absolutly nothing to do with setting different cursor's. I think you are getting mixed up with the MouseGetCursor() function, adding the the lack of knowledge you are showing. And finally 4. You should be, at the very least, grateful for my assistance, not only did I assist but I also provided you with a better solution that you currently have. FYI I did read all the post's, perhap's you should study the english langauge and learn how to contruct a sentence with meaning. You did not say directly you had solved the problem, you miss led me and Valuater into thinking that there was still infact a problem at hand to be solved. Summing up, you are an idiot. Don't critisize me or other's for helping you, the least we could do is nothing, which is what I will be doing next time. And how about you actually do some reading before posting? This would save me the time of writing the above post and stop yourself from responding like an idiot. Goodbye.
-
STILL having problems with stdoutread
buzz44 replied to t0ddie's topic in AutoIt General Help and Support
Thanks for clearing that up, I didn't want to reinstall D2 just to see if the keys were in the registry :">. I just took maybe 30-45 minute break after writing the above sentence to come up with this , fully working. #include <file.au3> Dim $TempFile $InstallDir = "C:\Program Files\Diablo II\" $File = Run(@ComSpec & " /c title Get Diablo II Cdkey&&showcdkey.exe > " & _ @TempDir & "\temp.txt", $InstallDir) WinWaitActive("Get Diablo II Cdkey") Send("{SPACE}") While Not FileExists(@TempDir & "\temp.txt") Wend _FileReadToArray(@TempDir & "\temp.txt", $TempFile) FileDelete (@TempDir & "\temp.txt") $Owner = StringTrimLeft($TempFile[8], 13) $Lod = StringTrimLeft($TempFile[9], 17) $Classic = StringTrimLeft($TempFile[10], 13) MsgBox(0,"Diablo II Cdkey's", "Owner: " & $Owner & _ "LOD Cdkey: " & $Lod & _ "Classic Cdkey: " & $Classic) My Story: After a long experimentation period I found out I could not redirect the output to a file so easily. I began to wonder what was wrong, then I realised that the file wasn't being created until the command had finished. As you would know after running showcdkey.exe the command window display's "Press any key to continoue", after pressing a key the file is then created. I then began more experimentation with the "Press and key to continoue" subject, I came to the conclusion that for this to be passed you must press any key in the active cmd, meaning that you can't hide the window, nor can you trick it using the multiple command command string of "&&" which I tried, you have to do it manually, ie. Send("{SPACE"}), I chose spacebar because its the most logical option, it doesn't do anything to the cmd except, in this instance, close it . But how would I know when to press space bar? The time it takes the command to complete on different pc's may vary so I couldn't use a timer. I then done some poking in cmd /w "help" and found out I could change the title of the cmd window to whatever I wanted, ie. "Get Diablo II Cdkey". Using this new found info in combination with the conjuction string "&&" for cmd I was able to use WinWaitActive() to wait for the approiate time to send space bar. The first problem was solved, redirecting the output to a file. I now began the quest of the second problem, retrieving the information from the file and displaying it. I knew to use _FileReadToArray() but how would I know when the file had been written to? I solved that with a quick While...Wend loop with nothing in it to get the fastest possible execution time. I then assigned $Owner, $LOD and $Classic with the retrieved information. To display the result's correctly I trimmed all the character from the left side of the string's only leaving the cdkey's/owner, some with a tad whitespace. I then whipped up a message box to display the result's and bobs your uncle. Enjoy ! Edit: Looking at the time I replied, and the time you posted, it looks like it was 30-45 minuted but less lol, it seemed like forever but . -
Func WinGetClassName($Hwnd) Local $Ret = DllCall("user32.dll", "int", "GetClassName", "hwnd", $Hwnd, "str", "", "int", 64) If Not @Error Then Return $Ret[2] EndFunc
-
Your using the wrong function , try this (using GUIGetCursorInfo()). $MainGUI = GUICreate("Doom Browser", 800, 600,(@DesktopWidth-800)/2, (@DesktopHeight-600)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_MAXIMIZE) $GoPic = GUICtrlCreatePic("Images\Go.bmp", (@DesktopWidth-500)/2+505, 14, 43, 20) $Go = GUICtrlCreateButton("Go", (@DesktopWidth-500)/2+505, 14, 43, 20, $BS_BITMAP) GUICtrlSetImage($Go, "Images\Go.bmp") GUICtrlSetState($Go, $GUI_HIDE) While 1 $Over = GUIGetCursorInfo $Msg = GUIGetMsg() Select Case $Over[4] = $Go If GUICtrlGetState($Go) = 96 Then GUICtrlSetState($GoPic, $GUI_HIDE) GUICtrlSetState($Go, $GUI_SHOW) ElseIf GUICtrlGetState($Go) = 80 Then GUICtrlSetState($Go, $GUI_HIDE) GUICtrlSetState($GoPic, $GUI_SHOW) EndIf Case $msg = $Go LoadPage() ;... ;... ;... That's probably not 100% correct because I didn't bother testing your first code so I'm wasn't quite sure what all the @DesktopWidth / * - stuff was and the difference between the cases of < > and "And" from "Or". Look in the help file for GUIGetCursorInfo() for more information.
-
making script a GUI with instructions
buzz44 replied to bosko's topic in AutoIt GUI Help and Support
So young... look at the example in the help file for GUICtrlCreateObj(). -
To check if the user has an active inet connection
buzz44 replied to sshrum's topic in AutoIt General Help and Support
Don't ask me lol. Its from AutoIt Wiki http://www.autoitscript.com/wiki/index.php?title=Connected -
Thanks w0uter but still not working, I don't get any error's but nothing appear's to change. $Pid now work's and I use 0xFFF instead of 0x20 + 0x8 for the OpenProcess call, 0xFFF meaning PROCESS_ALL_ACCESS. I also finished/added the last WriteProcessMemory call's. Does it look correct? Thanks again. CODEDim $pid; Dim $bytes; Dim $_handle; Dim $off1 = 0x6FC11024; Dim $ofw1[9] = [0x66, 0x83, 0xF9, 0x2D, 0x90, 0x74, 0x2F, 0xEB, 0xDB]; Dim $off2 = 0x6FC11008; Dim $ofw2[8] = [0x66, 0x89, 0x0E, 0xE9, 0x9E, 0x04, 0, 0]; Dim $off3 = 0x6FC1105A; Dim $ofw3[8] = [0xE9, 0xC5, 0x09, 0, 0]; Dim $off4 = 0x6FC11A24; Dim $ofw4[12] = [0x66, 0xB9, 0xFF, 0, 0x66, 0x89, 0x0E, 0xE9, 0x7E, 0xFA, 0xFF, 0xFF]; Dim $off5 = 0x6FC114AB; Dim $ofw5[3] = [0xEB, 0x2B, 0x90]; Dim $off6 = 0x6FC114D8; Dim $ofw6[5] = [0xE9, 0x47, 0xFB, 0xFF, 0xFF]; Dim $v_Struct1 = DllStructCreate ('str') DllStructSetData($v_Struct1, 1, "class") Dim $window = DllCall('user32.dll', 'hwnd', 'FindWindow', 'ptr', DllStructGetPtr ($v_Struct1, 1), 'str', '') $window = $window[0] DllStructDelete ($v_Struct1) Dim $v_Struct2 = DllStructCreate ('dword') DllCall('user32.dll', 'int', 'GetWindowThreadProcessId', 'hwnd', $window, 'ptr', DllStructGetPtr ($v_Struct2, 1)) $pid = DllStructGetData ($v_Struct2, 1) DllStructDelete ($v_Struct2) $_handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0xFFF, 'int', 0, 'int', $pid) $_handle = $_handle[0] $v_callStruct1 = DllStructCreate('byte[9]') $v_callStruct2 = DllStructCreate('byte[8]') $v_callStruct3 = DllStructCreate('byte[8]') $v_callStruct4 = DllStructCreate('byte[12]') $v_callStruct5 = DllStructCreate('byte[3]') $v_callStruct6 = DllStructCreate('byte[5]') For $i = 0 to 8 DllStructSetData($v_callStruct1, 1, $ofw1[$i], $i) Next For $i = 0 to 7 DllStructSetData($v_callStruct2, 1, $ofw2[$i], $i) DllStructSetData($v_callStruct3, 1, $ofw3[$i], $i) Next For $i = 0 to 11 DllStructSetData($v_callStruct4, 1, $ofw4[$i], $i) Next For $i = 0 to 2 DllStructSetData($v_callStruct5, 1, $ofw5[$i], $i) Next For $i = 0 to 4 DllStructSetData($v_callStruct6, 1, $ofw6[$i], $i) Next DllCall('kernel32.dll', 'int', 'WriteProcessMemory', 'int', $_handle, 'int', $off1, 'ptr', DllStructGetPtr($v_callStruct1, 1), 'int', 9, 'int', ''); DllCall('kernel32.dll', 'int', 'WriteProcessMemory', 'int', $_handle, 'int', $off2, 'ptr', DllStructGetPtr($v_callStruct2, 1), 'int', 8, 'int', ''); DllCall('kernel32.dll', 'int', 'WriteProcessMemory', 'int', $_handle, 'int', $off3, 'ptr', DllStructGetPtr($v_callStruct3, 1), 'int', 8, 'int', ''); DllCall('kernel32.dll', 'int', 'WriteProcessMemory', 'int', $_handle, 'int', $off4, 'ptr', DllStructGetPtr($v_callStruct4, 1), 'int', 12, 'int', ''); DllCall('kernel32.dll', 'int', 'WriteProcessMemory', 'int', $_handle, 'int', $off5, 'ptr', DllStructGetPtr($v_callStruct5, 1), 'int', 3, 'int', ''); DllCall('kernel32.dll', 'int', 'WriteProcessMemory', 'int', $_handle, 'int', $off6, 'ptr', DllStructGetPtr($v_callStruct6, 1), 'int', 5, 'int', '');
-
This will be my last post, because this is getting boring. I interpretted dcovell's post as wanting to know the release date of the next major release of AutoIt or the 'final release', as he worded it, of the current beta. It appear's to me that no one else seem's to have a problem with how I worded it, including dcovell.
-
I know! Let us wander back through the year's to kindergarden, 1, 2, 3, 4! 4 comes after 3. We are currently in AutoIt v3, what do you think is next?
-
I wouldn't of noticed that I had made a "mistake" unless you had pointed it out... Would you like me to change it to "The release of AutoIt v4..." instead of "Final release for AutoIt v4..."?
-
You know what I meant .
-
To check if the user has an active inet connection
buzz44 replied to sshrum's topic in AutoIt General Help and Support
;-------------------------------------------------------------------------------------------- ;check $ret[0] for trueness, and $ret[1] for type of connection according to variables provided... ;-------------------------------------------------------------------------------------------- $INTERNET_CONNECTION_MODEM = 0x1 $INTERNET_CONNECTION_LAN = 0x2 $INTERNET_CONNECTION_PROXY = 0x4 $INTERNET_CONNECTION_MODEM_BUSY = 0x8 $INTERNET_RAS_INSTALLED = 0x10 $INTERNET_CONNECTION_OFFLINE = 0x20 $INTERNET_CONNECTION_CONFIGURED = 0x40 $ret = DllCall("WinInet.dll","int","InternetGetConnectedState","int_ptr",0,"int",0) If $ret[0] then ;check type of connection $sX = "" If BitAND($ret[1], $INTERNET_CONNECTION_MODEM) Then $sX = $sX & "MODEM" & @LF If BitAND($ret[1], $INTERNET_CONNECTION_LAN) Then $sX = $sX & "LAN" & @LF If BitAND($ret[1], $INTERNET_CONNECTION_PROXY) Then $sX = $sX & "PROXY" & @LF If BitAND($ret[1], $INTERNET_CONNECTION_MODEM_BUSY) Then $sX = $sX & "MODEM_BUSY" & @LF If BitAND($ret[1], $INTERNET_RAS_INSTALLED) Then $sX = $sX & "RAS_INSTALLED" & @LF If BitAND($ret[1], $INTERNET_CONNECTION_OFFLINE) Then $sX = $sX & "OFFLINE" & @LF If BitAND($ret[1], $INTERNET_CONNECTION_CONFIGURED) Then $sX = $sX & "CONFIGURED" & @LF Else $sX = "Not Connected" Endif MsgBox(4096,$ret[0] & ":" & $ret[1],$sX) -
The release of AutoIt v4 will not be any time soon, so you can cross out days and week's. Saying AutoIt v4 make's me get all giddy inside lol. Month's is more in the correct time period, how many I don't know.
-
Ok last thing, with... $DEVMODE = DLLStructCreate("byte[32];int[10];byte[32];int[6]") Does the int[6] = dmFields? If so is it because [6] is the 6th 'thing' of the structure and its 'int' because its a 'dword'? Also why is it byte[32]? Thanks again.
-
Larry, I don't understand how you created your structure, and it worked lol. ie. $DEVMODE = DLLStructCreate("byte[32];int[10];byte[32];int[6]") Where my now 'modifed' structure looks like... $DevMode = DllStructCreate("char[32] _ ;int _ ;int _ ;int _ ;int _ ;dword _ ;short _ ;short _ ;short _ ;short _ ;short _ ;short _ ;short _ ;short _ ;short _ ;short _ ;short _ ;short _ ;short _ ;byte[32] _ ;int _ ;dword _ ;dword _ ;dword _ ;dword _ ;dword _ ;dword") I am currently pondering how you figured out your's and got it to work whilst looking at the structure tree at msdn, as w0uter said it has sub-structure's etc. Would you care to enlighten me please?
-
@Larry I did ask people not to post it if they have it lol, but anyway I will look over your code and attempt to learn , thanks. @w0uter Thanks for info, I am now changing the structure.
-
Im trying to create the below DEVMODE structure, and seeing as this is kind of my first DllStruct script I'm not sure about this stuff. I think I have done most of it correctly but I don't have any idea what to put for"String * 32" and "LONG" for DllStruct as it doesn't support those types, actaully it most probably does but I don't know the correct word type for it. If someone could please take a look at the msdn link below and check that I'm creating this structure correctly I would much appreciate it. FYI: I'm trying to change access the ChangeDisplaySettings function, if someone has already done this please don't post it , I would like to figure most of it out for myself. Thanks. http://msdn.microsoft.com/library/default....ntspol_8nle.asp $DevMode = DllStructCreate("STRING * 32 _ ;int _ ;int _ ;int _ ;int _ ;LONG _ ;int _ ;int _ ;int _ ;int _ ;int _ ;int _ ;int _ ;int _ ;int _ ;int _ ;int _ ;int _ ;int _ ;STRING * 32 _ ;int _ ;int _ ;LONG _ ;LONG _ ;LONG _ ;LONG")
-
STILL having problems with stdoutread
buzz44 replied to t0ddie's topic in AutoIt General Help and Support
Can't you retrieve the cd key via the registry? Maybe it's only if your using Onlyer's cd key refiller with different .mpq names in the shortcut, if you know what I'm talking about. Edit: HKEY_CURRENT_USER\Software\Blizzard Entertainment\Diablo II You can find your cdkey's. Or you can redirect the output of showcdkey.exe to a txt file. -
How do I delete redundant elements?
buzz44 replied to HyperChao's topic in AutoIt General Help and Support
Possibly each time you read a line add it into an array, but also check the array to see if the word has already been entered read. -
First TIme User- Pretty Cool, but...
buzz44 replied to cappy2112's topic in AutoIt General Help and Support
You could also copy the text to the clip board then paste it. ControlFocus( "My App", "", 1) ClipPut("Todays date/Time: " & _Now()) Send("^v"); Ctrl + V (Paste) -
This is the last time I am replying because you are annoying me. Try the second alternative I posted, you should be more then grateful that me and w0uter actually bothered to assist you.
-
You answered your question. If a message box appear's telling you the co-ordinates then you know where you have to click, what do we use in AutoIt to click? MouseClick()... Simply mouse click at the co-ordinates you specified for the message box.