Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

How to toggle script on/off with a key?


  • Please log in to reply
21 replies to this topic
  • Guests
  • Last active:
  • Joined: --
Is the Z a movement key?

You'll want to set the keystate to down in that case, usually people want an autofire that sends ZZZZZZZZ to their game.

LyrickCZE
  • Members
  • 51 posts
  • Last active: Feb 09 2012 09:18 PM
  • Joined: 29 Jan 2012

janopn do you know how to make a script that keeps the Z pressed not pressing like a miljon times but just keeps it pressed in


Something like this maybe?

toggle := 0

F2::
toggle := !toggle
if toggle
   Send {z down}
else
   Send {z up}
Return

Whenever someone says "pls" because it is shorter than "please", I say "no" because it is shorter than "yes"

BlazFilip
  • Guests
  • Last active:
  • Joined: --

janopn do you know how to make a script that keeps the Z pressed not pressing like a miljon times but just keeps it pressed in


Send, {z down} -presses it down
Sleep 1000 - keeps it down for a second
Send, {z up} - releases

Hope it helped.

Ruevil2
  • Members
  • 226 posts
  • Last active: Dec 04 2015 11:05 PM
  • Joined: 27 Mar 2012
F1::
GetKeyState, state, X
if (state = U)
{
	 Send {X down}
}
else
{
	 Send {X up}
}
return

Try this. It checks the state of the X key to see if it is being pressed. If No then press it down. If Yes then release it. The F1 key is your hotkey.

Edit: Press once to hold down X, press again to release it.

If I helped you out and you would like to show appreciation, feel free to buy me a beer.  grin.png   btn_donateCC_LG.gif


PindaPixel
  • Members
  • 2 posts
  • Last active: Jun 12 2013 03:22 PM
  • Joined: 03 Jun 2013

I wan't a script with a key that toggles it on, and I want to use loop, but if I do, it wont toggle off...

Numpad1::
Suspend, Toggle
Loop
{
	Send {E}
	Sleep 5
}



Daonemonstar
  • Members
  • 10 posts
  • Last active: Jun 03 2015 08:46 AM
  • Joined: 28 May 2015

Is there a way to double click a key to suspend? say i wanted to use *space to turn pause and start a script?



Rome1989s
  • New members
  • 1 posts
  • Last active: Aug 15 2015 07:23 PM
  • Joined: 15 Aug 2015

This is how we do it:

z::
{
 ;IfWinActive [, WinTitle, WinText, ExcludeTitle, ExcludeText]
 IfWinActive, World of Warcraft
 {
  if ( GetKeyState("z",p) )
  {
   if ( IsToggle = nil or IsToggle = 0 )
   {
    Send, {RButton down}
    IsToggle := 1
    return
    }

  if ( IsToggle = 1 )
  {
   Send, {RButton up}
   IsToggle := 0
   return
   }

  }
 }
}
return