OrangePanda Posted August 19, 2006 Share Posted August 19, 2006 Hi im stuck with the problem on this script. It doesnt seem to work basically what i wanted to do is this: If press numpad 1 it should press 6 then hold right mouse button for 87 sec after that press 4 then wait 1 sec then release the right mouse, then loop again until I stop it with a key. the other one is if i press numpad 4 it would hold right mouse for 7 sec, then release the right mouse, then hold it again for 7 sec, then release again and so on with infinite loop until I stop it with a key. Hope you guys can help me thnks in advance expandcollapse popup; Script Start - Add your code below here ;Keys HotKeySet("(NUMPAD1)", "Essb") HotKeySet("(NUMPAD2)", "Essboff") HotKeySet("(NUMPAD4)", "Nova") HotKeySet("(NUMPAD5)", "Novaoff") GuiSetState() $Essb = 0 $Nova = 0 While 1 $msg = GuiGetMsg() if $Essb = 1 Then Send("(6)") MouseDown ("right") Sleep(86000) MouseUp ("right") Send ("(4)") MouseDown ("right") Sleep (1000) MouseUp ("right") Sleep (500) EndIf if $Nova = 1 Then MouseDown ("right") Sleep (7000) MouseUp ("right") Sleep (500) EndIf WEnd Func Essb() $Essb = 1 EndFunc Func Nova() $Nova = 1 EndFunc Func Essboff() $Essb = 0 EndFunc Func Novaoff() $Nova = 0 EndFunc Link to comment Share on other sites More sharing options...
GaryFrost Posted August 19, 2006 Share Posted August 19, 2006 Being you don't have a gui there is a few lines not needed and exit function added. Didn't test it, but it should work. expandcollapse popup; Script Start - Add your code below here ;Keys HotKeySet("(NUMPAD1)", "Essb") HotKeySet("(NUMPAD2)", "Essboff") HotKeySet("(NUMPAD4)", "Nova") HotKeySet("(NUMPAD5)", "Novaoff") HotKeySet("{Esc}", "_Terminate") $Essb = 0 $Nova = 0 While 1 If $Essb = 1 Then Send("(6)") MouseDown("right") Sleep(86000) MouseUp("right") Send("(4)") MouseDown("right") Sleep(1000) MouseUp("right") Sleep(500) EndIf If $Nova = 1 Then MouseDown("right") Sleep(7000) MouseUp("right") Sleep(500) EndIf Sleep ( 100 ) WEnd Func Essb() $Essb = 1 EndFunc ;==>Essb Func Nova() $Nova = 1 EndFunc ;==>Nova Func Essboff() $Essb = 0 EndFunc ;==>Essboff Func Novaoff() $Nova = 0 EndFunc ;==>Novaoff Func _Terminate() Exit EndFunc ;==>_Terminate SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
OrangePanda Posted August 19, 2006 Author Share Posted August 19, 2006 (edited) thanks for the help. But nothing happens if i press any of the hotkey Edited August 19, 2006 by OrangePanda Link to comment Share on other sites More sharing options...
Valuater Posted August 19, 2006 Share Posted August 19, 2006 thanks for the help. But nothing happens if i press any of the hotkeytry pressing the "Num Lock" first8) Link to comment Share on other sites More sharing options...
OrangePanda Posted August 19, 2006 Author Share Posted August 19, 2006 try pressing the "Num Lock" first8)im really sorry to bother you guys, but it still not working i already tried to press num lockalso tried it on notepad to see if its pressing the right keys, but nothings happening Link to comment Share on other sites More sharing options...
GaryFrost Posted August 19, 2006 Share Posted August 19, 2006 Try using the correct syntax in HotKeySet use {} not () expandcollapse popup; Script Start - Add your code below here ;Keys HotKeySet("{NUMPAD1}", "_Essb") HotKeySet("{NUMPAD2}", "_Essboff") HotKeySet("{NUMPAD4}", "_Nova") HotKeySet("{NUMPAD5}", "_Novaoff") HotKeySet("{Esc}", "_Terminate") Run("Notepad") $Essb = 0 $Nova = 0 While 1 If $Essb = 1 Then Send("(6)") MouseDown("right") Sleep(86000) MouseUp("right") Send("(4)") MouseDown("right") Sleep(1000) MouseUp("right") Sleep(500) EndIf If $Nova = 1 Then MouseDown("right") Sleep(7000) MouseUp("right") Sleep(500) EndIf Sleep ( 100 ) WEnd Func _Essb() $Essb = 1 EndFunc ;==>Essb Func _Nova() $Nova = 1 EndFunc ;==>Nova Func _Essboff() $Essb = 0 EndFunc ;==>Essboff Func _Novaoff() $Nova = 0 EndFunc ;==>Novaoff Func _Terminate() Exit EndFunc ;==>_Terminate SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
OrangePanda Posted August 19, 2006 Author Share Posted August 19, 2006 Thanks again, its working now 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