Paulie Posted March 6, 2006 Share Posted March 6, 2006 I need help ok this is my current script Hotkeyset("{g}", "Start") Hotkeyset("{h}", "Stop") $n=0 While $n=0 Sleep(550) WEnd Func Start() $n=1 $i=1 While $i=1 Mouseclick("Left") Mouseclick("Right") WEnd EndFunc Func Stop() $i=2 $n=0 EndFunc What i am looking for is basically a script that makes so it waits in the backround then whenever i push "g" it rapidly and continually clicks left then right over and over and over again until i push "h" then it stops and paused again Any help is apppreaciated TY in advance Link to comment Share on other sites More sharing options...
cdkid Posted March 6, 2006 Share Posted March 6, 2006 HotKeySet("g","start") HotKeySet("h","stop") While 1 sleep(1000) WEnd func start() do mouseclick("left") mouseclick("right") until @hotkeypressed = "h" endfunc func stop() end func that 'ought to do ya AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide! Link to comment Share on other sites More sharing options...
Paulie Posted March 6, 2006 Author Share Posted March 6, 2006 Sorry but for some reason "until @hotkeypressed = "h"" Returns as an "unknown macro" PLEASE HELp BTW tY for trying Link to comment Share on other sites More sharing options...
greenmachine Posted March 6, 2006 Share Posted March 6, 2006 I don't see what's wrong with your initial script. You might want to change the "{g}" and "{h}" hotkeys to just "g" and "h", but other than that it looks like it should work. If it doesn't work, what part is acting up? Is there an error, or is just not acting exactly how you think it should? Link to comment Share on other sites More sharing options...
Paulie Posted March 6, 2006 Author Share Posted March 6, 2006 (edited) in the initial script, when i'd push the buttons nothing would happen and i knew that it wasn't hte game because it didn't work off the game either and to the wheather or not to have {} around hotkeys i always thought that was how it had to work any other script ideas? EDIT: Ok i just tried it w/o the {} and the "g" button worked but "h" didn't MORE HELP PLEASE Edited March 6, 2006 by Paulie Link to comment Share on other sites More sharing options...
greenmachine Posted March 6, 2006 Share Posted March 6, 2006 (edited) Make $i a global variable. Then use my suggestion to your initial script, and it will work. Edit - the reason is because of scope. When you create $i, you do it inside a function ($n works however, because you declare it at the top, outside of any function). Since $i is declared in the function, it is automatically created as a local variable. Then, when you press h (for stop), it goes to another function, out of the scope of the start function, and redeclares $i as 2. When that function ends, it returns to the start function and takes up the old scope (meaning $i is still 1). Making $i a global variable at the top of the script means that the changes made to $i in the function will affect the other functions. Edited March 6, 2006 by greenmachine Link to comment Share on other sites More sharing options...
greenmachine Posted March 6, 2006 Share Posted March 6, 2006 in the initial script, when i'd push the buttons nothing would happenand i knew that it wasn't hte game because it didn't work off the game eitherand to the wheather or not to have {} around hotkeys i always thought that was how it had to workany other script ideas?EDIT: Ok i just tried it w/o the {} and the "g" button worked but "h" didn'tMORE HELP PLEASEThe brackets in hotkeys are used to signify special keys, such as {SHIFT} or {ENTER}. If you didn't have the brackets for these keys, the hotkey would be waiting for you to press "s+h+i+f+t" (all the keys at once, I think). With single keys (letters, numbers, anything that can be typed), you don't use the brackets. 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