Jump to content

Recommended Posts

Posted

HotKeySet("{END}", "End")
HotKeySet("{DEL}", "Go")

While 1
    Sleep(1)
WEnd

Func End()
    Exit
EndFunc

Func Go()
    MouseClick("left", 493, 462, 1, 2)
    Send("1")
    Send("{ENTER}")
EndFunc

I don't understand the command reference part about loops :-/ What do I need to add to make it loop till I press END? :o

  • Developers
Posted

HotKeySet("{END}", "End")
HotKeySet("{DEL}", "Go")

While 1
    Sleep(1)
WEnd

Func End()
    Exit
EndFunc

Func Go()
    MouseClick("left", 493, 462, 1, 2)
    Send("1")
    Send("{ENTER}")
EndFunc

I don't understand the command reference part about loops :-/ What do I need to add to make it loop till I press END? :o

Do you think anything is missing in the posted script ? did you try it ?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

The thing missing is the loop, because I didn't understand this;

http://www.autoitscript.com/autoit3/docs/i.../lang_loops.htm

This is the loop

While 1
    Sleep(1)
WEnd

It will keep your script active so the every time you press DEL it will perform the function GO.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

  • Developers
Posted

The thing missing is the loop, because I didn't understand this;

http://www.autoitscript.com/autoit3/docs/i.../lang_loops.htm

mmmh...

what do you think this portion does:

While 1
    Sleep(1)
WEnd

:o

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted (edited)

But I need it be be like this;

I press DEL

It loops the script till I press END

EDIT; So what do I change? :o

EDIT2; It needs to loop the GO function.

Edited by AzGuL^
Posted

Here is one way

HotKeySet("{END}", "End")
HotKeySet("{DEL}", "Go")

While 1
    Sleep(1)
WEnd

Func End()
    Exit
EndFunc

Func Go()
    While 1
    MouseClick("left", 493, 462, 1, 2)
    Send("1")
    Send("{ENTER}")
    Sleep(1)
    WEnd
EndFunc


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

  • 12 years later...
Posted

The tutorial on the For loop is not very clear...and it's decrementing loops by default also, makes it confusing for beginners that know nothing about coding:

I recreated the loop example so I can understand it in the future, hope it can help other rookies!

 

#include <MsgBoxConstants.au3>

For $i = 1 To 3 Step +1
   ; MsgBox($MB_SYSTEMMODAL, "", "This will repeat the loop" & @CRLF & $i)
    MsgBox($MB_SYSTEMMODAL, "", "This will repeat the loop the ammount of times specified in the 'For' loop. Using [+] increments the loop.  Using [-] decrements the loop." & @CRLF & @CRLF & "run #" & $i)
Next
MsgBox($MB_SYSTEMMODAL, "", "Run has exectuted all steps in the loop")

 

Posted
1 minute ago, Somerset said:

Thread is 12 years old.

So...can't comment on old threads? If I'm breaking any forum rules, please let me know ? ;)

Posted (edited)

Just start a new thread. Yours is no better than what’s in the help file

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Posted

So start a new thread and post it as an alternate example of for Loops? And it is better than the example, it explains what is going on as it executes.

  • Moderators
Posted

Sigh.

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

 

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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