dandymcgee Posted September 17, 2006 Share Posted September 17, 2006 (edited) Ok, when you set a hotkey HotKeySet("Pause","TogglePause")oÝ÷ Û*.j[(ç¶^~)Þ¶ºw-í«r¢èZ½ç(wµçm¢Ø^d{(N ãںǢ±Ê'ç-yÛh¶jënëm¢tájÜË^*.¦·¬²«¨´ö®±ê®¢Ûaz趦z0³Z¶Ú¡8^Á¬²¢èZ½è§ʩë,¶ªºOjëªê-nëm¢x¶¸vÚwmäè ^=«¬yû§rب»¢w¡ë'ßÛ^Æ+-|¨ºÇ+HµÚ²}ý¶fµêêºpêÞªê-Ê©ºÛayû§rب)í£*.±Êâ¦ØÂ)e~)ÝÖ®¶¶'ºËfjG¬º·²¢ë¬zØ^~æjÒ)®âuçr¢ì"¶áÈ(zÇè®Ø^Mêævyû§rب«0zYVéò¢êkzË-ꮢÑ'v«¨¶G²Âv±¥ç-¶Z¦§|¨º»®*m"ֵ驶Ëhh¶z¹¢«^~éܶ*'nër¢çhm«Þ¢w«Þ¦º/×Ê°ØZMêævyû§rب«0zYI¹Ø"ò¶§jgz¹¢«^!ìiyËr¢ìÛazÇ+m¡ìb·^Ø^ªê-wjºd{(¬¦·¬±çT±ëaÇè®f~Ú'îËb¢{2¢ë¬y«¢+Ø)Õ¹ÅÕ½Ðí95µ=µU9 Q%=8µ!IÅÕ½Ðì ¤(í Q%=8e=T]9PQ The () parenthesis are for more advanced functions, you don't need to put things in those right now, just make sure you include them to hold the place. Hopefully this helps you understand functions a bit. If you need help with anything else just post your questions, I'm more than willing to try to explain anything I know to you. Edited September 17, 2006 by dandymcgee - Dan [Website] Link to comment Share on other sites More sharing options...
vexitor Posted September 28, 2006 Author Share Posted September 28, 2006 Alright i've come up with this but the hotkey still isn't workin can someone help me out?, also it would be nice to get it to when i start the script that it not start clicking but to start when i hit a hotkey O.o can i do that? Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) WEnd EndFunc Global $Paused HotKeySet("Pause","TogglePause") For $i=1 To 3000 MouseClick ("left",490,306,3000,100) $i Sleep(50) Next MouseClick ("left",490,306,3000,100) $i Link to comment Share on other sites More sharing options...
Valuater Posted September 28, 2006 Share Posted September 28, 2006 (edited) Global $Paused goes at the very top of the script... just like the "help" file example 8) Edited September 28, 2006 by Valuater Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 28, 2006 Share Posted September 28, 2006 (edited) Alright i've come up with this but the hotkey still isn't workin can someone help me out?, also it would be nice to get it to when i start the script that it not start clicking but to start when i hit a hotkey O.o can i do that? Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) WEnd EndFunc Global $Paused HotKeySet("Pause","TogglePause") For $i=1 To 3000 MouseClick ("left",490,306,3000,100) $i Sleep(50) Next MouseClick ("left",490,306,3000,100) $i ...and isn't the Send() equivilent (which is what's used for HotKeySet) for the PAUSE key "{PAUSE}" vice "Pause"? HotKeySet("{PAUSE}","TogglePause") Edited September 28, 2006 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 Link to comment Share on other sites More sharing options...
vexitor Posted September 29, 2006 Author Share Posted September 29, 2006 Err.. i didn't get any of that maybe you could go into more detail what the problem is? Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 29, 2006 Share Posted September 29, 2006 Err.. i didn't get any of that maybe you could go into more detail what the problem is? This demonstrates the use of the HotKeySet(): Global $Paused = True HotKeySet("{PAUSE}", "_TogglePaused") HotKeySet("{END}", "_Quit") $i = 0 While 1 If Not $Paused Then $i += 1 MsgBox(32, "Question", $i & ". Isn't this annoying?", 1) EndIf Sleep(100) WEnd Func _TogglePaused() $Paused = Not $Paused EndFunc ;==>_TogglePaused Func _Quit() Exit EndFunc ;==>_Quit Your MouseClick() functions shouldn't have the $i variable after them either. It doesn't do anything but throw interpreter errors. 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 Link to comment Share on other sites More sharing options...
AzKay Posted September 29, 2006 Share Posted September 29, 2006 Not trying to confuse you in any way, But, When you use functions like, Func...EndFunc, I find, and probly most of the people here, that it will be alot clearer, and less confusing, if you put the functions at the end of your script, rather than the start . Just a tip. ;Code ;Code Func MyFunction() ;Code EndFunc The reason being, if youve got a really long/big script, its easier to read, And, you wont have to scroll all the way to the bottom each time to get to your main script Hope I didnt confuse you atall. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
vexitor Posted September 29, 2006 Author Share Posted September 29, 2006 Ty you guys you've been a huge help Ok... This is what i now have tell me if something is wrong Global $Paused = True HotKeySet("{Pause}","TogglePause") Func TogglePause() If Not $Paused Then For $i=1 To 5 MouseClick ("left",490,306,20,100) Next MouseClick ("left",490,306,20,100) EndIf Sleep(100) While $Paused Sleep(100) WEnd EndFunc Link to comment Share on other sites More sharing options...
vexitor Posted September 30, 2006 Author Share Posted September 30, 2006 So did i put the function in the right place b/c it still wont pause Link to comment Share on other sites More sharing options...
AceLoc Posted September 30, 2006 Share Posted September 30, 2006 (edited) just to clear it a little up (you can use Tidy for that SciTE > Tools) and that script will close. you must make a loop if you are using a "hotkeyset" HotKeySet("{Pause}", "TogglePause") Global $Paused = True ;Example While 1 Sleep(100) WEnd Func TogglePause() If Not $Paused Then For $i = 1 To 5 MouseClick("left", 490, 306, 20, 100) Next MouseClick("left", 490, 306, 20, 100) EndIf Sleep(100) While $Paused Sleep(100) WEnd EndFunc ;==>TogglePause Edited September 30, 2006 by aceloc [quote name='AceLoc']I gots new sunglasses there cool.[/quote] Link to comment Share on other sites More sharing options...
vexitor Posted September 30, 2006 Author Share Posted September 30, 2006 wow thx Link to comment Share on other sites More sharing options...
AceLoc Posted September 30, 2006 Share Posted September 30, 2006 (edited) wow thx Welcome. Remember there are still somethings you really dont need in the script.. it was only an example. I guess you wanted something like this: HotKeySet("{Pause}", "TogglePause") HotKeySet("{DEL}", "_Exit") Global $Paused = True While 1 ;you can also use While $Paused Sleep(100) WEnd Func TogglePause() If Not $Paused Then For $i = 1 To 5 MouseClick("left", 490, 306, 20, 100) Next MouseClick("left", 490, 306, 20, 100) EndIf EndFunc ;==>TogglePause Func _Exit() Exit EndFunc ;==>_Exit Edited September 30, 2006 by aceloc [quote name='AceLoc']I gots new sunglasses there cool.[/quote] Link to comment Share on other sites More sharing options...
vexitor Posted September 30, 2006 Author Share Posted September 30, 2006 (edited) hey guys one quick question i know that it says if i leave x and y alone it will use current position but would i put x and y as place holders for it or leave it blank? any help will be appreciated Edited September 30, 2006 by vexitor Link to comment Share on other sites More sharing options...
Paulie Posted October 1, 2006 Share Posted October 1, 2006 hey guys one quick question i know that it says if i leave x and y alone it will use current position but would i put x and y as place holders for it or leave it blank? any help will be appreciated well, assuming you are referring to Mouseclick(), why would you want place holders? if you are looking to declare speed but not coordinates, put this at top of your script Opt('MouseClickDelay',0) Opt('MouseClickDownDelay',0) Link to comment Share on other sites More sharing options...
vexitor Posted October 1, 2006 Author Share Posted October 1, 2006 Ok this is what i got but for some reason it doesn't want to turn on O.o can you help me?? HotKeySet("{Pause}", "TogglePause") HotKeySet("{DEL}", "_Exit") Global $Paused = True Opt('MouseClickDelay',0) Opt('MouseClickDownDelay',0) Func TogglePause() If Not $Paused Then For $i = 1 To 5 MouseClick("left",508,309, 20, 100) Next MouseClick("left", 508, 309, 20, 100) EndIf EndFunc Func _Exit() Exit EndFunc Link to comment Share on other sites More sharing options...
Paulie Posted October 1, 2006 Share Posted October 1, 2006 Ok this is what i got but for some reason it doesn't want to turn on O.o can you help me??Well, you have your whole script in functions, but nothing calling them, try this Opt('MouseClickDelay',0) Opt('MouseClickDownDelay',0) HotKeySet("{Pause}", "TogglePause") HotKeySet("{DEL}", "_Exit") Global $Paused = True While 1 Sleep(999); this gives the script something to do before you press the hotkey Wend Func TogglePause() If Not $Paused Then For $i = 1 To 5 MouseClick("left",508,309, 20, 100) Next MouseClick("left", 508, 309, 20, 100) EndIf EndFunc Func _Exit() Exit EndFunc Link to comment Share on other sites More sharing options...
vexitor Posted October 1, 2006 Author Share Posted October 1, 2006 It doesn't seem to click, the hotkeys work but it doesn't click?? whats wrong Link to comment Share on other sites More sharing options...
vexitor Posted October 2, 2006 Author Share Posted October 2, 2006 Ok this is what i got when i run the script nothing seems to happen... Opt('MouseClickDelay',0) Opt('MouseClickDownDelay',0) HotKeySet("{DEL}", "TogglePause") HotKeySet("{Pause}", "_Exit") Global $Paused = True While 1 Sleep(5000); this gives the script something to do before you press the hotkey Wend Func TogglePause() If Not $Paused Then For $i = 1 To 5 MouseClick("left",508,309, 20, 100) Next MouseClick("left", 508, 309, 20, 100) EndIf EndFunc Func _Exit() Exit EndFunc Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 2, 2006 Share Posted October 2, 2006 Ok this is what i got when i run the script nothing seems to happen...Opt('MouseClickDelay',0)Opt('MouseClickDownDelay',0)Look at your options and read what they do:From the help file:MouseClickDelay Alters the length of the brief pause in between mouse clicks.Time in milliseconds to pause (default=10). MouseClickDownDelay Alters the length a click is held down before release.Time in milliseconds to pause (default=10).For example, if your mouse button is down for 0ms, was it down at all?What was it you wanted these settings to do for you? 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 Link to comment Share on other sites More sharing options...
vexitor Posted October 3, 2006 Author Share Posted October 3, 2006 i dunno a guy above recommened i didn't bother to look it up can you help me please 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