Jump to content

Recommended Posts

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
  • Moderators
Posted

Cool, let us know how that turns out.

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.

  • Moderators
Posted

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

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.

  • Moderators
Posted

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.

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.

Posted

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
  • Moderators
Posted

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

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.

  • Moderators
Posted

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.

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.

  • Moderators
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

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.

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
  • Moderators
Posted

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())

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.

  • Moderators
Posted

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?

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.

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

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
  • Recently Browsing   0 members

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