seres Posted October 4, 2007 Posted October 4, 2007 is it possible to make something like this . so when i press ^+!1 it calls the funct new and if i press ^+!2 it calls the funct new2 HotKeySet("^+!1", "new") HotKeySet("^+!2", "new2") While 1 Sleep(100) WEnd func new() HotKeySet("^+!a", "now") While 1 Sleep(100) WEnd func now() anything endfunc end funct func new2() HotKeySet("^+!a", "something") While 1 Sleep(100) WEnd func something() anything endfunc end funct
BrettF Posted October 4, 2007 Posted October 4, 2007 On the right track... Try this HotKeySet("^+!1", "new");CTRL + SHIFT + ALT + 1 HotKeySet("^+!2", "new2");CTRL + SHIFT + ALT + 2 While 1 Sleep(100) WEnd Func new() HotKeySet("^+!a", "now");CTRL + SHIFT + ALT + A MsgBox (0, "", "New was called") EndFunc ;==>new Func now() MsgBox (0, "", "Now was called") ;anything EndFunc ;==>now Func new2() MsgBox (0, "", "New2 was called") HotKeySet("^+!a", "something");CTRL + SHIFT + ALT + A EndFunc ;==>new2 Func something() MsgBox (0, "", "Something was called") EndFunc ;==>something Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
seres Posted October 4, 2007 Author Posted October 4, 2007 hello thanks for the answer, but i have a problem with the functions. how do i close a function when i change the function with the hotkeysets. and how do i put in a message box something like this jsajlsdjf sjdfjsl sdjfjlsdl sdjklf
stampy Posted October 4, 2007 Posted October 4, 2007 Not sure what you mean by 'close the function'. Once the code is run it's done until you call it again. As for the msgbox ... I guess this... MsgBox(0,'My msgbox','jsajlsdjf' & @CRLF & 'sjdfjsl' & @CRLF & @CRLF & 'sdjfjlsdl' & @CRLF & @CRLF & 'sdjklf')
seres Posted October 4, 2007 Author Posted October 4, 2007 thanks. about the end func what i mean is that i have assined some letters but when i change the function the letters that r not in the other function stills active for example hotkey 1 hotkey 2 func 1 hotkey a hotkey b hotkey c hotkey d endfunct funct 2 hotkey a hotkey b hotkey c endfunct so here if i call the funct 1, then the funct 2 the hotkey d stills active,
PsaltyDS Posted October 4, 2007 Posted October 4, 2007 (edited) thanks.about the end func what i mean is that i have assined some letters but when i change the function the letters that r not in the other function stills activefor examplehotkey 1hotkey 2func 1 hotkey a hotkey b hotkey c hotkey dendfunctfunct 2 hotkey a hotkey b hotkey cendfunctso here if i call the funct 1, then the funct 2 the hotkey d stills active,If you redefine a HotKeySet with a blank function, it clears that hotkey. Your example is poor pseudo-code because the functions being assigned are not shown. However since the hotkey functions for a, b, and c are redefined in both functions 1 and 2, you don't have to worry about those. The hotkey for d that is defined in function 1 presumably needs to be cleared in function 2. So function 2 needs HotKeySet("d", "") in it to clear that hotkey.You will have to keep that stray "t" out of "funct". Download SciTE and use it for all your AutoIt work, it will make things MUCH easier. Edited October 4, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
seres Posted October 4, 2007 Author Posted October 4, 2007 thanks for the help, i worte it like that cause it was to much code to put on so i thought that by writing it with a , b things it will be easier to understand and to give an answer, thanks for the help
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