James Posted May 11, 2007 Posted May 11, 2007 (edited) Howdy, My friend has a sister who likes to mess around on his computer and switch his background for a pink poodle thing, I can't remeber, anyway he asked me if I could do something about it and get her back on her computer. So I did, and I came up with MouseSwitch!HotKeySet("^!e", "_exit") HotKeySet("^!z", "_switch1") HotKeySet("^!x", "_switch2") #NoTrayIcon $On = False While 1 Sleep(100) Wend Func _exit() Exit EndFunc Func _switch1() $On = False If $On = False Then DllCall("user32.dll", "int", "SwapMouseButton", "int", 0) EndIf EndFunc Func _switch2() $On = True If $On = True Then DllCall("user32.dll", "int", "SwapMouseButton", "int", 1) EndIf EndFuncI think something like this has been done before, but I did it myself and the research came from, MouseSwap [Dx21] =)So, I know its not useful but I think its fun to annoy people with, and it certainly scared her! My Dad also got annoyed with it aswell, should of seen his face Its also the first time, I have used a dll call for anything myself.Thanks,SecureEdit: Missed something! Edited May 11, 2007 by Secure_ICT Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
karman Posted May 11, 2007 Posted May 11, 2007 (edited) Func _switch1() $On = False If $On = False Then DllCall("user32.dll", "int", "SwapMouseButton", "int", 0) EndIf EndFunc Func _switch2() $On = True If $On = True Then DllCall("user32.dll", "int", "SwapMouseButton", "int", 1) EndIf EndFunc Why not just: Func _switch1() DllCall("user32.dll", "int", "SwapMouseButton", "int", 0) EndFunc Func _switch2() DllCall("user32.dll", "int", "SwapMouseButton", "int", 1) EndFunc It's the same. Edited May 11, 2007 by karman
Zedna Posted May 11, 2007 Posted May 11, 2007 Try to add random switching in random intervals for more fun Resources UDF ResourcesEx UDF AutoIt Forum Search
James Posted May 12, 2007 Author Posted May 12, 2007 Karman, I found it easy for me to work like that Zedna, I have done randomness and saved it somewhere, I cant remember, if I find it I will post ot Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
James Posted May 14, 2007 Author Posted May 14, 2007 (edited) Ok, Zedna for the random changing mouse I came up with:; Name: Random MouseSwitch ; Author: James Brooks AKA Secure_ICT ; Remarks: 0 = Normal Mouse, 1 = Switched HotKeySet("^!e", "_exit") #NoTrayIcon $On = False While 1 Switch Random(1,2,1) Case 1 _switch1() Case 2 _switch2() EndSwitch Wend Func _exit() DllCall("user32.dll", "int", "SwapMouseButton", "int", 0) Exit EndFunc Func _switch1() $On = False If $On = False Then DllCall("user32.dll", "int", "SwapMouseButton", "int", 0) EndIf EndFunc Func _switch2() $On = True If $On = True Then DllCall("user32.dll", "int", "SwapMouseButton", "int", 1) EndIf EndFuncBe aware, it will change RANDOMLY and will change again at another random time. (Just thought I'd warn you that its RANDOM (Well the n00bs anyways))My Sister thought the mouse was hanging out or in the wrong socket somewhere. ROTFLMAONID!Edit: Missed one thing to say! ROTFLMAONID = Rolling on the floor laughing my ass of now I'm dying! Edited May 14, 2007 by Secure_ICT Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Pascal257 Posted May 14, 2007 Posted May 14, 2007 (edited) ; Name: Random MouseSwitch ; Author: James Brooks AKA Secure_ICT ; Remarks: 0 = Normal Mouse, 1 = Switched HotKeySet("^!e", "_exit") #NoTrayIcon While 1 Switch Random(1,2,1) Case 1 _switch1() Case 2 _switch2() EndSwitch sleep(Random(10000,30000,1)) Wend Func _exit() DllCall("user32.dll", "int", "SwapMouseButton", "int", 0) Exit EndFunc Func _switch1() DllCall("user32.dll", "int", "SwapMouseButton", "int", 0) EndFunc Func _switch2() DllCall("user32.dll", "int", "SwapMouseButton", "int", 1) EndFuncoÝ÷ Ùj.Ù÷öÛaÇ!jx¶ºÛh§íz¶«jwh8¦x¶+uÓ},y̨¹Æ§r§è¶¨ººey«.äáȬjz®¢Ö½©ÜyÚ®¢Ú'y«¢+Øì9µèI¹½´5½ÕÍMÝ¥Ñ (ìÕÑ¡½Èè)µÌ ɽ½Ì-MÕÉ}% P¼¼¥ÑäAÍ°(ìIµÉÌèÀô9½Éµ°5½ÕÍ°ÄôMݥѡ()!½Ñ-åMÐ ÅÕ½ÐíxÌÌíÅÕ½Ðì°ÅÕ½Ðí}á¥ÐÅÕ½Ðì¤(9½QÉå%½¸()]¡¥±Ä(}ÍÝ¥Ñ ¤(ͱÀ¡I¹½´ ÄÀÀÀÀ°ÌÀÀÀÀ°Ä¤¤)]¹()Õ¹}á¥Ð ¤(±± ±° ÅÕ½ÐíÕÍÈÌȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½ÐíMÝÁ5½ÕÍ ÕÑѽ¸ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°À¤(á¥Ð)¹Õ¹()Õ¹}ÍÝ¥Ñ ¤(±± ±° ÅÕ½ÐíÕÍÈÌȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½ÐíMÝÁ5½ÕÍ ÕÑѽ¸ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°I¹½´ İȰĤ¤)¹Õ¹ I hope there are no syntax-errors... done it without SciTe Edited May 14, 2007 by Pascal257
James Posted May 14, 2007 Author Posted May 14, 2007 Hmm, the second one does not work because it isnt giving a number to the .dll! Although the first one I think will change after 10 seconds. I'm not sure but it does change the mouse buttons. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
karman Posted May 14, 2007 Posted May 14, 2007 Karman, I found it easy for me to work like that Zedna, I have done randomness and saved it somewhere, I cant remember, if I find it I will post ot How can it be easier to write 6 more lines? (they are not needed, totally useless).. You are stupid. Bye!
James Posted May 14, 2007 Author Posted May 14, 2007 (edited) Because its the way my brain works. So, yeah your correct, I can shorten it. HotKeySet("^!e", "_exit") HotKeySet("^!z", "_switch1") HotKeySet("^!x", "_switch2") #NoTrayIcon $On = False While 1 Sleep(100) Wend Func _exit() Exit EndFunc Func _switch1() DllCall("user32.dll", "int", "SwapMouseButton", "int", 0) EndFunc Func _switch2() DllCall("user32.dll", "int", "SwapMouseButton", "int", 1) EndFuncHappy?Edit: Changed the wrong thing Edited May 14, 2007 by Secure_ICT Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Pascal257 Posted May 14, 2007 Posted May 14, 2007 ; Name: Random MouseSwitch ; Author: James Brooks AKA Secure_ICT // edited by Pascal ; Remarks: 0 = Normal Mouse, 1 = Switched HotKeySet("^!e", "_exit") #NoTrayIcon While 1 _switch() sleep(Random(10000,30000,1)) Wend Func _exit() DllCall("user32.dll", "int", "SwapMouseButton", "int", 0) Exit EndFunc Func _switch() DllCall("user32.dll", "int", "SwapMouseButton", "int", Random(0,1,1)) EndFunc Sorry, logical mistake The time IS random... 10-30secs...
James Posted May 14, 2007 Author Posted May 14, 2007 Right, that makes more sense. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Paulie Posted August 30, 2007 Posted August 30, 2007 @JamesBNice, this could actually be useful for something I am making for work, thanks!@KarmanHow can it be easier to write 6 more lines? (they are not needed, totally useless).. You are stupid. Bye!Whats with your attitude? You have a problem with the code? change it yourself. You made your suggestion. And while it may have been a good idea, there is no need to be an asshole. Nobody insulted you, or said your idea was bad, I agree that the lines are omitable, but it would have been fine without the last 4 words. JamesB has no obligation to do anything you say, so calling him stupid for coding something the way he wanted to just makes you look like a hypocrite.
DaProgrammer Posted August 31, 2007 Posted August 31, 2007 (edited) If u really want to drive a man CRAZY !!! #NoTrayIcon HotKeySet("{ESC}","_Exit") While 1 MouseMove(Random(0,@DesktopWidth,1),Random(0,@DesktopHeight,1)) Sleep(Random(1000,2000,1)) WEnd Func _Exit() Exit EndFunc just change the times in sleep to something longer like "Sleep(Random(30000,60000,1))" and the HotKey to something more complex like "HotKeySet("^+!t","_Exit")" which is CTRL+SHIFT+ALT+t Edited August 31, 2007 by DaProgrammer
gamepin126 Posted August 31, 2007 Posted August 31, 2007 #include <misc.au3> While 1 If _IsPressed("01") Then DllCall("user32.dll", "int", "SwapMouseButton", "int", 1) Sleep(10000) DllCall("user32.dll", "int", "SwapMouseButton", "int", 0) EndIf Sleep(2000) WEnd Something similar, I'd be far more annoyed with this.
James Posted August 31, 2007 Author Posted August 31, 2007 (edited) GamePin, thats harsh! Although my Dad was a bit pissed off untill he realized I was laughing my ass off! Thanks Paulie! That guy was knocked off his high chair. Edited August 31, 2007 by JamesB Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Paulie Posted September 1, 2007 Posted September 1, 2007 Thanks Paulie! That guy was knocked off his high chair.No problem. I just don't understand why some people think that insulting and being mean to others will get them anywhere...
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