pieater112 Posted June 17, 2008 Share Posted June 17, 2008 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 More sharing options...
sandin Posted June 17, 2008 Share Posted June 17, 2008 If $Move < 50 then Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
Developers Jos Posted June 17, 2008 Developers Share Posted June 17, 2008 Where did you put the "Then" ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
newbiescripter Posted June 17, 2008 Share Posted June 17, 2008 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 More sharing options...
TerarinKerowyn Posted June 17, 2008 Share Posted June 17, 2008 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 More sharing options...
pieater112 Posted June 17, 2008 Author Share Posted June 17, 2008 Ok thanks it runs fine now. Time to Ride or Die Eye for Eye Link to comment Share on other sites More sharing options...
newbiescripter Posted June 18, 2008 Share Posted June 18, 2008 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 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