Jump to content

Loop How many times?


vincepr0
 Share

Recommended Posts

Please don't say read the help files and be nice. I am super new to doing this kind of stuff... I have tried and cannot find something that prompts a box that says: How many times do you want to loop? (then you type in a number like 12) and it loops 12 times.

 

Here is my script below. I want to start this script, input the number of times I want to loop, and then start. Then it stops after it goes through that number of times.

 

MouseClick("left",942,409,1)
sleep(500)
MouseClick("left",942,409,1)
sleep(500)
Send("{CTRLDOWN}{HOME}{CTRLUP}")
sleep(500)
Send("{CTRLDOWN}c{CTRLUP}")
MouseClick("left",567,-833,1)
sleep(500)
Send("{CTRLDOWN}v{CTRLUP}")
sleep(100)
Send("{ENTER}")
sleep(100)
Send("{TAB}")
sleep(100)
Send("{TAB}")
sleep(100)
Send("{TAB}")
sleep(100)
Send("{TAB}")
sleep(100)
Send("hardware{ENTER}")
sleep(400)
Send("{TAB}laptop{ENTER}")
sleep(400)
MouseClick("left",942,409,1)
sleep(500)
MouseClick("left",942,409,1)
sleep(500)
Send("{CTRLDOWN}{HOME}{CTRLUP}")
sleep(100)
Send("{RIGHT}")
sleep(100)
Send("{CTRLDOWN}c{CTRLUP}")
sleep(400)
MouseClick("left",642,-457,1)
sleep(400)
Send("{CTRLDOWN}v{CTRLUP}")
sleep(400)
MouseClick("left",942,409,1)
sleep(500)
MouseClick("left",942,409,1)
sleep(500)
Send("{CTRLDOWN}{HOME}{CTRLUP}")
sleep(100)
Send("{RIGHT}")
sleep(100)
Send("{RIGHT}")
sleep(100)
Send("{CTRLDOWN}c{CTRLUP}")
sleep(400)
MouseClick("left",642,-457,1)
sleep(400)
Send("{TAB}")
sleep(100)
Send("{TAB}")
sleep(100)
Send("{TAB}")
sleep(100)
Send("{ENTER}")
sleep(400)
Send("{TAB}")
sleep(100)
Send("{TAB}")
sleep(100)
Send("{TAB}")
sleep(100)
Send("{TAB}")
sleep(100)
Send("{CTRLDOWN}v{CTRLUP}")
sleep(400)
Send("{TAB}")
sleep(100)
Send("{ENTER}")
sleep(400)
MouseClick("left",942,409,1)
sleep(500)
MouseClick("left",942,409,1)
Send("{CTRLDOWN}{HOME}{CTRLUP}")
sleep(100)
Send("{SHIFTDOWN}{RIGHT}{RIGHT}{SHIFTUP}{CTRLDOWN}-{CTRLUP}")
sleep(100)
Send("{ENTER}")
sleep(100)
MouseClick("left",411,-937,1)

Link to comment
Share on other sites

  • Moderators

Earthshine,

Despite the OP's rather insulting classification of forum members as "nerds" we should still remain polite. Please refrain from adding posts such as the one above which says more about you than the OP.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Hi.

 

Welcome to the forum.

If you want to do a loop 12 times, then use a "for" loop. With an option to specify first, how many loops shall be done, this would come out to some code like this:

 

$LoopCount=InputBox("How many loops shall be done?","Enter number",12)


for $i = 1 to $LoopCount
    MsgBox(0,"Loop counter","This is loop #" & $i)
    ; your code goes here.
Next

regards, Rudi.

 

PS: I don't take "nerd" as an insult ;-)

have fun!

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...