Sveet 0 Posted April 3, 2004 Hey, im kinda new to this kida stuff... i was just wondering if there was some nice tutorial for coding... was looking (hard to stay concentrated a 2:30 am) but i didnt seem to find one... at least a hint or a point in the right direction would b appreciated... one of the things i was looking for was making my script read from a config file of some sort... i was going to make a game plug-in/bot and i think that this is at least a place to start with game coding, seeing as it is pretty basic... well, sry for the rant, plz help! if ya can post info about the config thingy, it would b very much appreciated... ty, and have a nice day/night Share this post Link to post Share on other sites
Jos 2,175 Posted April 3, 2004 When you downloaded the AutoIt v3 have a look at the AutoIt.chm file. Under "Using AutoIt" you find "Running scripts" which give you the first couple of steps you can take... 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. Share this post Link to post Share on other sites
Sveet 0 Posted April 3, 2004 (edited) heh... the sad part is... i actually read that... lol... guess i was too tired to remember it... edit: it read it... under stood it pretty much... but is there a place for tutorials other than that? ill read thru it later, but i g2g now... cya! ty for any help! Edited April 3, 2004 by Sveet Share this post Link to post Share on other sites
Chris_1013 0 Posted April 3, 2004 I'd say follow the basics of programming first.Know what you want to doWrite it in pseudo codeFind the functions to do it and write it for realIf you get stuck, just shout, someone can point you in the right direction. Share this post Link to post Share on other sites
Sveet 0 Posted April 4, 2004 (edited) sry for double post, but can u tell me how do u make the mouse move? Edited April 4, 2004 by Sveet Share this post Link to post Share on other sites
GrahamS 0 Posted April 4, 2004 sry for double post, but can u tell me how do u make the mouse move?Try the MouseMove function GrahamS Share this post Link to post Share on other sites
GrahamS 0 Posted April 4, 2004 pseudo code?Pseudo code is where you write out the script in a mixture of natural language and the programming language. It helps you work out the structure of the script without worrying too much about how you actually code it. For instance consider this bot for a ficticious game Run game Loop forever if Target in sight then Fire Missile else if Target is on left hand side then turn left else if Target is on right hand side then turn right else ; no target so turn in arbitary direction turn random(left, right) endif end forever loop The next step would be to replace one of the natural language phrases with actual code or more pseudo code. For instance running the game is actually two parts, first launch the game and second wait until the game has loaded. For example if firing a missile in the game is done by pressing the ALT and F keys together then the next iteration might be Lauch game Wait until game is loaded Loop forever if Target in sight then ; Fire Missile send("!F") else if Target is on left hand side then turn left else if Target is on right hand side then turn right else ; no target so turn in arbitary direction turn random(left, right) endif end forever loop You keep on going until all the natural language is replaced with real code. Often the natural language is kept as comments within the code (as in the Fire Missile example above. The other thing to do is to start small and build up to your final script. For instance, the first thing is to to ensure that you can launch the game, so write and test that code. Next, you might try to see if the bot can fire the missile, whilst you fly the plane, etc. etc. GrahamS Share this post Link to post Share on other sites
Sveet 0 Posted April 5, 2004 thx man, i had already gotten that info by the time u posted (sry)... i realized my idle (Rishodi) has his bot open source, so i saw it there... Share this post Link to post Share on other sites
Sveet 0 Posted April 5, 2004 oops... i had seen it around, but how do u set the wait times between sends? i cant seem to find it again... Share this post Link to post Share on other sites
GrahamS 0 Posted April 5, 2004 ("SendKeyDelay", 5) ;5 milliseconds GrahamS Share this post Link to post Share on other sites
Sveet 0 Posted April 5, 2004 thx man u saved my life Share this post Link to post Share on other sites
Sveet 0 Posted April 5, 2004 (edited) my script: ;AutoSkill ;Made by Sveet ;Open source :) $skill = myiniread("config.ini", "settings", "Skill") $delay = myiniread("config.ini", "settings", "delay") $window = myiniread(config.ini", "settings", "windowname") ("SendKeyDelay", $delay) winactivate($window) send($skill) EXIT now, im not sure exactly if this would work... and its not that well coded, seeing as it is my first script in any program language... i do no that i will need some error to popup if the window isnt there, and im not sure if the sendkeydelay works with the individual parts, sence they r in a function thingy (forgot name, talking about $skill).. feedback plz? edit: forgot to add in the EXIT because im writing this up at school... Edited April 5, 2004 by Sveet Share this post Link to post Share on other sites
Sveet 0 Posted April 5, 2004 (edited) ;AutoSkill ;Made by Sveet ;Open source :) $skill = myiniread("config.ini", "settings", "Skill") $delay = myiniread("config.ini", "settings", "delay") $window = myiniread(config.ini", "settings", "windowname") if winexists($window) ("SendKeyDelay", $delay) winactivate($window) send($skill) else make a popup with an error ;<---- not sure endif exit what i think i could do (pseudo code)... Edited April 5, 2004 by Sveet Share this post Link to post Share on other sites
Sveet 0 Posted April 5, 2004 is winactivate the right thing to use? Share this post Link to post Share on other sites
Sveet 0 Posted April 5, 2004 ("SendKeyDelay", 5) ;5 millisecondsumm... this didnt work... Share this post Link to post Share on other sites
Sveet 0 Posted April 5, 2004 nvm, got that all fixed... now, is there a way i could make a mouse click after every send? also, could i get something so i can use a hotkey to run my script (ei. ^S (ctrl+S)) but not quit the thing after? Share this post Link to post Share on other sites
scriptkitty 1 Posted April 5, 2004 (edited) You might like this code ;AutoSkill ;Made by Sveet ;Open source :) hotkeyset("{pause}","pauseme"); Pause key will pause (in case you deside to continuously run it. hotkeyset("^s","click"); hit Control+S to do your script $skill = myiniread("config.ini", "settings", "Skill") $delay = myiniread("config.ini", "settings", "delay") $window = myiniread(config.ini", "settings", "windowname") while 1 ; click() ; remove the; from the line above to make this continuouly do your script sleep(10); keeps script running and waiting for your pause. wend func click() if winexists($window) Opt ("SendKeyDelay", $delay) winactivate($window) send($skill) mouseclick("left",1) else make a popup with an error;<---- not sure endif endfunc Func Pauseme() $Paused = NOT $Paused While $Paused sleep(100) ToolTip($paused&'Script is "Paused"',0,0) WEnd ToolTip($paused) EndFunc Edited April 5, 2004 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers. Share this post Link to post Share on other sites
Sveet 0 Posted April 6, 2004 that doesnt help me much because i need to do more than 1 skill at a time... hmm... maybe ill check out Mr. Rishodi's code... Share this post Link to post Share on other sites