wait=0
LButton::
if(wait=0)
{
wait=1
SendInput,x
sleep,12000
wait=0
}
else
{
SendInput,y
}
return
why gives the mousebutton only a x and not a y by state "if wait=1" or else...
plse help
little if problem
Re: little if problem
Bc it will never become 1?
BTW, use -tags to prevent your request is getting ignored by your supporters. ![Thumbup :thumbup:](./images/smilies/icon_thumbup.gif)
Code: Select all
.
.
.
wait=1 ; OK lets wait ...
SendInput,x
sleep,12000
wait=0 ; OK, let's act like an American president and reverse the decision a few moments later!
}
.
.
.
Code: Select all
![Thumbup :thumbup:](./images/smilies/icon_thumbup.gif)
Re: little if problem
thx for you answear
hmm...
wait=0
between that the mouse should have an alternative clickoption
after 12 sec it switched back :
wait=1 (first clicloption)
in the time room between wait0-1 is the mousebutton input blocked ? till this script part ended ?
for example i can make several clicks or pressed and every moment it solves the definition of lbutton::... again ?
So the second click have to reconigzes the state wait=0 because the click before changed it for allready 12sec ???
hmm...
wait=0
between that the mouse should have an alternative clickoption
after 12 sec it switched back :
wait=1 (first clicloption)
in the time room between wait0-1 is the mousebutton input blocked ? till this script part ended ?
for example i can make several clicks or pressed and every moment it solves the definition of lbutton::... again ?
So the second click have to reconigzes the state wait=0 because the click before changed it for allready 12sec ???
Re: little if problem
Try this:
Code: Select all
#NoEnv
#SingleInstance Force
wait := 0
LButton::
if (wait = 0)
{
wait := 1
SendInput, x
SetTimer, waitreset, -12000
}
else
{
SendInput, y
}
return
waitreset:
wait := 0
return
Re: little if problem
it works fine
and its written really simple and system friendly
greatness many thx
)))
and its written really simple and system friendly
greatness many thx
![Smile :)](./images/smilies/icon_e_smile.gif)
Re: little if problem
Alternatively:
references:
Expressions
Short-circuit Boolean Evaluation
Ternary operator
A_Now
Code: Select all
LButton::SendInput % (((var - A_Now < -12) and (var:=A_Now)) ? false : true) ? "x" : "y"
Expressions
Short-circuit Boolean Evaluation
Ternary operator
A_Now
Re: little if problem
By default, a given hotkey or hotstring subroutine cannot be run a second time if it is already running. Use #MaxThreadsPerHotkey to change this behavior.Kobold wrote:
in the time room between wait0-1 is the mousebutton input blocked ? till this script part ended ?
for example i can make several clicks or pressed and every moment it solves the definition of lbutton::... again ?
So the second click have to reconigzes the state wait=0 because the click before changed it for allready 12sec ???
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], Tech Stuff and 380 guests