Orochimaru Posted September 1, 2005 Posted September 1, 2005 Hey everyone, darn im soo tired i've been trying to find out how to make a dialog box by pressing a shortcutkey. After the dialog has poped up i wanted to type somthing and then click ok and then make it Sleep(3000) after that open notepad and make it Send w/e i typed. But ofcourse i havnt got to do that, thats why im here for help. I did that with a INput box here is the code: HotKeySet("{F5}", "Type") HotKeySet("{F8}", "Pause") HotKeySet("{F9}", "Quit") While 1 Sleep(100) Wend Func Type() While 1 $clip1 = InputBox("Message", "Enter/Paste text to Spam", "" ) Run("C:\Program Files\Starcraft\Starcraft.exe") Sleep(700) $i=0 Do Send("{Enter}") Send("" & $clip1) Send("{Enter}") until $i=10 wend EndFunc Func Quit() While 1 Exit 0 Wend Endfunc Func Pause() While1 Wend Endfunc Basically all that does is when i press F5 a inputbox pops up and what ever i type in it. Gets send to w/e window im on after its sleep time. So i wanted to do that with a Dialog box because i wanted to Send Profiles that are more then 1 line at once. This is what i have so far but it seems to make no sense what so ever: dim $clip1 HotKeySet("{F7}", "Type") HotKeySet("{F9}", "Pause") Func Pause() While 1 Wend Endfunc func type() while 1 $clip1 = Dialog Box Sleep(700) $i=0 Do Send("{Enter}") Send("" & $clip1) Send("{Enter}") until $i=10 wend EndFunc GUICreate("Type What You Want To Spam Below") ; will create a dialog box that when displayed is centered GUISetState (@SW_SHOW) ; will display an empty dialog box $GUI_EVENT_CLOSE = "1" $nEdit = GUICtrlCreateEdit ("Type Here", 3,3,300,180) GUICtrlCreateButton ("Ok", 20,200,50) GUISetState () for $n=1 to 5 GUICtrlSetData ($nEdit,@CRLF & "line "& $n) next $EM_LINEINDEX = 0x00BB $EM_LINEFROMCHAR = 0x00C9 Do $msg = GUIGetMsg() if $msg >0 then $n=GUICtrlSendMsg ($nEdit, $EM_LINEINDEX,-1,0) $nline=GUICtrlSendMsg( $nEdit, $EM_LINEFROMCHAR,$n,0) GUICtrlSetState ($nEdit,256) ; set focus MsgBox (0,"Currentline",$nLine) Endif Until $msg = $GUI_EVENT_CLOSE All this does is when i run it a Dialog box pops up right away and then when i press F7 it types random words or numbers... Also i didnt include #include gui.........au3. because it says "Error reading #include gui.........au3." Can anyone please look at these sources and see if they can help me, i really need it thank you for reading.
w0uter Posted September 1, 2005 Posted September 1, 2005 few things that are a bit wrong about your script in general. Do Send("{Enter}") Send("" & $clip1) Send("{Enter}") until $i=10 will loop forever. not 10 times. also your pause function uses up alot of CPU, put a sleep() in between the loop. 3: it should be #include <file.in.the.include.dir.au3> (notice the <>) My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
Valuater Posted September 1, 2005 Posted September 1, 2005 #include <file.in.the.include.dir.au3> <{POST_SNAPBACK}>wow... where can i find that file....lol8)
w0uter Posted September 1, 2005 Posted September 1, 2005 here:file.in.the.include.dir.au3 My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
Valuater Posted September 1, 2005 Posted September 1, 2005 here:<{POST_SNAPBACK}>MsgBox(0, 'Gotcha', 'G0t Ya ! ')that was good wOuter8)
Orochimaru Posted September 1, 2005 Author Posted September 1, 2005 few things that are a bit wrong about your script in general.Do Send("{Enter}") Send("" & $clip1) Send("{Enter}") until $i=10will loop forever. not 10 times.also your pause function uses up alot of CPU, put a sleep() in between the loop.3: it should be #include <file.in.the.include.dir.au3> (notice the <>)<{POST_SNAPBACK}>I wanted it to loop for ever, because i had the pause button so i can stop it at anytime thanks for the, pause information tho. But does anyone know how to make a dialog box pop up like the way i did with the inputbox.Also w0uter i dont know what you mean by: 3: it should be #include <file.in.the.include.dir.au3>(notice the <>)
Valuater Posted September 1, 2005 Posted September 1, 2005 (edited) I wanted it to loop for ever, because i had the pause button so i can stop it at anytime thanks for the, pause information tho. But does anyone know how to make a dialog box pop up like the way i did with the inputbox.Also w0uter i dont know what you mean by: 3: it should be #include <file.in.the.include.dir.au3>(notice the <>)<{POST_SNAPBACK}>1what wOuter meant was this#include <GUIConstants.au3>2please post your code like this[ code ] ; no spacespaste your code here[ /code ] ; no spacesthis way we can read it and try to help your messy script ( not a flame)8) Edited September 1, 2005 by Valuater
w0uter Posted September 1, 2005 Posted September 1, 2005 most people use "While 1" for an infinite loop. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
Orochimaru Posted September 1, 2005 Author Posted September 1, 2005 most people use "While 1" for an infinite loop.<{POST_SNAPBACK}>Ic ic ^.^ Learned somthing for next time but Hey w0uter can you try to help me with the Dialogbox problem please. I need help on that really bad i just want a box to come up where you can type more then 1 line at once.
AutoChris Posted September 1, 2005 Posted September 1, 2005 $nEdit = GUICtrlCreateEdit ("Type Here", 3,3,300,180)$nEdit = GUICtrlCreateEdit ("Type Here", 3, 3, 300, 180, $ES_MULTILINE + $ES_WANTRETURN)Give that a try.
Valuater Posted September 1, 2005 Posted September 1, 2005 (edited) 1st DONT POST TWICE IN TWO DIFFERENT THREADS 2nd I asked you to send the script with [ code ] and end code [ /code] 3rd try this expandcollapse popup#include <GUIConstants.au3> dim $clip1, $paused, $blah HotKeySet("{F7}", "Type") HotKeySet("{F9}", "Pause") GUICreate("Type What You Want To Spam Below"); will create a dialog box that when displayed is centered $nEdit = GUICtrlCreateEdit ("Type Here", 3,3,300,180) $ok = GUICtrlCreateButton ("Ok", 20,200,50) GUISetState (@SW_SHOW) Do $msg = GUIGetMsg() if $msg = $ok then $blah = GUICtrlRead($nEdit) Run("notepad.exe") WinWaitActive("") Send($blah) Endif Sleep(50) Until $msg = $GUI_EVENT_CLOSE Func Pause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") Endfunc func type() ;while 1 ;$clip1 = Dialog Box Sleep(700) ;$i=0 ;Do Send("{Enter}") Send("" & $blah) Send("{Enter}") ;until $i=10 ;wend EndFunc not everything you want... but it's alot more than you had 8) Edited September 1, 2005 by Valuater
Orochimaru Posted September 1, 2005 Author Posted September 1, 2005 1st DONT POST TWICE IN TWO DIFFERENT THREADS2ndI asked you to send the script with [ code ] and end code [ /code]3rdtry thisexpandcollapse popup#include <GUIConstants.au3> dim $clip1, $paused, $blah HotKeySet("{F7}", "Type") HotKeySet("{F9}", "Pause") GUICreate("Type What You Want To Spam Below"); will create a dialog box that when displayed is centered $nEdit = GUICtrlCreateEdit ("Type Here", 3,3,300,180) $ok = GUICtrlCreateButton ("Ok", 20,200,50) GUISetState (@SW_SHOW) Do $msg = GUIGetMsg() if $msg = $ok then $blah = GUICtrlRead($nEdit) Run("notepad.exe") WinWaitActive("") Send($blah) Endif Sleep(50) Until $msg = $GUI_EVENT_CLOSE Func Pause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") Endfunc func type() ;while 1 ;$clip1 = Dialog Box Sleep(700) ;$i=0 ;Do Send("{Enter}") Send("" & $blah) Send("{Enter}") ;until $i=10 ;wend EndFuncnot everything you want... but it's alot more than you had8)<{POST_SNAPBACK}>Hey Valuater Thank You So Much. Also I apologize for posting it twice and the other mistake, sorry.Your Source Is what i wanted Exactly Thank you very Much I was wondering if i can Send Color Text while doing that. Like what i type in the dialog box gets sended in red text or the color i pick is that possible is so -.- sorry but can u tell me how.Thanks
Valuater Posted September 1, 2005 Posted September 1, 2005 as far as i know, you can't send color in this type of text handling to the output ???i could be wrong???.... but i don't thinks it's possible 8)
Orochimaru Posted September 1, 2005 Author Posted September 1, 2005 Hey Valuater Thank You So Much. Also I apologize for posting it twice and the other mistake, sorry.Your Source Is what i wanted Exactly Thank you very Much I was wondering if i can Send Color Text while doing that. Like what i type in the dialog box gets sended in red text or the color i pick is that possible is so -.- sorry but can u tell me how.Thanks<{POST_SNAPBACK}>Ic ic... Hmm the source you wrote for me works fine but i wanted to make the dialogboxa hotkey i tried doing thisFunc Open() While 1 $nEdit = GUICtrlCreateEdit ("",3,3,300,200) $ok = GUICtrlCreateButton ("Ok",0,210,50) GUISetState (@SW_SHOW) Do $msg = GUIGetMsg() if $msg = $ok then $blah = GUICtrlRead($nEdit) Run("C:\Program Files\Starcraft\Starcraft.exe") WinWaitActive("Brood War") Send("{Enter}") Send($blah) Send("{Enter}") Endif Sleep(50) Until $msg = $GUI_EVENT_CLOSE Wend EndfuncThat code above doesnt seem to do anything when i press the hotkey.Also i tried to doHotkeyset("F7", "Open") Func Open() While 1 $nEdit = GUICtrlCreateEdit ("",3,3,300,200) $ok = GUICtrlCreateButton ("Ok",0,210,50) GUISetState (@SW_SHOW) Wend Endfunc $nEdit = GUICtrlCreateEdit ("",3,3,300,200) $ok = GUICtrlCreateButton ("Ok",0,210,50) GUISetState (@SW_SHOW) Do $msg = GUIGetMsg() if $msg = $ok then $blah = GUICtrlRead($nEdit) Run("C:\Program Files\Starcraft\Starcraft.exe") WinWaitActive("Brood War") Send("{Enter}") Send($blah) Send("{Enter}") Endif Sleep(50) Until $msg = $GUI_EVENT_CLOSEThat source worked but the problem with that was when i tried to type in the dialogbox it kept earsing and coming back for some reason. I wrote thisa gain because it was giving me a error when i didn't$nEdit = GUICtrlCreateEdit ("",3,3,300,200)$ok = GUICtrlCreateButton ("Ok",0,210,50)GUISetState (@SW_SHOW)I was just wondering how do i make it a Hotkey, thanks.
Valuater Posted September 1, 2005 Posted September 1, 2005 (edited) here ya go expandcollapse popup#include <GUIConstants.au3> dim $clip1, $paused, $blah HotKeySet("{F7}", "Open") HotKeySet("{F9}", "Pause") $My_GUI = GUICreate("Type What You Want To Spam Below"); will create a dialog box that when displayed is centered $nEdit = GUICtrlCreateEdit ("Type Here", 3,3,300,180) $ok = GUICtrlCreateButton ("Ok", 20,200,50) GUISetState(@SW_HIDE, $My_GUI) While 1 Sleep(50) WEnd Func Pause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") Endfunc Func Open() GUISetState(@SW_SHOW, $My_GUI ) While 2 $msg = GUIGetMsg() if $msg = $ok then $blah = GUICtrlRead($nEdit) Run("C:\Program Files\Starcraft\Starcraft.exe") WinWaitActive("Brood War") Send("{Enter}") Send($blah) Send("{Enter}") Endif If $msg = $GUI_EVENT_CLOSE then Exit Sleep(50) WEnd Endfunc glad you tried! 8) Edited September 1, 2005 by Valuater
Orochimaru Posted September 2, 2005 Author Posted September 2, 2005 (edited) Ic ic... Hmm the source you wrote for me works fine but i wanted to make the dialogboxa hotkey i tried doing thisFunc Open() While 1 $nEdit = GUICtrlCreateEdit ("",3,3,300,200) $ok = GUICtrlCreateButton ("Ok",0,210,50) GUISetState (@SW_SHOW) Do $msg = GUIGetMsg() if $msg = $ok then $blah = GUICtrlRead($nEdit) Run("C:\Program Files\Starcraft\Starcraft.exe") WinWaitActive("Brood War") Send("{Enter}") Send($blah) Send("{Enter}") Endif Sleep(50) Until $msg = $GUI_EVENT_CLOSE Wend EndfuncThat code above doesnt seem to do anything when i press the hotkey.Also i tried to doHotkeyset("F7", "Open") Func Open() While 1 $nEdit = GUICtrlCreateEdit ("",3,3,300,200) $ok = GUICtrlCreateButton ("Ok",0,210,50) GUISetState (@SW_SHOW) Wend Endfunc $nEdit = GUICtrlCreateEdit ("",3,3,300,200) $ok = GUICtrlCreateButton ("Ok",0,210,50) GUISetState (@SW_SHOW) Do $msg = GUIGetMsg() if $msg = $ok then $blah = GUICtrlRead($nEdit) Run("C:\Program Files\Starcraft\Starcraft.exe") WinWaitActive("Brood War") Send("{Enter}") Send($blah) Send("{Enter}") Endif Sleep(50) Until $msg = $GUI_EVENT_CLOSEThat source worked but the problem with that was when i tried to type in the dialogbox it kept earsing and coming back for some reason. I wrote thisa gain because it was giving me a error when i didn't$nEdit = GUICtrlCreateEdit ("",3,3,300,200)$ok = GUICtrlCreateButton ("Ok",0,210,50)GUISetState (@SW_SHOW)I was just wondering how do i make it a Hotkey, thanks.<{POST_SNAPBACK}> Edited September 2, 2005 by Orochimaru
Orochimaru Posted September 2, 2005 Author Posted September 2, 2005 here ya goexpandcollapse popup#include <GUIConstants.au3> dim $clip1, $paused, $blah HotKeySet("{F7}", "Open") HotKeySet("{F9}", "Pause") $My_GUI = GUICreate("Type What You Want To Spam Below"); will create a dialog box that when displayed is centered $nEdit = GUICtrlCreateEdit ("Type Here", 3,3,300,180) $ok = GUICtrlCreateButton ("Ok", 20,200,50) GUISetState(@SW_HIDE, $My_GUI) While 1 Sleep(50) WEnd Func Pause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") Endfunc Func Open() GUISetState(@SW_SHOW, $My_GUI ) While 2 $msg = GUIGetMsg() if $msg = $ok then $blah = GUICtrlRead($nEdit) Run("C:\Program Files\Starcraft\Starcraft.exe") WinWaitActive("Brood War") Send("{Enter}") Send($blah) Send("{Enter}") Endif If $msg = $GUI_EVENT_CLOSE then Exit Sleep(50) WEnd Endfuncglad you tried!8)<{POST_SNAPBACK}>That source above doesnt work because first off when ever i put #include <GUIConstants.au3>at the top it always says Error reading GUIConstants.au3Second thing is that i used that source u just gave me and it says If $msg = $ok thenif $msg = ^ ErrorError: Variable used with out being declared
AutoChris Posted September 2, 2005 Posted September 2, 2005 Not to break up the romance, Valuator, but perhaps Orochimaru doesn't have GUIConstants.au3 in his Include directory. @Orochimaru: Check your AutoIt3\Include directory to see if you have GUIConstants.au3 in there. If not, get it. I will even attach it here for you.
Orochimaru Posted September 2, 2005 Author Posted September 2, 2005 That source above doesnt work because first off when ever i put #include <GUIConstants.au3>at the top it always says Error reading GUIConstants.au3Second thing is that i used that source u just gave me and it says If $msg = $ok thenif $msg = ^ ErrorError: Variable used with out being declared<{POST_SNAPBACK}>Thanks a lot you two It works fine now i found out what the problem was with #include <GUIConstants.au3>I had to put the full link of where the file was located #include <C:\Documents and Settings\nezar1\Desktop\autoit-v3.1.1\Include\GUIConstants.au3>Well this works fine thanks a lot i one one more thing to ask =.= how do i make it when i click "Ok" button that the dialogbox it closes till the next time its hotkey is pressed but when it closes it sends the key also. For example like a inputbox you can click ok it'll close and send what u told it to send. If thats not possible how do i add a cancle button to close it cuz if i click it with the X button on top it closes whole program. Btw Thanks A lot!! You 2.
AutoChris Posted September 2, 2005 Posted September 2, 2005 Thanks a lot you two It works fine now i found out what the problem was with #include <GUIConstants.au3>I had to put the full link of where the file was located #include <C:\Documents and Settings\nezar1\Desktop\autoit-v3.1.1\Include\GUIConstants.au3>Well this works fine thanks a lot i one one more thing to ask =.= how do i make it when i click "Ok" button that the dialogbox it closes till the next time its hotkey is pressed but when it closes it sends the key also. For example like a inputbox you can click ok it'll close and send what u told it to send. If thats not possible how do i add a cancle button to close it cuz if i click it with the X button on top it closes whole program. Btw Thanks A lot!! You 2.<{POST_SNAPBACK}>Take a look at GUISetState ().Ex: GUISetState (@SW_Hide) <-- put that in your "if $msg = $ok then" statement.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now