AznBeBeAngel Posted September 19, 2009 Share Posted September 19, 2009 hey guys i am new to autoit and this is my first time trying to make a bot, i have searched and compiled my bot but it doesn't seem to function the way I want it to. Could someone please give me advice on my script please and thanks : ) How i want it to work: I want the bot to press tab then press the number 3 (not on the keypad), i want it to press "3" 3 times and loop it back to pressing tab. i want it to loop infinite times. here is what i ended up with. WinWaitActive ("HBO"); While 1=1 send ("{TAB}") sleep (2000) send ("3") sleep (2000) send ("3") sleep (2000) send ("3") WEnd Link to comment Share on other sites More sharing options...
JohnOne Posted September 19, 2009 Share Posted September 19, 2009 If it dosent do what you expected What does it actually do ? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
AznBeBeAngel Posted September 19, 2009 Author Share Posted September 19, 2009 If it dosent do what you expectedWhat does it actually do ?it attacks once (tabs then presses 3) and it doesnt do anything after that. I can tell it presses "3" because in game i could see it say "target does not exist" Link to comment Share on other sites More sharing options...
colafrysen Posted September 19, 2009 Share Posted September 19, 2009 (edited) But it should repeat the procedure? It does on my computer... What does the Tab do? it is supposed to be repeated? Also, you do only check for the right window once, i think that it would be better if the While statement was to check for the window to be active. Something like this (I stil don't know what is wrong with the code ) WinWaitActive ("HBO"); While WinActive("HBO") Send("{TAB}") For $i = 1 To 3 Step 1 Send("3") Sleep(2000) Next WEnd Edited September 19, 2009 by colafrysen [font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size] Link to comment Share on other sites More sharing options...
omikron48 Posted September 19, 2009 Share Posted September 19, 2009 (edited) Wouldn't that terminate the while loop the moment the window is inactive? WinWaitActive ("HBO"); While 1 While WinActive("HBO") Send("{TAB}") For $i = 1 To 3 Step 1 Send("3") Sleep(2000) Next WEnd Sleep(100) WEnd Edited September 19, 2009 by omikron48 Link to comment Share on other sites More sharing options...
AznBeBeAngel Posted September 20, 2009 Author Share Posted September 20, 2009 Wouldn't that terminate the while loop the moment the window is inactive? WinWaitActive ("HBO"); While 1 While WinActive("HBO") Send("{TAB}") For $i = 1 To 3 Step 1 Send("3") Sleep(2000) Next WEnd Sleep(100) WEnd it worked once but it never pressed tab again after that, it was press "3" 3 times and i could see that in the program but it doesnt press tab . Link to comment Share on other sites More sharing options...
colafrysen Posted September 20, 2009 Share Posted September 20, 2009 Wouldn't that terminate the while loop the moment the window is inactive?Yes, but I took for granted that it is not supposed to run if the window is inactive . If you don't want it to close the moment the window becomes inactive, just put the whole script into another While...Wend.And about the repeating, It does repeat, test by running it in the editor, it writes stuff... (with the win* functions disabled)Test by pressing Tab,3,3,3 by manually to see that the same window is active during the whole procedure. [font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size] Link to comment Share on other sites More sharing options...
AznBeBeAngel Posted September 20, 2009 Author Share Posted September 20, 2009 Yes, but I took for granted that it is not supposed to run if the window is inactive . If you don't want it to close the moment the window becomes inactive, just put the whole script into another While...Wend.And about the repeating, It does repeat, test by running it in the editor, it writes stuff... (with the win* functions disabled)Test by pressing Tab,3,3,3 by manually to see that the same window is active during the whole procedure.it does repeat in the active window (which is the game) but it does not press "TAB" it presses 3,3,3 but it just doesnt press tab. Link to comment Share on other sites More sharing options...
colafrysen Posted September 20, 2009 Share Posted September 20, 2009 it does repeat in the active window (which is the game) but it does not press "TAB" it presses 3,3,3 but it just doesnt press tab.I shall quote myself to make clear that you need to do these tests.Test by pressing Tab,3,3,3 by manually to see that the same window is active during the whole procedure.This is important, there might be an error hereAnd about the repeating, It does repeat, test by running it in the editor, it writes stuff... (with the win* functions disabled)Do this to understand that it DOES actually press tab.If it's not you who made the error then the game probably got some weird gameguard which prohibits the tab key [font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size] Link to comment Share on other sites More sharing options...
omikron48 Posted September 20, 2009 Share Posted September 20, 2009 You could try this: WinWaitActive ("HBO") While 1 While WinActive("HBO") _Send("HBO", "{TAB}") For $i = 1 To 3 Sleep(2000) _Send("HBO", "3") Next WEnd Sleep(100) WEnd Func _Send($title, $keys) WinWait($title) WinActivate($title) WinWaitActive($title) Send($keys) EndFunc If it doesn't work, then the game is blocking the keys. This was also the case when I tried making a turbo key script for Xenon. Link to comment Share on other sites More sharing options...
AznBeBeAngel Posted September 20, 2009 Author Share Posted September 20, 2009 (edited) I shall quote myself to make clear that you need to do these tests.Test by pressing Tab,3,3,3 by manually to see that the same window is active during the whole procedure.This is important, there might be an error hereAnd about the repeating, It does repeat, test by running it in the editor, it writes stuff... (with the win* functions disabled)Do this to understand that it DOES actually press tab.If it's not you who made the error then the game probably got some weird gameguard which prohibits the tab key nope, still doesn't do it, but i realized that if i alt+tabbed out of game and clicked back to get in the game it tabs again :Sedit: could anybody please PLEASE try this game and tell me why it does not work i am very illiterate at these things because i do not know how to hack. the game is at http://holybeast.ijji.com/ Edited September 20, 2009 by AznBeBeAngel Link to comment Share on other sites More sharing options...
snow9 Posted September 27, 2009 Share Posted September 27, 2009 (edited) nope, still doesn't do it, but i realized that if i alt+tabbed out of game and clicked back to get in the game it tabs again :S edit: could anybody please PLEASE try this game and tell me why it does not work i am very illiterate at these things because i do not know how to hack. the game is at http://holybeast.ijji.com/ im making a bot myself ill show you my source code, but it has some problems that i need to fix: your bot has an even bigger problem it will select a monster, and press 3 times 3 if it will work butwhat if the mob isnt dead yet? then he will select another mob, and the other one will keep attacking you you also need an autopot, else you will die i made auto pot with pixelsearch (=search the window for a certain color, ex search on the coordinates from your life bar for the color red, if not founded your dead)) but found out you cant search for your lifes and mana etc with it all the windows ingame ex. invetory quests life mana minimap etc, you cant pixelsearch for them only monsters and background so now my bot doesnt know when the monster dies, so i cant let it select another one, and i also dont have autopot but i can select monsters with tab, so i show you how to i also made a autologin, if hbo exits or disconnect, then it will close the program and keep trying to autorelogin until it works also a handy tool if you want your bot being able to run forever http://rapidshare.com/files/273871678/bot.rar autopot doesnt work and the bot (something with hunt.exe and/or autohunt.exe )program in it is with pixelsearch, so that also doesnt work its also handy for your bot that you have an exit key heres my newer bot http://rapidshare.com/files/285608880/hunt.au3 it selects monsters, but thats it, you could edit it heres the code expandcollapse popup;Made by Snow9 ;thx to elitepvpers.com for learning me the basics of auto it ; ;move the enemys lifebar to the upper right corner ;of the screen and make sure its on top of your map ;your life bar should be in the upper left corner Global $Paused HotKeySet("{end}", "Pause") HotKeySet("{home}", "Start") While 1 Sleep(100) WEnd Func Pause() $Paused = NOT $Paused While $Paused sleep(100) WEnd EndFunc ; keys (f1 f2 etc dont work for HBO) ; & 1 ; é 2 ; " 3 ; ' 4 ; ( 5 ; § 6 ; è 7 ; ! 8 ; ç 9 ; à 0 Func Start() while 1 Sleep(100) Send("{tab}") ;i send tab here, and it does work, mob is selected Else while $mob = NOT "72812c" ;last pixel of mobs lifebar, if this is not red(72812c is the hex code) then the mob is dead, but pixelsearch doesnt work in hbo Send("{ç}") $mm = PixelGetColor ( 1138,12 ) $mob = Hex($mm, 6) wend Send("{à}") Sleep(500) Send("{à}") Sleep(300) Send("{à}") EndIf endif Wend endfunc ps: this is also my first time using this, never done it before but it s addicted to make it, and if something works, or you find the solution for a bug in your program, you'r so happy and wouldnt your problem be the winactive thing? you should try if proces is active the command for the loader from hbo if ProcessExists("_UpgradeClientEN.exe") then the command for hbo game being active if ProcessExists("HBOnline.exe") then edit: no im wrong, i found your problem its the send HBO tab thing you cant send tab only to HBO, try just send tab, then it will work it a security thing from HBO, so unless you can hack that , what i doubt^^, you cant send tab only to HBO and the game doesnt block the keys 1 2 3 etc, but you need to enter the other thingy under it look here ; keys (f1 f2 etc dont work for HBO) ; & 1 ; é 2 ; " 3 ; ' 4 ; ( 5 ; § 6 ; è 7 ; ! 8 ; ç 9 ; à 0 Edited September 27, 2009 by snow9 Link to comment Share on other sites More sharing options...
Zemallo Posted October 19, 2009 Share Posted October 19, 2009 Snow9 theres an error with your script when i try to run it i get the error on line 39 the error is Error: "Else" statement with no matching "If" statement. im real new to this and i dont know how to fix it >.< Link to comment Share on other sites More sharing options...
omikron48 Posted October 19, 2009 Share Posted October 19, 2009 (edited) @AznBeBeAngel: Maybe the game isn't registering on the button presses because it's too fast. That was the problem when I made a turbo toggle button for Xenon. Try sticking this at the top of your script: Opt("SendKeyDownDelay", 50) Edited October 19, 2009 by omikron48 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