Jump to content
Sign in to follow this  
tk5801

Need help with a macro

Recommended Posts

tk5801

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.

 

 

Share this post


Link to post
Share on other sites
gruntydatsun

look up hotkeyset

Share this post


Link to post
Share on other sites
badcoder123

You can send more than one key at once

ex:

Send("ExampleUser{TAB}ExamplePass{Enter}")

 

Share this post


Link to post
Share on other sites
gruntydatsun

Run that in notepad and see what happens.

Share this post


Link to post
Share on other sites
tk5801

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

Share this post


Link to post
Share on other sites
gruntydatsun

Use Opt("SendKeyDelay") to set whatever sleep time you want between keystrokes, in milliseconds.

Then just use Send("GH")

to do it repeatedly put it in a loop.

In Scite press F1.  Everything you need to know to do pretty much anything is in there.

 

Share this post


Link to post
Share on other sites
badcoder123

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?

Share this post


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
Sign in to follow this  

×