Documentos de Académico
Documentos de Profesional
Documentos de Cultura
AutoHotkey
Create Account
help, how to make a timer w/ addtime per click in an assigned hotkey for a
coinslot machine
Started by jxclarynx , May 09 2015 09:30 AM
help" i want to make a timer with an assigned key or hotkey to add time
example: countdown 30min to lock mouse and keyboard i want a program or a script that when i click an assigned key
e.g{ F12} is my assigned key when i click F12 it will automatically add time from 30min to 60min to 90min per click. countdown to lock keyboard and mouse
is there some one here that can do this.thanks
hello
Can you give an attempt at code? Is this kind of what you're looking to do in a countdown?
F12::
var+=1800
countDown:
var--
return
no i want something like this it locks inputs,i want to insert this a timer can u help me connect this 2 script my problem is the locking script is only quit iwant
to change it to a hotkey
thanks for your reply.
;Timer 1
#SingleInstance,Force
#Persistent
#NoTrayIcon
CustomColor = EEAA99
SomeDate += %CountDown%,S
SetTimer NextSecond, 1000
Return
Nextsecond:
QUIT_HOTKEY=^Esc
; ______________________________________________________________________________
;
#NoEnv ; Avoids checking empty variables to see if they are environment variables
Menu,Tray,Icon,shell32.dll,48 ; systray icon is a padlock
; install the quit hotkey
Hotkey,%QUIT_HOTKEY%,ExitSub
; ______________________________________________________________________________
;
ExitSub:
ExitApp ; The only way for an OnExit script to terminate itself is to use ExitApp in the OnExit subroutine.
; ******************************************************************************
; Function:
; but Control, Shift, Alt (thus a hotkey based on these keys can be used to unblock the keyboard)
Sign In
Create Account
; Param
Sign In
Create Account
BlockKeyboardInputs(state = "On")
{
static keys
keys=Space,Enter,Tab,Esc,BackSpace,Del,Ins,Home,End,PgDn,PgUp,Up,Down,Left,Right,CtrlBreak,ScrollLock,PrintScreen,CapsLock
,Pause,AppsKey,LWin,LWin,NumLock,Numpad0,Numpad1,Numpad2,Numpad3,Numpad4,Numpad5,Numpad6,Numpad7,Numpad8,Numpad9,NumpadDot
,NumpadDiv,NumpadMult,NumpadAdd,NumpadSub,NumpadEnter,NumpadIns,NumpadEnd,NumpadDown,NumpadPgDn,NumpadLeft,NumpadClear
,NumpadRight,NumpadHome,NumpadUp,NumpadPgUp,NumpadDel,Media_Next,Media_Play_Pause,Media_Prev,Media_Stop,Volume_Down,Volume_Up
,Volume_Mute,Browser_Back,Browser_Favorites,Browser_Home,Browser_Refresh,Browser_Search,Browser_Stop,Launch_App1,Launch_App2
,Launch_Mail,Launch_Media,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,F13,F14,F15,F16,F17,F18,F19,F20,F21,F22
,1,2,3,4,5,6,7,8,9,0,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
,,&,,",',(,-,,_,,,),=,$,,,*,~,#,{,[,|,``,\,^,@,],},;,:,!,?,.,/,,<,>,vkBC
Loop,Parse,keys, `,
; ******************************************************************************
; Function:
; Param
BlockMouseClicks(state = "On")
{
static keys="RButton,LButton,MButton,WheelUp,WheelDown"
Loop,Parse,keys, `,
iwant the timer to execute mouse and keyboard lock when the countdown ends and assigned a hotkey e.g {F12} when pressed
that will automatically add time from 30min to 60min per press
This code is untested and may accidentally disable your computer. You should be able to regain control going through Ctrl+Alt+Del, but that may just
leave you with an option of restarting your computer.
#SingleInstance,Force
#Persistent
#NoTrayIcon
CustomColor = EEAA99
Sign In
Create Account
SomeDate += %CountDown%,S
SetTimer NextSecond, 1000
Return
Nextsecond:
BlockKeyboardInputs("On")
BlockMouseClicks("On")
BlockInput MouseMove
}
Return
F12::SomeDate += 1800, seconds ; I guess you could use SomeDate += 30, minutes
^Esc::
BlockKeyboardInputs("Off")
BlockMouseClicks("Off")
BlockInput MouseMoveOff
return
; ******************************************************************************
; Function:
; but Control, Shift, Alt (thus a hotkey based on these keys can be used to unblock the keyboard)
;
; Param
BlockKeyboardInputs(state = "On")
{
static keys
keys=Space,Enter,Tab,Esc,BackSpace,Del,Ins,Home,End,PgDn,PgUp,Up,Down,Left,Right,CtrlBreak,ScrollLock,PrintScreen,CapsLock
,Pause,AppsKey,LWin,LWin,NumLock,Numpad0,Numpad1,Numpad2,Numpad3,Numpad4,Numpad5,Numpad6,Numpad7,Numpad8,Numpad9,NumpadDot
,NumpadDiv,NumpadMult,NumpadAdd,NumpadSub,NumpadEnter,NumpadIns,NumpadEnd,NumpadDown,NumpadPgDn,NumpadLeft,NumpadClear
,NumpadRight,NumpadHome,NumpadUp,NumpadPgUp,NumpadDel,Media_Next,Media_Play_Pause,Media_Prev,Media_Stop,Volume_Down,Volume_Up
,Volume_Mute,Browser_Back,Browser_Favorites,Browser_Home,Browser_Refresh,Browser_Search,Browser_Stop,Launch_App1,Launch_App2
,Launch_Mail,Launch_Media,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,F13,F14,F15,F16,F17,F18,F19,F20,F21,F22
,1,2,3,4,5,6,7,8,9,0,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
,,&,,",',(,-,,_,,,),=,$,,,*,~,#,{,[,|,``,\,^,@,],},;,:,!,?,.,/,,<,>,vkBC
Loop,Parse,keys, `,
; ******************************************************************************
; Function:
; Param
BlockMouseClicks(state = "On")
{
static keys="RButton,LButton,MButton,WheelUp,WheelDown"
Loop,Parse,keys, `,
Sign In
Create Account
thanks for the reply there some problem coz when i run the script and press f12 it adds time 30min to 60min but when i press again the f12 comes back to
30min iwant some thing like adding time like pressing the hotkey f12 it adds 30min to 60min to 90min to 120min so on .timer countdown to lock inputs is
there a way to do it??thank you again
theres another problem coz when the countdown ends it doesnt lock inputs thank you again for your concern.hoping for your reply to solve my problem.