hefty Posted March 25, 2007 Share Posted March 25, 2007 i want my mouse to left click 100 times and then stop. however when i press F3 it doesnt even click a single time. why ; Script Start - Add your code below here WinWaitActive("The Matrix Online") HotKeySet("{F3}", "Start") While 1 Sleep(100) WEnd func Start() $i = 0 while $i < 100 mouseclick(left) MsgBox(0, "Value of $i is:", $i) $i = $i + 1 WEnd EndFunc Link to comment Share on other sites More sharing options...
seiryklav Posted March 25, 2007 Share Posted March 25, 2007 (edited) I just ran this code here, and im getting message boxes... not a line of clicks... do you want a bunch of clicks??.. or message boxes?? HotKeySet("{F3}", "Start") While 1 Sleep(100) WEnd Func Start() $i = 0 While $i < 100 MouseClick("left") ;MsgBox(0, "Value of $i is:", $i) $i = $i + 1 WEnd EndFunc ;==>Start EDIT: That particular msgbox, doesnot need to be shown... and it works now... if you want the script to exit then add an exit command after the WEnd and before the EndFunc neat little script Edited March 25, 2007 by seiryklav ContactAim- bluehydrolic Link to comment Share on other sites More sharing options...
hefty Posted March 25, 2007 Author Share Posted March 25, 2007 I just ran this code here, and im getting message boxes... not a line of clicks... do you want a bunch of clicks??.. or message boxes?? HotKeySet("{F3}", "Start") While 1 Sleep(100) WEnd Func Start() $i = 0 While $i < 100 MouseClick("left") MsgBox(0, "Value of $i is:", $i) $i = $i + 1 WEnd EndFunc ;==>Start no i dont want message boxes. u got message boxes? i dont get anything when i press f3 Link to comment Share on other sites More sharing options...
hefty Posted March 25, 2007 Author Share Posted March 25, 2007 (edited) ok yeah it does work. ii removed winwait and it worked. but how come it doesnt work inside the game? Edited March 25, 2007 by hefty Link to comment Share on other sites More sharing options...
Vindicator209 Posted March 25, 2007 Share Posted March 25, 2007 HotKeySet("{F3}", "Start") While 1 Sleep(100) WEnd Func Start() While 100 MouseClick("left") WEnd EndFunc hm? well, I just did it the easy way and just wrote while 100... [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
jvanegmond Posted March 25, 2007 Share Posted March 25, 2007 (edited) HotKeySet("{F3}", "Start") While 1 Sleep(100) WEnd Func Start() While 100 MouseClick("left") WEnd EndFunc hm? well, I just did it the easy way and just wrote while 100...While 100? Edited March 25, 2007 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
Vindicator209 Posted March 25, 2007 Share Posted March 25, 2007 (edited) erm? is that..wrong? ... now i feel like I did something stupid... err.... Edited March 25, 2007 by MethodZero [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
jvanegmond Posted March 25, 2007 Share Posted March 25, 2007 (edited) Help file on While .. WendIf the expression is true the following statements up to the WEnd statement are executed. This loop continues until the expression is false.100 and 1 are both true. So, it's not wrong.. but it doesn't loop it 100 times either.. Edited March 25, 2007 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
Vindicator209 Posted March 25, 2007 Share Posted March 25, 2007 Yea.... i...knew that! I was just testing you.... erm... while 99+1 ? [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
jvanegmond Posted March 25, 2007 Share Posted March 25, 2007 Yea.... i...knew that! I was just testing you.... erm... while 99+1 ? To see if a function is false or not use this: $Expression = 99+1 If $Expression Then MsgBox(0,"","This expression is true.") Else MsgBox(0,"","This expression is false.") EndIf The same logic is behind While as If, and Do, and a lot more.. github.com/jvanegmond 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