Jump to content

Need help with a macro


Recommended Posts

Hello, I was wondering how to use a key to send another key (or more than one key)

While 1

send("f")

sleep(300)

send("g")

sleep(300)

wend

The problem with this is I don't know how to add in a command that uses one key to activate this macro, thank you.

 

 

Link to post
Share on other sites

This is the macro I was using before

 

HotKeySet("f", "send_keys")
HotKeySet("{ESC}", "exit_script")

While 1
    Sleep(50)
WEnd

Func send_keys()
    Send("G")
    Sleep(735)
    Send("H")
EndFunc

Func exit_script()
    Exit
EndFunc

 

 

I just cant get it to work all of the time, so I was wondering if there is a different way to write that.

F would send G (and then wait .735 seconds) and then send H. I could keep having those 2 keys be pressed over and over by pressing "F" again.

 

Edited by tk5801
Link to post
Share on other sites

Are you looking for a script to send GH on a toggle key?

HotKeySet("{F1}", "_Terminate")
HotKeySet("{F2}", "togglePause")
Global $Paused

While 1
   Sleep(500)
   Send("GH")
WEnd

Func _Terminate()
   Exit
EndFunc

Func togglePause($Paused)
   $Paused = NOT $Paused
   While $Paused
      sleep(100)
      ToolTip('Script is paused. Press "F2" to resume.',1700,300)
   WEnd
   ToolTip("")
EndFunc

When you press F2 it does nothing then you click it again and it sends G and H until you press it?

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...