Jump to content

problem


Recommended Posts

ok im in the process of making a game bot and heres my problem. im sending out 2 attacks i send the first then it sleeps until it comes back then sends the second one then sleeps until it come back so then i have to wait until the 2nd comes back before i can resend the first one is there a way for it to resend the first one when it comes back instead of waiting untill they are both back heres my code

func attack1()
    sleep(1000)
 $test = PixelSearch( 2, 2, 1015, 350, 0x378f24)

If Not @error Then 
    
MouseMove ( $test[0], $test[1])
         sleep(1000)
        MouseClick("left")
        ;sleeps and waits for attack to return
        sleep(350000)
    endif
EndFunc


func attack2()
sleep(3000)
    $test2 = PixelSearch( 2, 2, 1015, 350, 0x258319)

If Not @error Then 
    
MouseMove ( $test2[0], $test2[1])
         sleep(1000)
        MouseClick("left")
        
        ;sleeps and waits for attack to return
        sleep(700000)

EndIf
EndFunc
Link to comment
Share on other sites

1. You might want to be more descripting in your thread title. "problem" is not a good title.

2. What is the game

3. You have not included all of the code as this code supplied is just two functions which by themselfs do nothing. The answer to your question lies in the code that calls the functions.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

thxs for your reply the title fits i have a problem lol what should i put sleep problem? :(

these funcions are it bud they do what i need all im askin is after the program sleeps sleep(350000) i want it to do atack1() again then do attack2() i dont want it to sleep(350000) then sleep sleep(700000) before it does attack1 again

Link to comment
Share on other sites

You can call attack1 again (then it is recursive)or break up the functions more

attack1()
Sleep(350000) ;sleeps and waits for attack to return
attack1()
attack1() ; call it as may times as you want then put in the sleep when you want. 

attack2()
Sleep(700000) ;sleeps and waits for attack to return


Func attack1()
    Sleep(1000)
    $test = PixelSearch(2, 2, 1015, 350, 0x378f24)

    If Not @error Then
        MouseMove($test[0], $test[1])
        Sleep(1000)
        MouseClick("left")
    EndIf
EndFunc   ;==>attack1

Func attack2()
    Sleep(3000)
    $test2 = PixelSearch(2, 2, 1015, 350, 0x258319)

    If Not @error Then
        MouseMove($test2[0], $test2[1])
        Sleep(1000)
        MouseClick("left")
    EndIf
EndFunc   ;==>attack2

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

Which game?

http://www.autoitscript.com/forum/index.php?showannouncement=11&f=2

'Steveiwonder is correct. If the game goes against the EULA or TOS I would say thanks and leave it else you may get banned.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...