Jump to content

little help


fangx
 Share

Recommended Posts

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

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

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 by dandymcgee

- Dan [Website]

Link to comment
Share on other sites

>.< 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 too

HotKeySet("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
EndFunc
same thing
Link to comment
Share on other sites

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 by fangx
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...