Jump to content

bot scripting problems


Recommended Posts

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

Link to comment
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

Link to comment
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

Link to comment
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

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...