Valkyrie Posted June 2, 2009 Share Posted June 2, 2009 Dear readers,I have a pop-up box (inputbox) where someone should fill in a number i.e. 5.Then the script should execute (loop) 5 times... can someone tell me how to do it?Ive been reading forums and manuals for 3 days but i cant figure it out... my script is as follow:; berichtenbox weergevenMsgBox(0, "blablabla", "blablabla!");; vragen hoe vaak we zullen pikkenInputBox("times?", "how many: ", "1");; HERE SHOULD BE THE LOOP FOR THE SCRIPT UNDERNEAT HERE!; muis OP de voeten van de character bewegen en klikken met de linker muisknopMouseMove(972, 550);MouseDown("left");Sleep(15);Hopefully someone can help me out Best regards Link to comment Share on other sites More sharing options...
MrMitchell Posted June 2, 2009 Share Posted June 2, 2009 Assign a variable to the InputBox, like: $number = InputBox("times?", "how many: ", "1"); Link to comment Share on other sites More sharing options...
stampy Posted June 2, 2009 Share Posted June 2, 2009 After assigning a variable to the return of the input box then just use a for loop for $i = 1 to $number Link to comment Share on other sites More sharing options...
Valkyrie Posted June 2, 2009 Author Share Posted June 2, 2009 (edited) so this should work?: ; vragen hoe vaak we zullen pikken $counter = InputBox("times??", "times: ", "1"); ; de loop maken maal het aantal van de inputbox for($start = 1 to $counter) { ; muis OP de voeten van de character bewegen en klikken met de linker muisknop MouseMove(972, 550); MouseDown("left"); Sleep(15); } oh and another question if i may, is it possible to set 1 or 2 colors which the mouse should automaticly click on? i.e. if(color="#FF88CC") { MouseClick("left"); } do not watch the language, its just gibberisch but you know what i mean right? Edited June 2, 2009 by Valkyrie Link to comment Share on other sites More sharing options...
Valkyrie Posted June 2, 2009 Author Share Posted June 2, 2009 (edited) I get errors for($i = 0 to $counter) { MouseMove(972, 550); MouseDown("left"); Sleep(15); }Says:C:\Users\Angelo\Desktop\pikken.au3(8,4) : ERROR: syntax errorfor(~~~^C:\Users\Angelo\Desktop\pikken.au3 - 1 error(s), 0 warning(s) Edited June 2, 2009 by Valkyrie Link to comment Share on other sites More sharing options...
muncherw Posted June 2, 2009 Share Posted June 2, 2009 Your syntax is odd. A For Loop should look something like this: $counter = InputBox("Loop count", "How many times should this loop?") For $i = 1 to $counter MsgBox(0, "Looping", "Loop #" & $i) Next Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic] Link to comment Share on other sites More sharing options...
Valkyrie Posted June 2, 2009 Author Share Posted June 2, 2009 (edited) lol i do NOT want to keep repeating a inputbox!!!I want to do a simple mousemove + click.So i.e. the user fills in the number 10 in the input box,$counter = InputBox("Hoe vaak pikken?", "Aantal keren dat je wilt pikken: ", "1");then the script MouseMove(972, 550); MouseDown("left"); Sleep(15); should be executed 10 times... Edited June 2, 2009 by Valkyrie Link to comment Share on other sites More sharing options...
Valkyrie Posted June 2, 2009 Author Share Posted June 2, 2009 (edited) EDIT: Dusnt work lol, no error BUT when I am in the program it self (where it needs to click) it will only click once, then it stopt and does nothing anymore.Does the loop not work?; berichtenbox weergeven MsgBox(0, "Welkom! Valkyr", "Welkom!"); $counter = InputBox("uhmmm...", "click how many times?") For $i = 1 to $counter MouseMove(972, 550); MouseDown("left"); Sleep(20); ; verder gaan Next Edited June 2, 2009 by Valkyrie Link to comment Share on other sites More sharing options...
stampy Posted June 2, 2009 Share Posted June 2, 2009 your only holding the mouse button down. try mouseclick() instead. Link to comment Share on other sites More sharing options...
muncherw Posted June 2, 2009 Share Posted June 2, 2009 You need to use mouseclick functions. Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic] Link to comment Share on other sites More sharing options...
Valkyrie Posted June 2, 2009 Author Share Posted June 2, 2009 i did so but still it wont continue somehow lol...mij code:; berichtenbox weergeven MsgBox(0, "Welkom! Valkyr zijn Auto Skinner v1.0", "Welkom in valkyr zijn Auto Skinner versie 1.0" & @CRLF & "Dit programma mag je gebruiken op EIGEN risico." & @CRLF & "Je kan hiervoor verbannen worden, maar tot op" & @CRLF & "heden is het nog NIET gedetecteerd!"); ; wraag de gebruiker hoe vaak deze wilt klikken $counter = InputBox("uhmmm...", "Hoe vaak wil je klikken?") ; loop starten For $i = 1 to $counter ; muis OP de voeten van de character bewegen en klikken met de linker muisknop MouseMove(972, 550); MouseClick("left"); Sleep(20); ; verder gaan Nextand the log message:>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\Angelo\Desktop\pikken.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams +>22:25:19 Starting AutoIt3Wrapper v.2.0.0.1 Environment(Language:0413 Keyboard:00020409 OS:WIN_VISTA/Service Pack 1 CPU:X64 OS:X86)>Running AU3Check (1.54.14.0) from:C:\Program Files\AutoIt3+>22:25:19 AU3Check ended.rc:0>Running:(3.3.0.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Users\Angelo\Desktop\pikken.au3" +>22:25:27 AutoIT3.exe ended.rc:0+>22:25:28 AutoIt3Wrapper Finished>Exit code: 0 Time: 9.525 Link to comment Share on other sites More sharing options...
muncherw Posted June 2, 2009 Share Posted June 2, 2009 You don't need to end each line with a ; either. Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic] Link to comment Share on other sites More sharing options...
stampy Posted June 2, 2009 Share Posted June 2, 2009 Look works fine, if you throw a msgbox to test you can see it. Is it not waiting long enough between clicks? What does it do... hang? ... exit? What does the click do? ; berichtenbox weergeven MsgBox(0, "Welkom! Valkyr zijn Auto Skinner v1.0", "Welkom in valkyr zijn Auto Skinner versie 1.0" & @CRLF & "Dit programma mag je gebruiken op EIGEN risico." & @CRLF & "Je kan hiervoor verbannen worden, maar tot op" & @CRLF & "heden is het nog NIET gedetecteerd!"); ; wraag de gebruiker hoe vaak deze wilt klikken $counter = InputBox("uhmmm...", "Hoe vaak wil je klikken?") ; loop starten For $i = 1 to $counter ; muis OP de voeten van de character bewegen en klikken met de linker muisknop MouseMove(972, 550); MouseClick("left") Sleep(20); MsgBox(0,'',$i) ; verder gaan Next Link to comment Share on other sites More sharing options...
Valkyrie Posted June 2, 2009 Author Share Posted June 2, 2009 Oke, I used a little bit of different code. This is exactly what I need just ONE problem. It only executes ONE time... then it stops (end of script) instead of looping. ; berichtenbox weergeven MsgBox(0, "Welkom! Valkyr zijn Auto Skinner v1.0", "Welkom in valkyr zijn Auto Skinner versie 1.0" & @CRLF & "Dit programma mag je gebruiken op EIGEN risico." & @CRLF & "Je kan hiervoor verbannen worden, maar tot op" & @CRLF & "heden is het nog NIET gedetecteerd!"); ; wraag de gebruiker hoe vaak deze wilt klikken $counter = InputBox("uhmmm...", "Hoe vaak wil je klikken?") ; loop starten $i = 0 While $i <= $counter ; muis OP de voeten van de character bewegen en klikken met de linker muisknop MouseMove(972, 550); MouseClick("left"); ; 1 toevoegen aan de counter $i = $i + 1 ; 20 seconden delay invoegen Sleep(20); ; loop afsluiten WEnd When I put in 10 in the box, it should loop the script 10 times, instead if runs the script one single time and that's it... Link to comment Share on other sites More sharing options...
muncherw Posted June 2, 2009 Share Posted June 2, 2009 Is that supposed to be a 20 second delay? Because it's only a 20 millisecond delay. Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic] Link to comment Share on other sites More sharing options...
stampy Posted June 2, 2009 Share Posted June 2, 2009 For loop is easier, but what ever. This code still works for me. Loop completes. Same questions as before... your doing 10 mouse clicks in 1/5 of a second. Does the program/window you are clicking on respond to it that quickly? How do you know it only looped once? Link to comment Share on other sites More sharing options...
muncherw Posted June 2, 2009 Share Posted June 2, 2009 I agree with Stampy, you need to put in a msgbox so you can test it and see that it is looping. You can always take it out after. Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic] 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