Sign in to follow this  
Followers 0
eliteapu

CS:S Shot Selector

2 posts in this topic

Hey guys, my code is a mess..im fairly new to autoit, and need a bit of help..

MY GOAL: to have a program that will allow for SINGLE/BURST/AUTO shot and then be able to go back to normal shot.. (oh and a GUI)

switch using hotkeys would be best

WHAT I HAVE: Burst shot/Normal shot..but they suck lol...use of hotkeys is working...The program was requested by some kid on my forum and he wanted to have mousewheel down and up to switch..so i had to use a bunch of code from these forums to get that to work..but it works...

Also I HAVE ATTEMPTED (with help from Rad) to get a 'Single Shot' working..I turns on and works nicley, just wont turn back off and wont let you switch to another firing mode...

Any help is welcomed :whistle:

MY CODE:

#include <Misc.au3>

FileInstall(@ScriptDir & "\hook.dll",@scriptdir & "\hook.dll")


Const $WH_MOUSE = 7
Const $MouseWheelUp = 0x1400 + 0x0D30
Const $MouseWheelDown = 0x1400 + 0x0D31
$singleshot = 0
Opt("MouseClickDelay", 25)
Opt("OnExitFunc", "Terminate")

$gui = GUICreate("test")

Msgbox(0, "Tool By [187ci]aPu", "KEEP hook.dll IN THE SAME FOLDER!!!")
Msgbox(0, "Tool By [187ci]aPu", "Exscape To Quit")
Msgbox(0, "Tool By [187ci]aPu", "MouseWHeelDown + MouseClick = 3 Shot Burst")
Msgbox(0, "Tool By [187ci]aPu", "MouseWheelUp + MouseClick = SingleShot")

Global $DLLinst = DllCall("kernel32.dll", "hwnd", "LoadLibrary", "str", ".\hook.dll")
Global $mouseHOOKproc = DllCall("kernel32.dll", "hwnd", "GetProcAddress", "hwnd", $DLLinst[0], "str", "MouseProc")

Global $hhMouse = DllCall("user32.dll", "hwnd", "SetWindowsHookEx", "int", $WH_MOUSE, "hwnd", $mouseHOOKproc[0], "hwnd", $DLLinst[0], "int", 0)

DllCall(".\hook.dll", "int", "SetValuesMouse", "hwnd", $gui, "hwnd", $hhMouse[0])

GUIRegisterMsg($MouseWheelUp, "myfunc")
GUIRegisterMsg($MouseWheelDown, "myfunc")


Global $clickTimes = 1
Global $dll = DllOpen("user32.dll")

HotKeySet("{MouseWheelUp}", "Single")
HotKeySet("{MouseWheelDown}", "Burst")
HotKeySet("{NUMPAD1}", "singleshot")
HotKeySet("{NUMPAD2}", "singleshotoff")
HotKeySet("{ESC}", "Terminate")

While 1
    If _IsPressed('01', $dll) Then
        if $singleshot = 1 Then
            MouseUp("Left")
        Else
            While _IsPressed('01', $dll)
                Sleep(5)
            WEnd
           
            MouseClick("left", MouseGetPos(0), MouseGetPos(1), $clickTimes, 0)
        EndIf
    EndIf
    Sleep(20)
WEnd


Func MyFunc($hWndGUI, $MsgID, $WParam, $LParam)
        Select
            case $msgid=$MouseWheelUp
                $clickTimes = 0
                case $msgid=$MouseWheelDown
                $clickTimes = 3
            EndSelect
EndFunc ;==>MyFunc

Func Single()
    $clickTimes = 0
EndFunc

Func Burst()
    $clickTimes = 3
EndFunc

Func singleshot()
    If $singleshot = 1 then 
        $singleshot = 0
    Else
        $singleshot = 1
    EndIf
EndFunc

Func Terminate()
    DllCall("user32.dll", "int", "UnhookWindowsHookEx", "hwnd", $hhMouse[0])
    DllCall("kernel32.dll", "int", "FreeLibrary", "hwnd", $DLLinst[0])
    DllClose($dll)
    filedelete(@scriptdir & "\hook.dll")
    Exit
EndFunc

Share this post


Link to post
Share on other sites



*Bump *Bump

Can anybody help me at all? PLEASE?

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