Page 1 of 1

New, can't seem to get this simple script to work.

Posted: 02 Feb 2016, 07:08
by Stormakov
So, basically what I'm trying to do is simulate a left mouse button click, a short delay (300ms or so) and then a keyboard button press input (in this case 1)

I've tried a whole whack of different variations on this I can can't seem to get any to work, any help would be awesome - thank you.


Variations I tried were, there were a bunch of others too just to give you an idea.

#IfWinActive, ESO
1::
BlockInput On
SendInput {Click}{1}
BlockInput Off
Return

#IfWinActive, ESO
1::
BlockInput On
Click
Delay 300
SendInput {1}
BlockInput Off
Return

#IfWinActive, ESO
1::
BlockInput On
sendinput {LButton down}
KeyWait, LButton
sendinput {LButton up}
Sleep 300
SendInput {1}
BlockInput Off
Return

Re: New, can't seem to get this simple script to work.

Posted: 02 Feb 2016, 07:30
by boiler
Remove the braces around the 1.

Re: New, can't seem to get this simple script to work.

Posted: 02 Feb 2016, 07:58
by Stormakov
That doesn't seem to work either.

The problem is I only seem to be able to either get the mouse click OR the button press to work, I can't seem to get them to both happen one after the other.

Re: New, can't seem to get this simple script to work.

Posted: 02 Feb 2016, 08:59
by IRBaboon

Code: Select all

!1::
SendInput {LButton}
Sleep 300
SendInput {1}
Return
i changed ^1 to !1 (altkey+1) cause ^1 is blocked from another hotkey for me

Re: New, can't seem to get this simple script to work.

Posted: 02 Feb 2016, 09:11
by Stormakov
Ya, I can't use the alt key because it activates something else (just the way the game is designed)

And just taking out the alt key indicator (!) and just using 1 has the same problem I was having before, where the mouse click will go off but the button press doesn't happen.

Re: New, can't seem to get this simple script to work.

Posted: 02 Feb 2016, 09:48
by boiler
The issue when you were using just 1 as the hotkey may be fixed by changing your hotkey definition to $1:: to keep the hotkey routine from calling itself.

Re: New, can't seem to get this simple script to work.

Posted: 02 Feb 2016, 13:03
by wizardzedd
boiler wrote:The issue when you were using just 1 as the hotkey may be fixed by changing your hotkey definition to $1:: to keep the hotkey routine from calling itself.
Boiler is right. Currently the line sendinput {1} is going to trigger the hotkey itself. This should do the trick:

Code: Select all

$1::
BlockInput On
sendinput {LButton}
Sleep 300 
SendInput {1}
BlockInput Off
Return

Re: New, can't seem to get this simple script to work.

Posted: 02 Feb 2016, 18:59
by Stormakov
Thanks guys, putting the $ in front of the 1 made it work out beautifully - appreciate the help, you rock.