lysid Posted August 17, 2008 Share Posted August 17, 2008 Hello! im kinda new to the scripting world (took some classes in school) and was wondering (yes i searched for it) about how to write a script to just run a simple button pressing macro. ie; "hit w", delay a couple seconds" , "repeat". just tryin to work on the basics! If ya could help me out or point me in the right direction i would be ever so grateful!!! thanks again! Link to comment Share on other sites More sharing options...
Pain Posted August 17, 2008 Share Posted August 17, 2008 Welcome. While 1 ;endless send ("w") ;button to send sleep (1000) ;time in ms WEnd $i = 0 While $i <= 10 ;repeat X times send ("w") ;button to send sleep (1000) ;time in ms $i = $i + 1 WEnd for more information look in the helpfile Link to comment Share on other sites More sharing options...
lysid Posted August 17, 2008 Author Share Posted August 17, 2008 (edited) kk ty hmm now... to mod that into the script format! buut thanks so much <3! and by script format i mean the \\\ /// and all the fun stuff xD no wonder i failed my AP java class ... *edit* o yeah hmm do i need another line of code to allow it to run within a certain .exe? or will it automatically? Edited August 17, 2008 by lysid Link to comment Share on other sites More sharing options...
lysid Posted August 17, 2008 Author Share Posted August 17, 2008 *edited* kk ty no wonder i failed my AP java class ... *edit* sorry to double post, cant seem to re-edit my last post : and not to sound more nubish but can anyone take me step by step on how to put this into notepad or script editor and actually get it to work? I tried to put it into autoit format yet it wont save (says it does yet cant find it anywhere) so im a lil confused! All i wish to do is use it within another program to hit a "w" key every couple seconds, on an endless repeat. Sorry to beg on a step by step but my simple mind cant seem to figure it out... every time i compile it, it tells me that its not in the right directory ( or even saved for that matter) ahh its so frustrating!!!! Link to comment Share on other sites More sharing options...
Pain Posted August 17, 2008 Share Posted August 17, 2008 I suppose you already installed AutoIt and scite, if not download and install the latest version from here http://www.autoitscript.com/autoit3/downloads.shtmlafter you installed it rightclick on your desktop --> "New" and "AutoIt v3 script" to create a new script.Change the name to whatever you want like "MyFirstScript.au3"Open it with SciTE4AutoIt3 and paste this code:HotKeySet("{ESC}", "Terminate"); Press Esc to terminate the script While 1;endless loop send ("w");button to send sleep (1000);time in ms, 1000ms = 1sec pause WEnd Func Terminate() Exit EndFuncYour script are now done, if you want to change the pause just edit the "Sleep" to whatever you want to.To compile it go to "Tools" > "Compile" or press on Ctrl+F7.Look at your desktop and you should find a file called "MyFirstScript.exe". Link to comment Share on other sites More sharing options...
lysid Posted August 17, 2008 Author Share Posted August 17, 2008 <3 ty!!! sadly i found that the program i wish'd to run it apparently has some sort of anti-macro program because it just keeps pausing it... o well, still can use the program for other stuff! thanks again 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