fangx Posted December 25, 2007 Share Posted December 25, 2007 k, i want to make a simple script what i want it to do is when i press the number 2 key it will send a few mouse clicks and stop, then when i press the 2 button again it will start sending the same mouse click again. messing around not really knowing what i was doing i came up with this: im not sure how to set it to repeat when i press the button again either=( any help would be great. Your friendly noob fang_x HotkeySet("2","start") Func "start"() Mouseclick("right") Mouseclick("left") Mouseclick("left") Mouseclick("left") Mouseclick("left") Mouseclick("left") Mouseclick("left") Mouseclick("left") Mouseclick("left") Mouseclick("left") Mouseclick("left") Mouseclick("left") Mouseclick("left") Mouseclick("left") Mouseclick("left") Mouseclick("left") EndFunc Link to comment Share on other sites More sharing options...
Fossil Rock Posted December 25, 2007 Share Posted December 25, 2007 MouseClick("left", x, y, 15) Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
dandymcgee Posted December 25, 2007 Share Posted December 25, 2007 (edited) change Func "start"() to Func start() Goodluck and welcome to the forums! Edited December 25, 2007 by dandymcgee - Dan [Website] Link to comment Share on other sites More sharing options...
fangx Posted December 25, 2007 Author Share Posted December 25, 2007 okay let me explain a little of what i want to do with this script, i want it to fire a pistol within a game, 2 is the key to select the weapon. i want the script to start when i press 2 within the game, 2 will bring out the gun and also start the script. the first of the mouse click is a right click witch brings up the scope view then each left click after will fire it 15 times witch is the guns clip size. then the script will pause or stop untill i press 2 again then the script will run again. the questions i have are this, how can i get auto it working inside a full screen game and how can i get it to repeat Link to comment Share on other sites More sharing options...
dandymcgee Posted December 25, 2007 Share Posted December 25, 2007 (edited) This will wait for 2 to be pressed, and will start the function every time it is. Feel free to post if you need something else or don't understand something. HotkeySet("2", "start") ;wait for 2 to be pressed ;------------------------ While 1 Sleep(100) WEnd Func start() HotKeySet("2") Send("2") ;hotkeyset interrupts key presses so this is necessary HotkeySet("2", "start") Mouseclick("right") $i = 0 ;left click 15 times ;------------------- Do Mouseclick("left") $i = $i + 1 Until $i = 15 EndFunc EDIT: Thanks gamerman for pointing out that recursion error... it's fixed. Edited December 25, 2007 by dandymcgee - Dan [Website] Link to comment Share on other sites More sharing options...
gamerman2360 Posted December 25, 2007 Share Posted December 25, 2007 >.< dang, I was too late... still tho, the Send() will activate the hotkey. Should get some kind of autoit recursion(sp) error I made something like that tooHotKeySet("2", "HotKeyFunc") While 1 Sleep(5000) WEnd Func HotKeyFunc() ; send the 2 HotKeySet(@HotKeyPressed) Send(@HotKeyPressed) HotKeySet(@HotKeyPressed, "HotKeyFunc") Sleep(Random(900, 1100, 1));time to pull the gun out? MouseClick("right") For $i = 1 To 15 Sleep(Random(450, 750, 1));shot interval MouseClick("left") Next EndFuncsame thing Link to comment Share on other sites More sharing options...
fangx Posted December 25, 2007 Author Share Posted December 25, 2007 (edited) okay im still having some problems the 2 key works but only outside of the game, not within. the script is also repeating, possibly due to the send("2") ? if i start it outside of the game then go inside of the game it will continue to press the left clicks and right click non stop. Edited December 25, 2007 by fangx Link to comment Share on other sites More sharing options...
fangx Posted December 25, 2007 Author Share Posted December 25, 2007 okay, the scripts seem to be working the only problem left is it not being able to start the script ingame when i press 2. it still has to be started outside the game. 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