1

Тема: AHK: Off и On скрипта по кнопке

+ открыть спойлер

#NoEnv
SendMode Input

_auto := true ;Toggle for the anti-recoil being on or off. default is on

~LButton::autofire() ; When the LButton is pressed run the autofire() function
+LButton::_auto := ! _auto ;Shift + LButton used to toggle the anti-recoil on and off
F1::ExitApp ; F1 used to exit the ahk script file

; autofire() function, name is misleading could easily be antiRecoil()
autofire()
{
  global _auto
  if _auto ; if _auto == true. i.e. is anti-recoil on?
  { ; anti-recoil on?  If yes do this
    Loop ; Continuously loop until a 'break' command
    {
      if GetKeyState("LButton", "P") ; If LButton is pressed
      { ; LButton pressed? If yes do this
        Sleep 85 ; sleep for 85 milliseconds
        mouseXY(0, 6) ;Call the mouseXY() function which moves the mouse the specified distance. mouseXY( X, Y,)
        Sleep 45 ; sleep for 45milliseconds
      }
      else ;LButton pressed? If no do this, i.e. exit the loop
        break ;will stop the loop
    } ;; loop
  } ;; if
} ;; autofire() ; anti-recoil on? If no do nothing

mouseXY(x,y)
{
  DllCall("mouse_event",uint,1,int,x,int,y,uint,0,int,0) ; moves the mouse could easily be the built in autohotkey MouseMove, X, Y
}



Подскажите. Вот на F1 скрипт выключается полностью и закрывается. Как сделать, чтобы на F1 он просто отключался и на F2 включался? То есть : F1- Off, F2-On. Спасибо заранее!

2

Re: AHK: Off и On скрипта по кнопке

ДаНет, ознакомьтесь с этой темой, отредактируйте пост.

Разработка AHK-скриптов:
e-mail dfiveg@mail.ru
Telegram jollycoder

3 (изменено: Zmey25, 2014-03-06 01:52:39)

Re: AHK: Off и On скрипта по кнопке

pause::pause

На кнопку pause, соответственно