savage29 Posted December 17, 2010 Share Posted December 17, 2010 hey people, so im still not understanding some things, im trying to teach myself but its kinda hard when you start with nothing. at the moment, i am trying to create a very very simple script, and i have looked through the help files for the last 2 hours. ive found the easiest way for me to understand something is to reverse-engineer it somewhat. im not trying to get anyone to write script for me because im lazy, i seriously want to learn anyway, i would appreciate it greatly if someone would show me a script or 2 that does only 2 things, presses the TAB key then immediately after that, the number 1 key, and repeats this action once every 10 secs for a timespan i can set either in the script or letting it repeat until i hit escape. please please please help me, im having quite a lot of trouble figuring this out. thanks in advance Link to comment Share on other sites More sharing options...
bogQ Posted December 17, 2010 Share Posted December 17, 2010 (edited) Tab 1 is related for selecting and attacking, show what did you try, this still isnt new eyer, we still dont give scripts as presents, show something that did not work and someone maby will help you if its not "bot/game" related!!! Edited December 17, 2010 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
wakillon Posted December 17, 2010 Share Posted December 17, 2010 (edited) ; a script or 2 that does only 2 things : ; presses the TAB key : see Send ( "keys" [, flag] ) send ( "{TAB}" ) ; then immediately after that, the number 1 key, send ( "{NUMPAD1}" ) ; and repeats this action once every 10 secs While 1 ; action Sleep ( 10000 ) WEnd ; repeat until i hit escape. : HotKeySet ( "{ESC}", "_Terminate" ) Func _Terminate ( ) Exit EndFuncI give you all the functions needed for your script , now build it ! See help file for more details ! Edited December 17, 2010 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
savage29 Posted December 17, 2010 Author Share Posted December 17, 2010 Tab 1 is related for selecting and attacking, show what did you try, this still isnt new eyer, we still dont give scripts as presents, show something that did not work and someone maby will help you if its not "bot/game" related!!!ok sure. it is game related, but not bot related in the sense that most would think, im not working on a hack or anything like that, i made a previous post asking how to click a mouse in the same spot for a period of time, and the reason im asking for an automated script to help me is quite simple, i lost 3 fingers in a work accident and its a downright pain in the butt having only a thumb and pointer finger, it wasnt the greatest day at work i tell ya... anyway, ill put it quite simply, and perhaps some of you will know what i am talking about, i have this dice i need to click on repeatedly until 6 comes up 6 times in a row, and i dont really feel like sitting here for the next 9 months clicking it, ive looked up the odds of it actually happening so believe me, this isnt cheating in the slighest lol, i did get that to work, and for the last week no luck on the dice so far. and now i would appreciate a bit of help making grinding easier. there is already a fully working bot for the game i play, healing etc included and i dont want that, theres no point in playing if you dont actually PLAY. so help me or dont, i cant force you, heres what i have ---Do Send("{TAB}") Send("{ONE}") sleep(10000)Until*******there is where i lose it. i dont know what to put next. how do i set an inital sleep time and get the program to stop after say 1 minute?thats all i need it to do so i can follow the team from one mob to another. i think i can work out how to set a hotkey to pause the program,ill have to look into it a little more.thanks for the reply Link to comment Share on other sites More sharing options...
savage29 Posted December 17, 2010 Author Share Posted December 17, 2010 thank you so much wakillon,, thats what i was looking for exactly Link to comment Share on other sites More sharing options...
savage29 Posted December 17, 2010 Author Share Posted December 17, 2010 ; a script or 2 that does only 2 things : ; presses the TAB key : see Send ( "keys" [, flag] ) send ( "{TAB}" ) ; then immediately after that, the number 1 key, send ( "{NUMPAD1}" ) ; and repeats this action once every 10 secs While 1 ; action Sleep ( 10000 ) WEnd ; repeat until i hit escape. : HotKeySet ( "{ESC}", "_Terminate" ) Func _Terminate ( ) Exit EndFunc I give you all the functions needed for your script , now build it ! See help file for more details ! ok, what exactly does While 1 do? i understand the idea behind the script now but i still dont understand where to pull these random lines of code from :S Link to comment Share on other sites More sharing options...
wakillon Posted December 17, 2010 Share Posted December 17, 2010 ok, what exactly does While 1 do? i understand the idea behind the script now but i still dont understand where to pull these random lines of code from :SIt's a condition to close the loop ( while 1 or while 2... )See help file for while function ! Put hotkeyset firstPut the Send actions in the while loop and function at the endTry and show ... AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
savage29 Posted December 17, 2010 Author Share Posted December 17, 2010 (edited) ok, what exactly does While 1 do? i understand the idea behind the script now but i still dont understand where to pull these random lines of code from :Sok now i found the controlsend command, and this is what i havecontrolsend("window name") **the window name itself has brackets in it so how do i put them in?**send ( "{TAB}" ) send ( "{NUMPAD1}" ) While 1 Sleep ( 10000 ) WEnd HotKeySet ( "{ESC}", "_Terminate" ) Func _Terminate ( ) Exit EndFunchow is that looking or am i missing something? and i just noticed you replied again ok heres what i have nowHotKeySet ( "{ESC}", "_Terminate" ) controlsend("(game)")While 1 send ( "{TAB}" ) send ( "{NUMPAD1}" ) Sleep ( 10000 ) WEnd Func _Terminate ( ) Exit EndFunc Edited December 17, 2010 by savage29 Link to comment Share on other sites More sharing options...
Mat Posted December 17, 2010 Share Posted December 17, 2010 (edited) While starts a loop. When it meets the WEnd it goes back to While When the condition after While is TRUE. The number '1' will always evaluate to TRUE so the looop will always be repeated. 'While 1' is the way it's always been done here, but you could use the True keyword or anopther expression like "1=1".It makes sense when you understand what it aims to achieve and how computers think about that sort of stuff. I know it can look confusing when poeple start pulling lines out of a hat which don't make sense to humans Just learn those from examples and remember them. You'll use them so often your fingers will type it for you after a while Edit: The other thing you'll learn is that there is two ways to stop people helping you on the forum. The second is not using code tags [autoit] CODE HERE [/autoit]The result is much nicer looking output. It will keep whitespace, provide syntax highlighting, limit the height of the code, and generally makes the code look readable on the forums. Edited December 17, 2010 by Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
savage29 Posted December 17, 2010 Author Share Posted December 17, 2010 While starts a loop. When it meets the WEnd it goes back to While When the condition after While is TRUE. The number '1' will always evaluate to TRUE so the looop will always be repeated. 'While 1' is the way it's always been done here, but you could use the True keyword or anopther expression like "1=1".It makes sense when you understand what it aims to achieve and how computers think about that sort of stuff. I know it can look confusing when poeple start pulling lines out of a hat which don't make sense to humans Just learn those from examples and remember them. You'll use them so often your fingers will type it for you after a while well i used to use delphi a long time ago, and i never really learnt much while i was in college, so i do kinda understand how everything works, its just GETTING it to work and remembering again how to set variables etc... i really do appreciate the help guys (or gals) Link to comment Share on other sites More sharing options...
savage29 Posted December 17, 2010 Author Share Posted December 17, 2010 While starts a loop. When it meets the WEnd it goes back to While When the condition after While is TRUE. The number '1' will always evaluate to TRUE so the looop will always be repeated. 'While 1' is the way it's always been done here, but you could use the True keyword or anopther expression like "1=1". It makes sense when you understand what it aims to achieve and how computers think about that sort of stuff. I know it can look confusing when poeple start pulling lines out of a hat which don't make sense to humans Just learn those from examples and remember them. You'll use them so often your fingers will type it for you after a while Edit: The other thing you'll learn is that there is two ways to stop people helping you on the forum. The second is not using code tags [autoit] CODE HERE [/autoit] The result is much nicer looking output. It will keep whitespace, provide syntax highlighting, limit the height of the code, and generally makes the code look readable on the forums. heh thanks for the heads up Link to comment Share on other sites More sharing options...
wakillon Posted December 17, 2010 Share Posted December 17, 2010 (edited) Please use AutoIt Tag for post code HotKeySet ( "{ESC}", "_Terminate" ) controlsend("(game)") While 1 send ( "{TAB}" ) send ( "{NUMPAD1}" ) Sleep ( 10000 ) WEnd Func _Terminate ( ) Exit EndFunc So, It works ? Edited December 17, 2010 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
savage29 Posted December 17, 2010 Author Share Posted December 17, 2010 Please use AutoIt Tag for post code [color=#1C2837][size=2]HotKeySet ( "{ESC}", "_Terminate" ) controlsend("(game)") While 1 send ( "{TAB}" ) send ( "{NUMPAD1}" ) Sleep ( 10000 ) WEnd Func _Terminate ( ) Exit EndFunc [/size][/color] So, It works ? no, from the looks of it, its doing nothing at all. there must be something missing between controlsend and send? its not pressing TAB or 1 Link to comment Share on other sites More sharing options...
wakillon Posted December 17, 2010 Share Posted December 17, 2010 no, from the looks of it, its doing nothing at all. there must be something missing between controlsend and send?its not pressing TAB or 1 It's pressing but not at the good place, what's the name of the window where you want send Tab and 1 ?use AutoItwindoinfo utility for get it... AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
savage29 Posted December 17, 2010 Author Share Posted December 17, 2010 (edited) It's pressing but not at the good place, what's the name of the window where you want send Tab and 1 ? use AutoItwindoinfo utility for get it... i cant give away which game im playing, ill lose respect if anyone else here plays it lol but ill type how it shows - gamename- (server: 7) *edit* ok from what i have now, it opens the game window, then does nothing -- HotKeySet ( "{ESC}", "_Terminate" ) WinActivate ( "game") ControlSend ( "game") While 1 send ( "{TAB}" ) send ( "{NUMPAD1}" ) Sleep ( 10000 ) WEnd Func _Terminate ( ) Exit EndFunc Edited December 17, 2010 by savage29 Link to comment Share on other sites More sharing options...
wakillon Posted December 17, 2010 Share Posted December 17, 2010 If you don't give the good title window you can't activate it, and send too... AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
savage29 Posted December 17, 2010 Author Share Posted December 17, 2010 If you don't give the good title window you can't activate it, and send too...i just said the window activates, i did get the proper name from autoit window info (thankyou), again, it just wont input the button presses.... :S Link to comment Share on other sites More sharing options...
wakillon Posted December 17, 2010 Share Posted December 17, 2010 i just said the window activates, i did get the proper name from autoit window info (thankyou), again, it just wont input the button presses.... :STry to add WinActivate line and a winwaitactivate in the loop before the Send actions... AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
savage29 Posted December 17, 2010 Author Share Posted December 17, 2010 (edited) Try to add WinActivate line and a winwaitactivate in the loop before the Send actions... HotKeySet ( "{ESC}", "_Terminate" ) While 1 WinActivate ("game") WinWaitActive("game", "", 5) ControlSend ("game") send ( "{TAB}" ) send ( "{NUMPAD1}" ) Sleep ( 10000 ) WEnd Func _Terminate ( ) Exit EndFunc doesnt work. compiling and running the program gives an error for line one, incorrect number of parameters in function call. so now what? lol Edited December 17, 2010 by savage29 Link to comment Share on other sites More sharing options...
somdcomputerguy Posted December 17, 2010 Share Posted December 17, 2010 The ControlSend parameters are wrong. Actually, there is only one parameter for it in your script. That's wrong. Read about it some more in the Help File. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Recommended Posts