Jump to content
Sign in to follow this  
Varsity

Need a bit of help.

Recommended Posts

Varsity

Hey guys!

I'm trying to have a hotkey that can call for some Adlib Registries, however, I need their respective delay to be maintained between each script; without interfering with the next. Here's what we have so far.

Global $Message1d = 1000, $Message2d = 2000, $Message3d = 3000
AdlibRegister("AutoMessage3", $Message3d)
Func AutoMessage3()
    Send("Message3")
    Send("{asc 013}")
    Sleep(50)
EndFunc   ;==>AutoMessage3
AdlibRegister("AutoMessage2", $Message2d)
Func AutoMessage2()
    Send(" Message2")
    Send("{asc 013}")
    Sleep(250)
EndFunc   ;==>AutoMessage2
AdlibRegister("AutoMessage1", $Message1d)
Func AutoMessage1()
    Send("   Message1")
    Send("{asc 013}")
    Sleep(125)
EndFunc   ;==>AutoMessage1
While 1
    Sleep(13)
WEnd

With that being said, is there a way to bind all of the above to a hotkey? I can't figure out how to do it :S.

Thanks!

Edited by Varsity

Share this post


Link to post
Share on other sites
kaotkbliss

With that being said, is there a way to bind all of the above to a hotkey? I can't figure out how to do it :S.

Thanks!

A single hotkey to run all 3 or 1 hotkey per message? either way, check out hotkeyset in the helpfile to get you started :)


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites
sleepydvdr

however, I need their respective delay to be maintained between each script

If all you want to do is carry over a value from one script to another, just write the last current value to an ini file before exiting a script. Then get the next script to read it.

With that being said, is there a way to bind all of the above to a hotkey? I can't figure out how to do it :S.

From the help file:

Re-registering an already existing Adlib function will update it with a new time.

Sounds to me like you will need to call your different functions to change the delay time. I can't image how a single instance could simultaneously hold different values.


#include <ByteMe.au3>

Share this post


Link to post
Share on other sites
Varsity

A single hotkey to run all 3 or 1 hotkey per message? either way, check out hotkeyset in the helpfile to get you started :)

I have. Not finding what I'm after. And I want all three to run at the same time, as it would without a hotkey. :\

Edited by Varsity

Share this post


Link to post
Share on other sites
smartee

hi Varsity,

How's this?

Global $Message1d = 1000, $Message2d = 2000, $Message3d = 3000, $iIsFuncsRegistered = False
HotKeySet("!r", "_ToggleFuncs") ;Press Alt+R to turn the messages on/off

Func AutoMessage3()
    Send("Message3")
    Send("{asc 013}")
    Sleep(50)
EndFunc   ;==>AutoMessage3

Func AutoMessage2()
    Send(" Message2")
    Send("{asc 013}")
    Sleep(250)
EndFunc   ;==>AutoMessage2

Func AutoMessage1()
    Send("   Message1")
    Send("{asc 013}")
    Sleep(125)
EndFunc   ;==>AutoMessage1

Func _ToggleFuncs()
    If Not $iIsFuncsRegistered Then
        AdlibRegister("AutoMessage3", $Message3d)
        AdlibRegister("AutoMessage2", $Message2d)
        AdlibRegister("AutoMessage1", $Message1d)
        $iIsFuncsRegistered = True
    Else
        AdlibUnRegister("AutoMessage3")
        AdlibUnRegister("AutoMessage2")
        AdlibUnRegister("AutoMessage1")
        $iIsFuncsRegistered = False
    EndIf
EndFunc   ;==>_ToggleFuncs

While 1
    Sleep(250)
WEnd

Hope this helps, :)

-smartee

Share this post


Link to post
Share on other sites
Varsity

Smartee, you are a godsend.

Thanks for all of your help through writing this :)

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.