mHt Posted July 8, 2007 Share Posted July 8, 2007 (edited) Some days ago i posted here, asked for someone to code a "bot" for me... A few minutes later, i realized how lame i was, so i started learning a little in AI...So, here's my problem, I just want to know the best method to loop the following code for ever, until i press a sertain button.. You dont have to write it in my script, you can just tell me the method..MouseClick("Primary", 43, 773, 1, 10 ) sleep (1000) MouseClick("Primary", 401, 436, 1, 10 ) sleep (1000) MouseClick("Primary", 756, 512, 1, 10 ) sleep (2000) ; Regual Crime MouseClick("Primary", 37, 808, 1, 10 ) sleep (1000) MouseClick("Primary", 402, 579, 1, 10 ) sleep (1000) MouseClick("Primary", 745, 605, 1, 10 ) sleep (2000) ; Extortion MouseClick("Primary", 34, 909, 1, 10 ) sleep (1000) MouseClick("Primary", 627, 478, 1, 10 ) sleep (2000)Thanks m8's! Edited July 8, 2007 by mHt Link to comment Share on other sites More sharing options...
MerkurAlex Posted July 8, 2007 Share Posted July 8, 2007 (edited) while 1 MouseClick("Primary", 43, 773, 1, 10 ) sleep (1000) MouseClick("Primary", 401, 436, 1, 10 ) sleep (1000) MouseClick("Primary", 756, 512, 1, 10 ) sleep (2000) ; Regual Crime MouseClick("Primary", 37, 808, 1, 10 ) sleep (1000) MouseClick("Primary", 402, 579, 1, 10 ) sleep (1000) MouseClick("Primary", 745, 605, 1, 10 ) sleep (2000) ; Extortion MouseClick("Primary", 34, 909, 1, 10 ) sleep (1000) MouseClick("Primary", 627, 478, 1, 10 ) sleep (2000) wend press a to stop it make sure you put this at the top of the script #include<misc.au3> Edited July 8, 2007 by EagleClaw [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
mHt Posted July 8, 2007 Author Share Posted July 8, 2007 Thanks! that worked fine!! ok! another question Is it possible to greate a small gui with 2 buttons, like start, and exit ? Link to comment Share on other sites More sharing options...
MerkurAlex Posted July 8, 2007 Share Posted July 8, 2007 Thanks! that worked fine!! ok! another question Is it possible to greate a small gui with 2 buttons, like start, and exit ?yea just a min ill edit this when im done [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
Generator Posted July 8, 2007 Share Posted July 8, 2007 Try this... expandcollapse popup#Include<misc.au3> While Not _IsPressed("1B") ; While Esc key is not pressed, this way when you press esc you will exit the program MouseClick("Primary", 43, 773, 1, 10 ) sleep (1000) MouseClick("Primary", 401, 436, 1, 10 ) sleep (1000) MouseClick("Primary", 756, 512, 1, 10 ) sleep (2000) ; Regual Crime MouseClick("Primary", 37, 808, 1, 10 ) sleep (1000) MouseClick("Primary", 402, 579, 1, 10 ) sleep (1000) MouseClick("Primary", 745, 605, 1, 10 ) sleep (2000) ; Extortion MouseClick("Primary", 34, 909, 1, 10 ) sleep (1000) MouseClick("Primary", 627, 478, 1, 10 ) sleep (2000) WEndoÝ÷ Øêí+0k(Ê°j{m¢®±ê+j|)àjëh×6Global $Bool=0; Global a boolean type variable, and set to 0 which is off While 1 If _IsPressed("13") Then ; If PAUSE key is pressed Do Sleep(1) ;Temp sleep Until Not _IsPressed("13") ;To prevent multi detection while key is being held down $Bool=Not $Bool ; Change 0 to 1 EndIf While $Bool ; While Bool=1 MouseClick("Primary", 43, 773, 1, 10 ) sleep (1000) MouseClick("Primary", 401, 436, 1, 10 ) sleep (1000) MouseClick("Primary", 756, 512, 1, 10 ) sleep (2000) ; Regual Crime MouseClick("Primary", 37, 808, 1, 10 ) sleep (1000) MouseClick("Primary", 402, 579, 1, 10 ) sleep (1000) MouseClick("Primary", 745, 605, 1, 10 ) sleep (2000) ; Extortion MouseClick("Primary", 34, 909, 1, 10 ) sleep (1000) MouseClick("Primary", 627, 478, 1, 10 ) sleep (2000) WEnd WEnd Link to comment Share on other sites More sharing options...
Generator Posted July 8, 2007 Share Posted July 8, 2007 When i edit the code is messed up, just add #Include<misc.au3> in the 2nd script. Link to comment Share on other sites More sharing options...
mHt Posted July 8, 2007 Author Share Posted July 8, 2007 (edited) Can you show me how to make a GUI box with the two buttons START & STOP ? ^^ I think i know how to make the gui, but not to get the buttons to work... Edited July 8, 2007 by mHt Link to comment Share on other sites More sharing options...
MerkurAlex Posted July 8, 2007 Share Posted July 8, 2007 Can you show me how to make a GUI box with the two buttons START & STOP ? ^^ I think i know how to make the gui, but not to get the buttons to work...here you are its not great but it works press esc to stop its hard to get to the button while its running expandcollapse popup#include <GUIConstants.au3> #include<misc.au3> hotkeyset("{esc}","stop") $win=guicreate("title here",100,20,-1,-1) $startbtn=guictrlcreatebutton("start",5,0,40,15) $stopbtn=guictrlcreatebutton("stop",50,0,40,15) GUISetState(@SW_SHOW) $running=0 while 1 $nMsg = GUIGetMsg() Switch $nMsg case $GUI_EVENT_CLOSE Exit case $startbtn $running=1 case $stopbtn $running=0 EndSwitch if $running=1 then do MouseClick("Primary", 43, 773, 1, 10 ) sleep (1000) if $running=0 then exitloop MouseClick("Primary", 401, 436, 1, 10 ) sleep (1000) if $running=0 then exitloop MouseClick("Primary", 756, 512, 1, 10 ) sleep (2000) if $running=0 then exitloop ; Regual Crime MouseClick("Primary", 37, 808, 1, 10 ) sleep (1000) if $running=0 then exitloop MouseClick("Primary", 402, 579, 1, 10 ) sleep (1000) if $running=0 then exitloop MouseClick("Primary", 745, 605, 1, 10 ) sleep (2000) if $running=0 then exitloop ; Extortion MouseClick("Primary", 34, 909, 1, 10 ) sleep (1000) if $running=0 then exitloop MouseClick("Primary", 627, 478, 1, 10 ) sleep (2000) until $running=0 endif WEnd func stop() $running=0 EndFunc [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
mHt Posted July 8, 2007 Author Share Posted July 8, 2007 THANKS MAN! OMG YOURE AWESOME!! Sinse im the noob here, i got a nother question 4 yah... can you instert the gui in the whole code? ( i just pasted the loop section here ) i want you to add this before the loop.. THIS PART SHALL NOT LOOP!!!! ; Login Function ( You have 4 seconds from you run the exe until you must have opened USmafia window ) sleep (4000) MouseClick("Primary", 605, 552, 1, 10 ) send ("username") MouseClick("Primary", 621, 587, 1, 10 ) send ("password") MouseClick("Primary", 639, 622, 1, 10 ) sleep (3500) ; Car Stealing MouseClick("Primary", 43, 773, 1, 10 ) sleep (1000) MouseClick("Primary", 401, 436, 1, 10 ) sleep (1000) MouseClick("Primary", 756, 512, 1, 10 ) sleep (2000) ; Regual Crime MouseClick("Primary", 37, 808, 1, 10 ) sleep (1000) MouseClick("Primary", 402, 579, 1, 10 ) sleep (1000) MouseClick("Primary", 745, 605, 1, 10 ) sleep (2000) ; Extortion MouseClick("Primary", 34, 909, 1, 10 ) sleep (1000) MouseClick("Primary", 627, 478, 1, 10 ) sleep (2000) Link to comment Share on other sites More sharing options...
anixon Posted July 8, 2007 Share Posted July 8, 2007 This will get you started with a user interface CODE#include <GuiConstants.au3> GUICreate("Start Stop", 375, 250, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $StartButton = GUICtrlCreateButton("Start", 143, 100, 80, 23) $ExitButton = GUICtrlCreateButton("Exit", 235, 100, 80, 23) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $ExitButton GUIDelete() Exit Case $msg = $StartButton ;Put your routine here EndSelect WEnd And.. Link to comment Share on other sites More sharing options...
mHt Posted July 8, 2007 Author Share Posted July 8, 2007 No need to EagleClaw.. i think i did it myself Link to comment Share on other sites More sharing options...
MerkurAlex Posted July 8, 2007 Share Posted July 8, 2007 No need to EagleClaw.. i think i did it myself okay thats good [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
mHt Posted July 8, 2007 Author Share Posted July 8, 2007 ey.. how do i tell AI to use my splash image? ive made the correct sizes just need to choose destination.. I created a folder named "bot"... Inside bot is the script, and another folder called "img" and the .jpg splash image is in "img" folder... how do i get the splash to show from right place?? PLEASE fill inn : $destination = destination here please SplashImageOn("Splash Screen", $destination,250,50) Sleep(3000) SplashOff() Link to comment Share on other sites More sharing options...
MerkurAlex Posted July 8, 2007 Share Posted July 8, 2007 ey.. how do i tell AI to use my splash image? ive made the correct sizes just need to choose destination.. I created a folder named "bot"... Inside bot is the script, and another folder called "img" and the .jpg splash image is in "img" folder... how do i get the splash to show from right place?? PLEASE fill inn : $destination = destination here please SplashImageOn("Splash Screen", $destination,250,50) Sleep(3000) SplashOff()$destination = @scriptdir&"\img\filenaame" SplashImageOn("Splash Screen", $destination,250,50) Sleep(3000) SplashOff() hope that works ive never used splashes haha [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
mHt Posted July 8, 2007 Author Share Posted July 8, 2007 (edited) THANKS! Edited July 8, 2007 by mHt Link to comment Share on other sites More sharing options...
MerkurAlex Posted July 8, 2007 Share Posted July 8, 2007 (edited) Worked perfekt! ok a little math question for you m8!what would the sleep command be if i wanted the script to sleep 2 min ?oops uhm that was 2 seconds just take 1000 and multiply it man 1000 is 1 secondso pretty much 60000 Edited July 8, 2007 by EagleClaw [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
Paulie Posted July 8, 2007 Share Posted July 8, 2007 oops uhm that was 2 seconds just take 1000 and multiply it man 1000 is 1 secondso pretty much 60000Take Seconds times 1000.There are 120 seconds in 2 minutes, Therefore 120*1000 = 120000 milliseconds in 2 minutes. Link to comment Share on other sites More sharing options...
mHt Posted July 8, 2007 Author Share Posted July 8, 2007 I found out, just had to think for once.. ok!! How do i change the icon on the exe?? i have an icon file i'd like to use... j Link to comment Share on other sites More sharing options...
MerkurAlex Posted July 8, 2007 Share Posted July 8, 2007 I found out, just had to think for once.. ok!! How do i change the icon on the exe?? i have an icon file i'd like to use... ji know how to change gui icon not sure about exe though let me figure out ill post when i know or if someone else beats me to it yay lol [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
mHt Posted July 8, 2007 Author Share Posted July 8, 2007 i know how to change gui icon not sure about exe though let me figure out ill post when i know or if someone else beats me to it yay lol hihi ok 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