Jump to content

Problem with hotkey


Sobiech
 Share

Recommended Posts

Hi all :D

just look and say why SpinStop doesnt work when i push "end"? other hotkeys are working very good :D

;----------------------------------------VARS START----------------------------
   ;Hotkeys
   hotkeyset("{insert}", "buff")
   hotkeyset("{Home}", "SpinStart")
   hotkeyset("{End}", "SpinStop")
;----------------------------------------VARS END------------------------------

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd

func spinstart()
   Send("{ENTER}" & "AutoSpin v0.1" & "{ENTER}")
   Send(GUICtrlRead($input1))
   Send("{NUMLOCK ON}")
   Send("{LSHIFT DOWN}")
   MouseDown("left")
   Send("{NUMLOCK OFF}")
   Send("{alt up}")
endfunc

func spinstop()
   Send("{ENTER}" & "SpinStop v0.1" & "{ENTER}")
   Send("{NUMLOCK OFF}")
   MouseUp("left")
   Send("{LSHIFT Up}")
   Send("{NUMLOCK OFF}")
   Send("{alt up}")
endfunc

func buff()
   Send("{ENTER}" & "Buffing" & "{ENTER}")
   Send(GUICtrlRead($Input2))
   MouseClick("right")
   Sleep(750)
   Send(GUICtrlRead($Input5))
   Sleep(500)
   Send(GUICtrlRead($Input3))
   MouseClick("right")
   Sleep(500)
   Send(GUICtrlRead($Input4))
   MouseClick("right")
   Sleep(750)
   Send(GUICtrlRead($Input5))
   Sleep(750)
   Send(GUICtrlRead($input1))
endfunc

This world is crazy

Link to comment
Share on other sites

Instrument your functions something like this to see if it calls and exits the functions normally:

HotKeySet("{insert}", "buff")
HotKeySet("{Home}", "SpinStart")
HotKeySet("{End}", "SpinStop")
HotKeySet("{ESC}", "_Quit")

While 1
    Sleep(10)
WEnd

Func spinstart()
    ConsoleWrite("Debug: Enter spinstart()" & @LF)

    ; ...the rest of your function

    ConsoleWrite("Debug: Exit spinstart()" & @LF)
EndFunc   ;==>spinstart

Func spinstop()
    ConsoleWrite("Debug: Enter spinstop()" & @LF)

    ; ...the rest of your function

    ConsoleWrite("Debug: Exit spinstop()" & @LF)
EndFunc   ;==>spinstop

Func buff()
    ConsoleWrite("Debug: Enter buff()" & @LF)

    ; ...the rest of your function

    ConsoleWrite("Debug: Exit buff()" & @LF)
EndFunc   ;==>buff

Func _Quit()
    Exit
EndFunc

:D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

HotKeySet("{insert}", "buff")
HotKeySet("{Home}", "SpinStart")
HotKeySet("{End}", "SpinStop")
HotKeySet("{ESC}", "_Quit")


While 1
    Sleep(10)
WEnd

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd


Func spinstart()
    ConsoleWrite("Debug: Enter spinstart()" & @LF)

   Send("{ENTER}" & "AutoSpin v0.1" & "{ENTER}")
   Send(GUICtrlRead($input1))
   Send("{NUMLOCK ON}")
   Send("{LSHIFT DOWN}")
   MouseDown("left")
   Send("{NUMLOCK OFF}")
   Send("{alt up}")

    ConsoleWrite("Debug: Exit spinstart()" & @LF)
EndFunc   ;==>spinstart

Func spinstop()
    ConsoleWrite("Debug: Enter spinstop()" & @LF)

   Send("{ENTER}" & "SpinStop v0.1" & "{ENTER}")
   Send("{NUMLOCK OFF}")
   MouseUp("left")
   Send("{LSHIFT Up}")
   Send("{NUMLOCK OFF}")
   Send("{alt up}")

    ConsoleWrite("Debug: Exit spinstop()" & @LF)
EndFunc   ;==>spinstop

Func buff()
    ConsoleWrite("Debug: Enter buff()" & @LF)

   Send("{ENTER}" & "Buffing" & "{ENTER}")
   Send(GUICtrlRead($Input2))
   MouseClick("right")
   Sleep(750)
   Send(GUICtrlRead($Input5))
   Sleep(500)
   Send(GUICtrlRead($Input3))
   MouseClick("right")
   Sleep(500)
   Send(GUICtrlRead($Input4))
   MouseClick("right")
   Sleep(750)
   Send(GUICtrlRead($Input5))
   Sleep(750)
   Send(GUICtrlRead($input1))

    ConsoleWrite("Debug: Exit buff()" & @LF)
EndFunc   ;==>buff

Func _Quit()
    Exit
EndFunc

K but "spinstart" doesnt work :D

Hmm maybe because "spinstop" hold shift and "End" key doesnt work (shift+end)

Ah and small question :D

How to set hotkey for example "Shift + End" ?

Edit: :D if i dont run "spinstart" the "spinstop" doesnt work too

This world is crazy

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