Sign in to follow this  
Followers 0
pieater112

bot scripting problems

7 posts in this topic

So I made this bot for this one game I was playing....

WinWaitActive ("12Sky");
While 1 = 1
    $i = 0
    While $1 <= 10
        $move= Random(1, 100, 1)
        If $Move < 50
            Send ("{RIGHT down}")
            Sleep (500)
            Send ("0x17")
            Sleep (500)
            Send ("e")
            Sleep (1000)
            Send ("{RIGHT up}")
        Else    
            Send ("{LEFT down}")
            Sleep (500)
            Send ("0x17")
            Sleep (500)
            Send ("e")
            Sleep (1000)
            Send ("{LEFT up}")
        EndIf   
        $i = $i + 1
    WEnd    
    Send ("{HOME}")

I've made a few other bots just as simple if not even a little more simple but this script is makes my character move around in random motions making it harder for people to notice this bot is in use.

The problem when I run this script in-game is that an error will come up literally 1 second after i start the bot up saying "'If' $move<50(line 6) must have a 'Then' command. I put "Then" in where the error told me and run the bot in-game again. This time it says "'Else' (line 14) must have an 'If' command".

Thus putting me in a loop of errors that I will never be able to fix...

Any suggestions as to get by this road block?

The game I play also uses F keys for attack skills. I wasn't totally sure how to put F commands inot ASCII... Anyone know what they are?


Time to Ride or Die Eye for Eye

Share this post


Link to post
Share on other sites



I guess this i what you need:

WinWaitActive ("12Sky");
While 1 = 1
    $i = 0
    While ($i <= 10)
        $move= Random(1, 100, 1)
        If ($Move < 50) Then
            Send ("{RIGHT down}")
            Sleep (500)
            Send ("0x17")
            Sleep (500)
            Send ("e")
            Sleep (1000)
            Send ("{RIGHT up}")
        Else    
            Send ("{LEFT down}")
            Sleep (500)
            Send ("0x17")
            Sleep (500)
            Send ("e")
            Sleep (1000)
            Send ("{LEFT up}")
        EndIf    
        $i = $i + 1
    WEnd    
    Send ("{HOME}")
WEnd

But I have one question: was it really possible for you to compile this code?

Regards

Share this post


Link to post
Share on other sites

If $Move < 50

This needs to be formatted to work for AutoIT by putting a "If <statement> Then". Check in the AutoIT Help for correct format of these things.

Here is a correct version of what you wanted

WinWaitActive ("12Sky");
While 1 = 1
    $i = 0
    While $1 <= 10
        $move= Random(1, 100, 1)
        If $Move < 50 Then
            Send ("{RIGHT down}")
            Sleep (500)
            Send ("0x17")
            Sleep (500)
            Send ("e")
            Sleep (1000)
            Send ("{RIGHT up}")
        Else    
            Send ("{LEFT down}")
            Sleep (500)
            Send ("0x17")
            Sleep (500)
            Send ("e")
            Sleep (1000)
            Send ("{LEFT up}")
        EndIf   
        $i = $i + 1
    WEnd    
    Send ("{HOME}")
WEnd

Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah

Share this post


Link to post
Share on other sites

Ok thanks it runs fine now.


Time to Ride or Die Eye for Eye

Share this post


Link to post
Share on other sites

If $Move < 50

This needs to be formatted to work for AutoIT by putting a "If <statement> Then". Check in the AutoIT Help for correct format of these things.

Here is a correct version of what you wanted

WinWaitActive ("12Sky");
While 1 = 1
    $i = 0
    While $1 <= 10
        $move= Random(1, 100, 1)
        If $Move < 50 Then
            Send ("{RIGHT down}")
            Sleep (500)
            Send ("0x17")
            Sleep (500)
            Send ("e")
            Sleep (1000)
            Send ("{RIGHT up}")
        Else    
            Send ("{LEFT down}")
            Sleep (500)
            Send ("0x17")
            Sleep (500)
            Send ("e")
            Sleep (1000)
            Send ("{LEFT up}")
        EndIf   
        $i = $i + 1
    WEnd    
    Send ("{HOME}")
WEnd
You haven't tested this right?

Because then you would have the error in line 4 at the second while loop that $1 is not declared in my surgestion I did change this to $i because i thought it was a typo.

but I don't know if this is just a little part of a bigger code?

Which one did you use pieater112?

and is this just a part of a bigger code ?

Regards

Share this post


Link to post
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
Sign in to follow this  
Followers 0