Drew Posted February 9, 2009 Posted February 9, 2009 (edited) Alright , how would I go about making it to where when I trigger the function via hotkey , it will toggle _WindowLock(). That is what I'm working on... This is what I have thus far. It's not working ( ofc ) but could someone explain why? #include <Misc.au3> HotKeySet("W", "_Lock") Global $Lock = 0 While 1 Sleep(500) WEnd Func _Lock() $Lock = 0 If $Lock = 0 Then WinWaitActive("GUI") $coords = WinGetPos("GUI") _MouseTrap($coords[0]+5, $coords[1]+22, $coords[0] + $coords[2]-5, $coords[1] + $coords[3]) $Lock = 1 ElseIf $Lock = 1 Then _MouseTrap() $Lock = 0 EndIf EndFunc ;==>_Lock Edited February 9, 2009 by Drew
Drew Posted February 9, 2009 Author Posted February 9, 2009 (edited) Wtf @ googemyster or w/e ? Some of us would like our topics to be seen -.- Edit: Lol Psalty. Hopefully its soon, hes justa "goin"... Lol. Edited February 9, 2009 by Drew
PsaltyDS Posted February 9, 2009 Posted February 9, 2009 (edited) Wtf @ googemyster or w/e ? Some of us would like our topics to be seen -.- The Mods will be pointing out to googemyster the error of his ways. On your OP: Alright , how would I go about making it to where when I trigger the function via hotkey , it will toggle _WindowLock(). That is what I'm working on... This is what I have thus far. It's not working ( ofc ) but could someone explain why? #include <Misc.au3> HotKeySet("W", "_Lock") Global $Lock = 0 While 1 Sleep(500) WEnd Func _Lock() $Lock = 0 If $Lock = 0 Then WinWaitActive("GUI") $coords = WinGetPos("GUI") _MouseTrap($coords[0]+5, $coords[1]+22, $coords[0] + $coords[2]-5, $coords[1] + $coords[3]) $Lock = 1 ElseIf $Lock = 1 Then _MouseTrap() $Lock = 0 EndIf EndFunc;==>_Lock If you want to use $Lock as flag then toggle it rather than force it to 0 every time: Func _Lock() $Lock = Not $Lock ; ... EndFunc Edited February 9, 2009 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
Drew Posted February 10, 2009 Author Posted February 10, 2009 Thanks Psalty . The suggestion worked out great, I don't know why I didn't think of it lol.
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