Misha Posted October 23, 2006 Share Posted October 23, 2006 (edited) This is silly but I got some errors and how can I make the gui not close when the sub gui closes? expandcollapse popup#NoTrayIcon #include <GuiConstants.au3> Dim $msg = GUIGetMsg(),$SB = 3 , $OB = 2 HotKeySet("{NUMPAD7}","RCON") HotKeySet("{Numpad8}","APON") HotKeySet("{Numpad9}","LCON") HotKeySet("{NUMPAD6}","ASON") HotKeySet("{NUmpad5}","ADON") HotKeySet("{NUMPAD0}","Halt") $Parent=GUICreate("StupiDBoTFoRANOlDFrienD",220,250) GUICtrlCreateLabel("Hello to my StupiDBoTFoRANOlDFrienD Software" & @CRLF & "This bot is created for you my Silly old friend :x by my friend whats his name..I forgot........" & @CRLF & "lol sorry,moveing on he made the gui simply simliar to some other bot" & @CRLF & "Press the help button to find out stuff",5,10,200,110) $SillyMenu=GuiCtrlCreateMenu("File") GUICtrlCreateMenuitem("Save",$SillyMenu) GUICtrlCreateMenuitem("Exit",$SillyMenu) $SillyMenu2=GuiCtrlCreateMenu("Help") GUICtrlCreateMenuitem("About",$SillyMenu2) GuiCtrlCreatemenuitem("Help",$sillymenu2) GuiCtrlCreateGroup("Stuff",10,120,200,100) GUICtrlCreateLabel("Status",22,170) GuiCtrlCreateLabel("Delay",22,190) GuiCtrlCreateLabel("RC",70,150) GUICtrlCreateLabel("AP",95,150) GUICtrlCreateLabel("LC",115,150) GUICtrlCreateLabel("AD",140,150) GuiCtrlCreateLabel("AS",175,150) $RCS = GuiCtrlCreateLabel("Off",70,170) $RCD = GuiCtrlCreateLabel("500",70,190) $APS = GuiCtrlCreateLabel("Off",95,170) $APD = GuiCtrlCreateLabel("500",95,190) $LCS = GuiCtrlCreateLabel("Off",115,170) $LCD = GuiCtrlCreateLabel("500",115,190) $ADS = GuiCtrlCreateLabel("Off",140,170) $ADD = GUICtrlCreateLabel("60000",140,190) $ASS = GuiCtrlCreateLAbel("Off",175,170) $ASD = GUICtrlCreateLabel("6000",175,190) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func RCON() if GuiCtrlRead($RCS) = "Off" Then GUICtrlSetData($RCS,"On") $TimerThingyAP= TimerInit ( ) $TimerThingyAS=TimerInit() $TimerThingyAD=TimerInit() While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() MouseClick("Right") If GuiCtrlRead($APS) = "On" and TimerDiff($TimerThingyAP) >= GuiCtrlRead($APD) Then Send("{SPACE}") $TimerThingyAP = TimerInit() EndIf if TimerDiff($TimerThingyAS) >= GuiCtrlRead($ASD) and GuiCtrlRead($ASS) = "On" Then Send($SB) Sleep(500) MouseClick("Right") Sleep(500) Send($OB) $TimerThingyAS = TimerInit() EndIf if GuiCtrlRead($ADS) = "On" And TimerDiff($TimerThingyAD) >= GuiCtrlRead($ADD) Then $x = 956 $y = 365 Send("v",1) for $i = 1 to 8 for $f = 1 to 2 mousemove( $x , $y) $x = $x + 45 Sleep(250) MouseClick("Left") Sleep(250) MouseMove(198,757) Sleep(250) Next $x = 365 $y = $y + 28.375 Next send("v",1) $TimerThingyAD= TimerInit() EndIf Sleep(GuiCtrlRead($RCD)) WEnd Else GUICtrlSetData($RCS,"Off") EndIf EndFunc Func APON() if GuiCtrlRead($RCS) = "On" Or GuiCtrlRead($LCS) = "On" Then GUICtrlSetData($APS,"On") ElseIf GuiCtrlRead($APS) = "On" Then GUICtrlSetData($APS,"Off") Else While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Send("{SPACE}") Sleep(GuiCtrlRead($APD)) Wend EndIf EndFunc func LCON() if GuiCtrlRead($LCS) = "On" Then GUICtrlSetData($LCS, "Off") Else $TimerThingyAP = TimerInit() GUICtrlSetData($LCS,"On") While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() MouseClick("left") If GuiCtrlRead($APS) = "On" and TimerDiff($TimerThingyAP) >= GuiCtrlread($APD) Then Send("{SPACE}") $TimerThingyAP = TimerInit() EndIf Sleep(GuiCtrlRead($LCD)) WEnd EndIf EndFunc Func ASON() if GuiCtrlRead($LCS) = "On" Then GUICtrlSetData($LCS, "Off") Else GUICtrlSetData($LCS,"On") GuiCreate("Buttons for AS",60,50,-1,-1,-1,-1,$Parent) $Vne=GUICtrlCreateInput("First",10,5,35) $Zone=GUICtrlCreateInput("Second",10,20,35) $SB = GuiCtrlread($Vne) $OB = GuiCtrlRead($Zone) GUISetState() EndIf EndFunc Func ADON() if GuiCtrlread($LCS) = "On" Then GUICtrlSetData($ADS, "Off") Else GUICtrlSetData($ADS,"On") EndIf EndFunc Func Halt() While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Sleep(100) WEnd EndFunc Edited October 24, 2006 by Misha Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 23, 2006 Moderators Share Posted October 23, 2006 Give your Sub-GUI a $Variable ($SubGUI = GUICreate()) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Return GUIDelete($SubGUI) EndSwitch WEnd Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Rad Posted October 24, 2006 Share Posted October 24, 2006 (edited) 1) Use the [autoit ] tags instead of [code ] tags so its easier to read ... makes my eyes hurt ^^ 2) You could delete the active window rather than the variable, or the way I did it was if the primary window is closed, the script is closed, if the secondary window is closed its simply hidden. It can be shown again when you press the button that opens it too To get the active window you need these: Opt("WinTitleMatchMode", 4) WinGetTitle("active") ; I think handle works too Edited October 24, 2006 by Rad Link to comment Share on other sites More sharing options...
Misha Posted October 25, 2006 Author Share Posted October 25, 2006 Well now I have a problem with this.. $x = 960 $y = 365 Send("v",1) for $i = 1 to 8 for $f = 1 to 2 mousemove( $x , $y) $x = $x + 30 Sleep(50) MouseDown("Left") Sleep(50) MouseUp("Left") Sleep(50) MouseMove(200,750) Sleep(25) MouseDown("Left") Sleep(50) MouseUp("Left") Sleep(50) Next $x = 956 $y = $y + 35 Next send("v",1) is there anyway I could do a rightclick nonestop while useing movemouse.. Link to comment Share on other sites More sharing options...
Rad Posted October 25, 2006 Share Posted October 25, 2006 Could you explain? You want the mouse to move and press right click as fast as it can? This wont be good... Depending on what you need it for Link to comment Share on other sites More sharing options...
Misha Posted October 26, 2006 Author Share Posted October 26, 2006 never mind I fixed that... now I have a problem with hotkeys for delay expandcollapse popup;Declatation. #NoTrayIcon #include <GuiConstants.au3> Dim $SB = 3 , $OB = 2 ,$TS = 4 ;options Opt("WinTitleMatchMode", 4) Opt("GUIOnEventMode", 1) ;Gui makeing HotKeySet("{NUMPAD7}","RCON") HotKeySet("{Numpad8}","APON") HotKeySet("{Numpad9}","LCON") HotKeySet("{NUMPAD6}","ASON") HotKeySet("{NUmpad5}","ADON") HotKeySet("{NUMPAD0}","Halt") HotKeySet("^{Numpad7}","UpRC") HotKeySet("+{Numpad1}","DownRC") HotKeySet("^{Numpad8}","UpAP") HotKeySet("+{Numpad8}","DownAP") HotKeySet("^{Numpad9}","UpLC") HotKeySet("+{Numpad9}","DownLC") HotKeySet("{Numpad4}","UpAS") HotKeySet("{Numpad1}","DownAS") HotKeySet("^{Numpad5}","UPAD") HotKeySet("{Numpad2}","DownAD") $Parent=GUICreate("Silly Drop Bot Beta 0.3v",300,300) GUICtrlCreateLabel("Hello, welcome to my Trial Bot Software" & @CRLF & "Right Click = 7" & @CRLF & "Auto Pick = 8" & @CRLF & "Left Click = 9" & @CRLF & "Auto Skill = 6" & @CRLF & "Auto Drop = 5" & @CRLF & "Stop = 0" ,5,10,200,110) $SillyMenu=GuiCtrlCreateMenu("File") $save=GUICtrlCreateMenuitem("Save",$SillyMenu) GuiCtrlsetonevent($save,"Savetoini") $SM=GUICtrlCreateMenuitem("Exit",$SillyMenu) GuiCtrlSetOnEvent($SM,"LOL") $SillyMenu2=GuiCtrlCreateMenu("Help") $ABT=GUICtrlCreateMenuitem("About",$SillyMenu2) GuiCtrlSetOnEvent($ABT,"ABTF") $HLP=GuiCtrlCreatemenuitem("Help",$sillymenu2) GuiCtrlSetOnEvent($HLP,"HLPF") GuiCtrlCreateGroup("Stuff",5,120,290,100) GUICtrlCreateLabel("Status",22,170) GuiCtrlCreateLabel("Delay",22,190) GuiCtrlCreateLabel("RC",70,150) GUICtrlCreateLabel("AP",115,150) GUICtrlCreateLabel("LC",160,150) GUICtrlCreateLabel("AD",205,150) GuiCtrlCreateLabel("AS",250,150) $RCS = GuiCtrlCreateLabel("Off",70,170) $RCD = GuiCtrlCreateLabel("25",70,190,45) $APS = GuiCtrlCreateLabel("Off",115,170) $APD = GuiCtrlCreateLabel("500",115,190,45) $LCS = GuiCtrlCreateLabel("Off",160,170) $LCD = GuiCtrlCreateLabel("500",160,190,45) $ADS = GuiCtrlCreateLabel("Off",200,170) $ADD = GUICtrlCreateLabel("60000",200,190,45) $ASS = GuiCtrlCreateLAbel("Off",250,170) $ASD = GUICtrlCreateLabel("60000",250,190,40) $Vne=GUICtrlCreateInput("2",8,230,45) $Updwn2=GUICtrlCreateUpdown($Vne) GUICtrlSetLimit($Updwn2,9,1) $Zone=GUICtrlCreateInput("3",8,250,45) $Updwn1=GUICtrlCreateUpdown($Zone) GUICtrlSetLimit($Updwn1,9,1) $Dostupa=GUICtrlCreateInput("4",200,230,45) $Updwn3=GuiCtrlCreateUpdown($Dostupa) GUiCtrlSetlimit($Updwn3,9,1) $LolCB=GUICtrlCreateCheckbox("Third Skill",200,255) $BSB=GuiCtrlCreateButton("Set",70,230,23,40) GUICtrlCreateLabel("Top = Main Skill" & @CRLF & "Bottom = Hp Buff",95,230,70,40) GuiCtrlSetOnEvent($BSB,"BSBF") GUISetState() GUISetOnEvent($GUI_EVENT_CLOSE, "LOL") If FileExists(@ScriptDir & "\" & "ConfigYoMama.ini") Then $OB = IniRead("ConfigYomama.ini","Buttons","OB","2") GuiCtrlSetData($Vne,$OB) $SB = Iniread("ConfigYoMama.ini","Buttons","SB","3") GuiCtrlSetData($Zone,$SB) $TS = IniRead("ConfigYoMama.ini","Buttons","TS","4") GUICtrlSetData($Dostupa,$TS) GuiCtrlSetData($RCD,IniRead("ConfigYoMama.ini","Delay","RCD","25")) GuiCtrlSetData($APD,IniRead("ConfigYoMama.ini","Delay","APD","500")) GuiCtrlSetData($LCD,IniRead("ConfigYoMama.ini","Delay","LCD","500")) GuiCtrlSetData($ASD,IniRead("ConfigYoMama.ini","Delay","ASD","60000")) GuiCtrlSetData($ADD,IniRead("ConfigYoMama.ini","Delay","ADD","60000")) EndIf Func RCON() if GuiCtrlRead($RCS) = "Off" Then GUICtrlSetData($RCS,"On") $TimerThingyAP= TimerInit ( ) $TimerThingyAS=TimerInit() $TimerThingyAD=TimerInit() While WinActive("MU") MouseClick("Right") If GuiCtrlRead($APS) = "On" and TimerDiff($TimerThingyAP) >= GuiCtrlRead($APD) Then Send("{SPACE}") $TimerThingyAP = TimerInit() EndIf if TimerDiff($TimerThingyAS) >= GuiCtrlRead($ASD) and GuiCtrlRead($ASS) = "On" Then Send($SB,1) Sleep(1000) MouseClick("Right") Sleep(2000) Send($OB,1) Sleep(1000) if GuiCtrlRead($LolCB) = $GUI_CHECKED Then Send($TS,1) Sleep(1000) MouseClick("Right") Sleep(2000) Send($OB,1) Sleep(1000) EndIf $TimerThingyAS = TimerInit() EndIf if GuiCtrlRead($ADS) = "On" And TimerDiff($TimerThingyAD) >= GuiCtrlRead($ADD) Then $x = 960 $y = 365 Send("v",1) for $i = 1 to 8 for $f = 1 to 2 MouseDown("Right") Sleep(50) mousemove( $x , $y) Sleep(50) MouseUp("Right") $x = $x + 30 Sleep(50) MouseDown("Left") Sleep(50) MouseUp("Left") Sleep(50) MouseDown("Right") Sleep(50) MouseMove(200,750) MouseUp("Right") Sleep(25) MouseDown("Left") Sleep(50) MouseUp("Left") Sleep(50) Next $x = 960 $y = $y + 30 Next send("v",1) $ClientSize=WinGetClientSize("MU") $ClientSize[0]= $ClientSize[0] / 2 $ClientSize[1] = $ClientSize[1] / 2 MouseMove($ClientSize[0],$Clientsize[1]) $TimerThingyAD= TimerInit() EndIf Sleep(GuiCtrlRead($RCD)) WEnd Else GUICtrlSetData($RCS,"Off") EndIf EndFunc Func APON() if GuiCtrlRead($RCS) = "On" Or GuiCtrlRead($LCS) = "On" Then GUICtrlSetData($APS,"On") ElseIf GuiCtrlRead($APS) = "On" Then GUICtrlSetData($APS,"Off") Else GUICtrlSetData($APS,"On") While WinActive("MU") Send("{SPACE}") Sleep(GuiCtrlRead($APD)) Wend EndIf EndFunc func LCON() if GuiCtrlRead($LCS) = "On" Then GUICtrlSetData($LCS, "Off") Else $TimerThingyAP = TimerInit() GUICtrlSetData($LCS,"On") While Winactive("MU") MouseClick("left") If GuiCtrlRead($APS) = "On" and TimerDiff($TimerThingyAP) >= GuiCtrlread($APD) Then Send("{SPACE}") $TimerThingyAP = TimerInit() EndIf Sleep(GuiCtrlRead($LCD)) WEnd EndIf EndFunc Func ASON() if GuiCtrlRead($ASS) = "On" Then GUICtrlSetData($ASS, "Off") Else GUICtrlSetData($ASS,"On") EndIf EndFunc Func ADON() if GuiCtrlread($ADS) = "On" Then GUICtrlSetData($ADS, "Off") Else GUICtrlSetData($ADS,"On") EndIf EndFunc Func Halt() While 1 Sleep(100) WEnd EndFunc While 1 Sleep(1) WEnd Func HLPF() Msgbox(0,"Sorry, comeing soon.","Sorry help is currently unavaliable comeing soon though") EndFunc Func ABTF() MsgBox(0,"About.."," Silly Drop Bot 0.3v Beta" & @CRLF & " CopyRight 2006-2008" & @CRLF & "Credits:Some random kid") EndFunc Func LOL() Exit EndFunc func Savetoini() IniWrite("ConfigYoMama.ini","Buttons","OB",$OB) IniWrite("ConfigYoMama.ini","Buttons","SB",$SB) IniWrite("ConfigYoMama.ini","Buttons","TS",$TS) IniWrite("ConfigYoMama.ini","Delay","RCD",GuiCtrlRead($RCD)) Iniwrite("ConfigYoMama.ini","Delay","APD",GuiCtrlRead($APD)) Iniwrite("ConfigYoMama.ini","Delay","LCD",GuiCtrlRead($LCD)) Iniwrite("ConfigYoMama.ini","Delay","ASD",GuiCtrlRead($ASD)) Iniwrite("ConfigYoMama.ini","Delay","ADD",GuiCtrlRead($ADD)) EndFunc Func BSBF() $OB = GUICtrlRead($Vne) $SB = GuiCtrlRead($Zone) $TS = GuiCtrlRead($Dostupa) EndFunc Func UPRC() $UpRc = GuiCtrlRead($RCD) + 50 GUICtrlSetData($RCD,$UpRc) EndFunc Func DownRC() $DownRC = GuiCtrlRead($RCD) - 50 GuiCtrlSetData($RCD,$DownRC) EndFunc func UpAP() $UpAP = GuiCtrlread($APD) + 50 GuiCtrlSetData($APD,$UpAP) EndFunc Func DownAP() $DownAP = GuiCtrlRead($APD) - 50 GUICtrlSetData($APD,$DownAP) EndFunc Func UpLC() $UpLC = GuiCtrlRead($LCD) + 50 GUICtrlSetData($LCD,$UpLC) EndFunc Func DownLC() $DownLC = GuiCtrlRead($LCD) - 50 GUICtrlSetData($LCD,$DownLC) EndFunc Func UpAS() $UpAS = GuiCtrlRead($ASD) + 500 GUICtrlSetData($ASD,$UpAS) EndFunc Func DownAS() $DownAS = GUICtrlRead($ASD) - 500 GUICtrlSetData($ASD,$DownAS) EndFunc Func UPAD() $UPAD= GUICtrlRead($ADD) + 60000 GUICtrlSetData($ADD,$UPAD) EndFunc Func DownAD() $DOWNAD = GuiCtrlRead($ADD) - 60000 GUICtrlSetData($ADD,$DOWNAD) EndFunc basicly the functions Down RC LC & AP dont work ...how come..? Link to comment Share on other sites More sharing options...
Misha Posted October 27, 2006 Author Share Posted October 27, 2006 assist..? Link to comment Share on other sites More sharing options...
Valuater Posted October 27, 2006 Share Posted October 27, 2006 maybe try this.. replaced "shift" with "alt" key HotKeySet("{NUMPAD7}", "RCON") HotKeySet("{Numpad8}", "APON") HotKeySet("{Numpad9}", "LCON") HotKeySet("{NUMPAD6}", "ASON") HotKeySet("{NUmpad5}", "ADON") HotKeySet("{NUMPAD0}", "Halt") HotKeySet("^{Numpad7}", "UPRC") HotKeySet("!{Numpad1}", "DownRC") HotKeySet("^{Numpad8}", "UpAP") HotKeySet("!{Numpad8}", "DownAP") HotKeySet("^{Numpad9}", "UpLC") HotKeySet("!{Numpad9}", "DownLC") HotKeySet("{Numpad4}", "UpAS") HotKeySet("{Numpad1}", "DownAS") HotKeySet("^{Numpad5}", "UPAD") HotKeySet("{Numpad2}", "DownAD") worked fine 8) Link to comment Share on other sites More sharing options...
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