Sign in to follow this  
Followers 0
X-sploiT

help with auto pistol

17 posts in this topic

#1 ·  Posted (edited)

This code does not work as planned,when you clikc mouse one it sends the mouse click on release..how can i make it so it send mouse clicks all the time hile mouse1 is down

#include <misc.au3>
HotKeySet("{INSERT}","On")
HotKeySet("{F12}","WORK")

While 1
sleep(5)
wend
Func WORK()
send("{F12}")
EndFunc
Func On()
while 1 
if _ispressed("01") then
    MouseClick("left")
send("{F12}")
while _ispressed("01")
MouseDown("left")
send("{F12}")
wend
EndIf
Wend 
EndFunc
Edited by X-sploiT

Share this post


Link to post
Share on other sites



Cool, let us know how that turns out.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

lol i edited it

Share this post


Link to post
Share on other sites

lol i edited it

:whistle:

I am really too lazy tonight to work out what you're really trying to do.

Here's how I understand it,

While your holding down F12 and MouseClick you want to MouseClick... You could do this with HotKeySet() but I'm too lazy as I said:

Opt('MouseClickDelay', 1)

While 1
    While  _IsPressed('7b')
        While _IsPressed('01')
            MouseClick('left')
            Sleep(10)
        WEnd
        Sleep(10)
    WEnd
    Sleep(10)
WEnd

Func _IsPressed($v_R, $v_dll = 'user32.dll')
    $v_R = DllCall($v_dll, 'int', 'GetAsyncKeyState', 'int', '0x' & $v_R)
    Return (Not @error And BitAND($v_R[0], 0x8000) = 0x8000) * 1
EndFunc   ;==>_IsPressed

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Opt('MouseClickDelay', 1) prolly just need that

Share this post


Link to post
Share on other sites

Opt('MouseClickDelay', 1) prolly just need that

actually if that's your script, you'll never leave the work() function when you press F12, it will just keep going back there over and over.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

well it still clicks on release

HotKeySet("{INSERT}","On")
HotKeySet("{F12}","Ex")
Opt('MouseClickDelay', 1)
while 1
sleep(1)
WEnd
Func On()
While 1
    if _IsPressed('01') Then
        While _IsPressed('01')
            MouseClick('left')
            Sleep(10)
        WEnd
        EndIf
        Sleep(10)
WEnd
EndFunc

Func Ex()
Exit
EndFunc

Func _IsPressed($v_R, $v_dll = 'user32.dll')
    $v_R = DllCall($v_dll, 'int', 'GetAsyncKeyState', 'int', '0x' & $v_R)
    Return (Not @error And BitAND($v_R[0], 0x8000) = 0x8000) * 1
EndFunc  ;==>_IsPressed

Share this post


Link to post
Share on other sites

This clicks only while I have the left mouse button down, I added an exitloop when I let up on it

HotKeySet("{INSERT}","On")
HotKeySet("{F12}","Ex")
Opt('MouseClickDelay', 1)
While 1
    Sleep(1000)
WEnd
Func On()
    While 1
        If _IsPressed('01') Then
            While _IsPressed('01')
                MouseClick('right');Switch back to left, switched to right for testing
                Sleep(10)
            WEnd
            ExitLoop
        EndIf
        Sleep(10)
    WEnd
EndFunc

Func Ex()
    Exit
EndFunc

Func _IsPressed($v_R, $v_dll = 'user32.dll')
    $v_R = DllCall($v_dll, 'int', 'GetAsyncKeyState', 'int', '0x' & $v_R)
    Return (Not @error And BitAND($v_R[0], 0x8000) = 0x8000) * 1
EndFunc   ;==>_IsPressed


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Nope doesnt work

clikc mouse1 shot fired release mouse1 shot fired

i need click and hold down mouse1 shots fired

Share this post


Link to post
Share on other sites

Nope doesnt work

clikc mouse1 shot fired release mouse1 shot fired

i need click and hold down mouse1 shots fired

Ugh, slow down your MouseClickDelay (the 1 setting, raise that) until you get the right tempo, it's probably sending more clicks than what you think.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

i dont think thats it

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

i dont think thats it

*** edit rude comment ***

Edit:

Why don't you put step by step what it is you are trying to accomplish.

Like:

Step 1: When F12 is pressed ... Do

Step 2: When done doing etc...

etc...

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Sorry..im trying to make an auto pisTol program for cs so while you press mouse1 it press mouse1 again

i've seen it been done by BoB

Perhaps its my mouse andf i test it with enter and it worked

Edited by X-sploiT

Share this post


Link to post
Share on other sites

Sorry..im trying to make an auto pisyol program for cs so while you press mouse1 it press mouse1 again

Put it like this:
HotKeySet("{INSERT}","On")
HotKeySet("{F12}","Ex")
Opt('MouseClickDelay', 1)
While 1
    Sleep(1000)
WEnd
Func On()
    While 1
        If _IsPressed('01') Then
            While _IsPressed('01')
                Sleep(200)
                MouseClick('right');Switch back to left, switched to right for testing
            WEnd
            ExitLoop
        EndIf
        Sleep(10)
    WEnd
EndFunc

Func Ex()
    Exit
EndFunc

Func _IsPressed($v_R, $v_dll = 'user32.dll')
    $v_R = DllCall($v_dll, 'int', 'GetAsyncKeyState', 'int', '0x' & $v_R)
    Return (Not @error And BitAND($v_R[0], 0x8000) = 0x8000) * 1
EndFunc   ;==>_IsPressed
Notice where I put the Sleep(200) (before the next mouseclick())

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Perhaps its my mouse andf i test it with enter and it worked

Share this post


Link to post
Share on other sites

Perhaps its my mouse andf i test it with enter and it worked

Can I ask a really silly question... what is your primary mouse button, the left one or the right one?

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

left one is my primary for shooting

for sum reason enter works

you have to bind a key like enter to +attack

HotKeySet("{INSERT}","On")
HotKeySet("{F12}","Ex")
Opt('MouseClickDelay', 1)
While 1
    Sleep(1000)
WEnd
Func On()
    While 1
        If _IsPressed('0D') Then
            While _IsPressed('0D')
            Send("{enter}")
            WEnd
            EndIf
        Sleep(10)
    WEnd
EndFunc

Func Ex()
    Exit
EndFunc

Func _IsPressed($v_R, $v_dll = 'user32.dll')
    $v_R = DllCall($v_dll, 'int', 'GetAsyncKeyState', 'int', '0x' & $v_R)
    Return (Not @error And BitAND($v_R[0], 0x8000) = 0x8000) * 1
EndFunc ;==>_IsPressed
Edited by X-sploiT

Share this post


Link to post
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
Sign in to follow this  
Followers 0