hi
how i can prevent sending 5 button again when i push w for 7.5 sec?
my script send 22t5ssee when i push w then wait half sec and send g, and after 7.5 sec when i push w it push 5 again, and its working fine
what i want is how i can prevent send 5 when i pushing w after the fist push for 7.5 sec
only the 5 button what i wanna prevent not the others when i push w
i want the timer start again like now when i push w
i push w i want this:
------------------------------------
timer start
------------------------------------
send 22t5ssee
sleep 500
send g
now this time period when i push w i wanna send only this:
------------------------------------
the timer start again (its working fine)
------------------------------------
send 22tssee
sleep 500
send g
------------------------------------
this is when 7.5 sec expire
------------------------------------
send w
this is my code and ty
*$w::
Settimer, Send_5, 7500
send 22t5ssee
sleep 500
send g
return
Send_5:
sendinput 5
Settimer, Send_5, off
return
ask
-
- Posts: 69
- Joined: 05 Sep 2016, 12:52
- eventhorizon
- Posts: 158
- Joined: 27 Oct 2016, 14:22
Re: ask
The real question is how do YOU know when you want to send the 5 again and when not to send it. That's the knowledge you have to teach your script.
A computer lets you make more mistakes faster than any invention in human history – with the possible exceptions of handguns and tequila.
-
- Posts: 69
- Joined: 05 Sep 2016, 12:52
Re: ask
i want send 22t5ssee when i push w and if the timer is running when i push w again (no matter how many times) i only want to send 22tssee
if the timer ends (7.5 sec) and i push w i wanna send 22t5ssee again and start the timer again
i think its clear.
if the timer ends (7.5 sec) and i push w i wanna send 22t5ssee again and start the timer again
i think its clear.
- eventhorizon
- Posts: 158
- Joined: 27 Oct 2016, 14:22
Re: ask
i want send 22t5ssee when i push w and if the timer is running when i push w again (no matter how many times) i only want to send 22tssee
if the timer ends (7.5 sec) and i push w i wanna send 22t5ssee again and start the timer again
i think its clear.
- i want send 22t5ssee when i push w
- if the timer is running when i push w again (no matter how many times) i only want to send 22tssee
- if the timer ends (7.5 sec) and i push w i wanna send 22t5ssee again and start the timer again
This code is untested,
Code: Select all
#NoEnv
#SingleInstance, Force
#MaxThreads, 100
#MaxThreadsPerHotkey, 2
#Persistent
SetBatchLines, -1
DetectHiddenWindows, On
CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
CoordMode, Tooltip, Screen
SetTitleMatchMode, 2
SetTitleMatchMode, slow
SetKeyDelay, 100,100
SetMouseDelay 10
SetDefaultMouseSpeed, 0
SendMode Event
#InstallKeybdHook
#InstallMouseHook
#UseHook, On
t_mr := A_Tickcount - 1
return
w::
If (A_Tickcount > t_mr)
{ send, 22t5ssee
t_mr := (A_Tickcount + 7500)
}
else
{ send 22tssee
}
return
A computer lets you make more mistakes faster than any invention in human history – with the possible exceptions of handguns and tequila.
-
- Posts: 69
- Joined: 05 Sep 2016, 12:52
Re: ask
its seems good, but it have one problem
this one not start the timer again when i push w (in this if i push w every 1.5 sec then after 7.5 sec the next one will send 22t5ssee not 22tssee
i dont want that
this one not start the timer again when i push w (in this if i push w every 1.5 sec then after 7.5 sec the next one will send 22t5ssee not 22tssee
i dont want that
- eventhorizon
- Posts: 158
- Joined: 27 Oct 2016, 14:22
Re: ask
this is what you said
--PseudoCode--
step 1. use the w key to start the sequence and the timer
step 2 if the timer has timed out send the 22t5ssee
and reset the timer for 7-1/2 seconds
and exit the routine
otherwise...
step 3. while the timer is still running
send the 22tssee sequence
and exit the routine
if this sequence is not correct please correct it
this is what the code above looks like now
if this is wrong please correct the pseudocodewant send 22t5ssee when i push w and if the timer is running when i push w again (no matter how many times) i only want to send 22tssee
if the timer ends (7.5 sec) and i push w i wanna send 22t5ssee again and start the timer again
i think its clear. [/quote
this is what i understoodi want send 22t5ssee when i push w
if the timer is running when i push w again (no matter how many times) i only want to send 22tssee
if the timer ends (7.5 sec) and i push w i wanna send 22t5ssee again and start the timer again
--PseudoCode--
step 1. use the w key to start the sequence and the timer
step 2 if the timer has timed out send the 22t5ssee
and reset the timer for 7-1/2 seconds
and exit the routine
otherwise...
step 3. while the timer is still running
send the 22tssee sequence
and exit the routine
if this sequence is not correct please correct it
this is what the code above looks like now
Code: Select all
t_mr := (A_Tickcount - 1) ;<- make sure timer has elapsed to get a clean start
return
w:: ;step 1. hotkey to start the timer and send the first series
If (A_Tickcount > t_mr) ;<- if the timer has timed out
{ send, 22t5ssee ;<- then send the sequence with the 5
t_mr := (A_Tickcount + 7500) ;<- and restart the timer
}
else ;<- otherwise the timer is still running so
{ send 22tssee ;<- just send the sequence without the 5
}
return ;<- and exit the routine
A computer lets you make more mistakes faster than any invention in human history – with the possible exceptions of handguns and tequila.
Who is online
Users browsing this forum: Xeokis and 90 guests