Skrip Posted December 19, 2005 Share Posted December 19, 2005 I need a script that I can run when I leave my computer, that will freeze the mouse until I press F8 (I have the code for that i think) HotKeySet("F8", "stop") Func stop() exit endfunc [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
w0uter Posted December 19, 2005 Share Posted December 19, 2005 _MouseTrap in misc.au3 My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
MrSpacely Posted December 19, 2005 Share Posted December 19, 2005 _MouseTrap in misc.au3Thats good toI wanted to suggest connecting his freezer to the computer and switching it of when f8 was pressedBut the mousetrap is much better Link to comment Share on other sites More sharing options...
Skrip Posted December 20, 2005 Author Share Posted December 20, 2005 didn't work... HotKeySet("F8", "stop") Func _MouseTrap($i_left = 0, $i_top = 0, $i_right = 0, $i_bottom = 0) Local $av_ret If @NumParams == 0 Then $av_ret = DllCall("user32.dll", "int", "ClipCursor", "int", 0) Else If @NumParams == 2 Then $i_right = $i_left + 1 $i_bottom = $i_top + 1 EndIf Local $Rect = DllStructCreate("int;int;int;int") If @error Then Return 0 DllStructSetData($Rect, 1, $i_left) DllStructSetData($Rect, 2, $i_top) DllStructSetData($Rect, 3, $i_right) DllStructSetData($Rect, 4, $i_bottom) $av_ret = DllCall("user32.dll", "int", "ClipCursor", "ptr", DllStructGetPtr($Rect)) DllStructDelete($Rect) EndIf Return $av_ret[0] EndFunc ;==>_MouseTrap Func stop() exit endfunc [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
MrSpacely Posted December 20, 2005 Share Posted December 20, 2005 (edited) didn't work... HotKeySet("F8", "stop") Func _MouseTrap($i_left = 0, $i_top = 0, $i_right = 0, $i_bottom = 0) Local $av_ret If @NumParams == 0 Then $av_ret = DllCall("user32.dll", "int", "ClipCursor", "int", 0) Else If @NumParams == 2 Then $i_right = $i_left + 1 $i_bottom = $i_top + 1 EndIf Local $Rect = DllStructCreate("int;int;int;int") If @error Then Return 0 DllStructSetData($Rect, 1, $i_left) DllStructSetData($Rect, 2, $i_top) DllStructSetData($Rect, 3, $i_right) DllStructSetData($Rect, 4, $i_bottom) $av_ret = DllCall("user32.dll", "int", "ClipCursor", "ptr", DllStructGetPtr($Rect)) DllStructDelete($Rect) EndIf Return $av_ret[0] EndFunc;==>_MouseTrap Func stop() exit endfuncuhm you just put the function there and hoped it started?? Try this First include misc.au3 then call the function see example #include <misc.au3> HotKeySet("{Esc}", "stop") _MouseTrap(1,1,1,1) while 1 sleep(2000); 2 seconds to not suck up cpu wend Func stop() _MouseTrap() exit endfunc Edited December 20, 2005 by MrSpacely Link to comment Share on other sites More sharing options...
Skrip Posted December 20, 2005 Author Share Posted December 20, 2005 ya, I was reading the description again, and I saw it needed other things...so I fixed it right when you posted, but thanks [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
MrSpacely Posted December 20, 2005 Share Posted December 20, 2005 Good Link to comment Share on other sites More sharing options...
Skrip Posted December 20, 2005 Author Share Posted December 20, 2005 but 1 problem, I did a test because I was using the script while I was away (Yes, already...) and my screen saver activated, then when i came back it stopped working, so when ever my screensaver activates the mouse can move again, how do I fix this? [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
MrSpacely Posted December 20, 2005 Share Posted December 20, 2005 but 1 problem, I did a test because I was using the script while I was away (Yes, already...) and my screen saver activated, then when i came back it stopped working, so when ever my screensaver activates the mouse can move again, how do I fix this?You could change the while loop so it calls the mousetrap every few secondslike while 1sleep(5000)_mousetrap(1,1,1,1)wendmaybe that works Link to comment Share on other sites More sharing options...
Skrip Posted December 20, 2005 Author Share Posted December 20, 2005 thanks it worked great! (You can't even turn off screensaver without pressing the off button) [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
MrSpacely Posted December 20, 2005 Share Posted December 20, 2005 Thats fun for other users Link to comment Share on other sites More sharing options...
Skrip Posted December 20, 2005 Author Share Posted December 20, 2005 I'm the other user on this computer, but there are other people in the house. (They have other computers) [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
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