Jump to content


Run 2 seperate Triggers under 1 script


  • Please log in to reply
5 replies to this topic

#1 Guests

  • Guests

Posted 20 July 2012 - 12:34 AM

Hello, I am trying to figure out how I would go about creating a script that will perform 2 different functions using 2 different hotkeys in one script. I thought using the IF function would work but im not sure if i am using it correctly. Here is what i got so far:

#MaxThreadsPerHotkey 2
#SingleInstance force

if 5:: 
{
BlockInput, On
Send, {SPACE}
Send, {I}
Send, {ALTDOWN}
MouseClick, right, 996, 539, , 0
Send, {ALTUP}
Send, {SPACE}
BlockInput, Off
return
}

if +MButton::
{
BlockInput, On
send, {SHIFTDOWN}
MouseClick, left, 1192,1034
send, {SHIFTUP}


Send, {SPACE}
Send, {I}


MouseClick, right, 1209, 452, , 0
Send, {ALTDOWN}
MouseClick, right, 1210, 489, , 0
send, {ALTUP}


;MouseClick, right, 1438, 826


MouseClick, right, 993, 489, , 0


MouseClick, right, 991, 454, , 0


Send, {ALTDOWN}
MouseClick, right, 1061, 465, , 0
send, {ALTUP}


MouseClick, right, 1170, 470, , 0


;MouseClick, right, 1621, 828

MouseClick, right, 1098, 467, , 0


MouseClick, right, 1132, 467, , 0


MouseClick, right, 1244, 467, , 0


;MouseClick, right, 1822, 832


MouseClick, right, 1027, 469, , 0

; Reset Position
Send, {SPACE}
BlockInput, Off
return
}

So pretty much if i pressed the numeric key "5" it would perform the first few lines and if i pressed Shift + middle mouse it would perform the rest.

Thanks for your help

#2 Leef_me

Leef_me
  • Moderators
  • 7704 posts

Posted 20 July 2012 - 12:50 AM

You have the idea all wrong, please working through the tutorial <!-- m -->http://www.autohotke...cs/Tutorial.htm<!-- m -->

The "If" in your script are useless.
How did you get such a long listing without comprehending how to use hotkeys :?:

#3 Guests

  • Guests

Posted 20 July 2012 - 07:24 AM

ok... can you please help me out ive tried different methods and i cant seem to get it

#4 Guests

  • Guests

Posted 20 July 2012 - 07:39 AM

Just remove the IF before your hotkeys.

#5 girlgamer

girlgamer
  • Moderators
  • 2039 posts

Posted 20 July 2012 - 09:05 AM




#MaxThreadsPerHotkey 2

#SingleInstance force



;--------------------

5::

BlockInput, On

Send, {SPACE}

Send, {I}

Send, {ALTDOWN}

MouseClick, right, 996, 539, , 0

Send, {ALTUP}

Send, {SPACE}

BlockInput, Off

return



;--------------------

+MButton::

BlockInput, On

send, {SHIFTDOWN}

MouseClick, left, 1192,1034

send, {SHIFTUP}

Send, {SPACE}

Send, {I}

MouseClick, right, 1209, 452, , 0

Send, {ALTDOWN}

MouseClick, right, 1210, 489, , 0

send, {ALTUP}

;MouseClick, right, 1438, 826

MouseClick, right, 993, 489, , 0

MouseClick, right, 991, 454, , 0

Send, {ALTDOWN}

MouseClick, right, 1061, 465, , 0

send, {ALTUP}

MouseClick, right, 1170, 470, , 0

;MouseClick, right, 1621, 828

MouseClick, right, 1098, 467, , 0

MouseClick, right, 1132, 467, , 0

MouseClick, right, 1244, 467, , 0

;MouseClick, right, 1822, 832

MouseClick, right, 1027, 469, , 0



; Reset Position

Send, {SPACE}

BlockInput, Off

return



#6 Guests

  • Guests

Posted 20 July 2012 - 08:29 PM

Much thanks to the above post! :D