Varsity Posted July 11, 2011 Posted July 11, 2011 (edited) 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 July 11, 2011 by Varsity
kaotkbliss Posted July 12, 2011 Posted July 12, 2011 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 gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy!
sleepydvdr Posted July 12, 2011 Posted July 12, 2011 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>
Varsity Posted July 12, 2011 Author Posted July 12, 2011 (edited) 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 July 12, 2011 by Varsity
smartee Posted July 12, 2011 Posted July 12, 2011 hi Varsity, How's this?expandcollapse popupGlobal $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
Varsity Posted July 12, 2011 Author Posted July 12, 2011 Smartee, you are a godsend. Thanks for all of your help through writing this
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now