seres Posted September 7, 2007 Posted September 7, 2007 hello how do i make shortcuts for functions so i dont have to be writing them all over again like run(somthing)
Monamo Posted September 7, 2007 Posted September 7, 2007 hello how do i make shortcuts for functions so i dont have to be writing them all over again like run(somthing) You would define the function and its tasks: Func DoStuff() ;doing something here ;doing more stuff ;doing one last thing EndFuncoÝ÷ ٩ݶ§Ê·õ×[ajÛ¶íjÉ,|¨º»®*mo'X§Ø^~éܶ*'jëh×6MsgBox(0,"","My function;s about to perform") DoStuff() MsgBox(0,"","My function's done!") - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]
narayanjr Posted September 7, 2007 Posted September 7, 2007 (edited) look up #include or HotKeySet() Edited September 7, 2007 by narayanjr
seres Posted September 7, 2007 Author Posted September 7, 2007 (edited) HELLO what i mean is to put a command to a single letter here is my code HotKeySet("^+!a", "runall") HotKeySet("^+!b", "runone") While 1 Sleep(100) WEnd Func runall Run("new.exe") ;i want to assing this run("new.exe") to somthing more simple like "c=run("new.exe")" so i write c in the other func and it runs it EndFunc and how do i add something to stop the autoit scrip cause when im in a game it wont stop with ctrl breake Func runone c EndFunc Edited September 7, 2007 by seres
BobK Posted September 7, 2007 Posted September 7, 2007 I don't think you can assign a statement to a single letter. Would you settle for a letter and two parentheses? To stop your script with Ctrl-Break set Ctrl-Break as a hotkey to an exit function.HotKeySet("^+!a", "runall") HotKeySet("^+!b", "runone") HotKeySet("^{BREAK}","depart") ;to stop the script While 1 Sleep(100) WEnd Func c() Run("new.exe") EndFunc Func runall () c() EndFunc Func runone() c() EndFunc Func Depart() Exit EndFunc
narayanjr Posted September 8, 2007 Posted September 8, 2007 (edited) HotKeySet("^+!a", "runall") HotKeySet("^+!b", "runone") HotKeySet("NUMPADSUB","Depart") ;to stop the script by pressing - on the key pad While 1 Sleep(100) WEnd Func c() Run("new.exe") EndFunc Func runall () c() EndFunc Func runone() c() EndFunc Func Depart() Exit EndFunc Edited September 8, 2007 by narayanjr
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