Jump to content

2 loops at once


Crafter
 Share

Recommended Posts

Hello, I'm new in autoit and i learn new functions everyday. Today i wanted to make 2 loops working at the same time but i have no idea how to make it. It should be working like:

- every 10 sec click RMB

- every 4 sec click LMB

Could you help me, please? :)

Link to comment
Share on other sites

  • Moderators

Crafter,

Welcome to the AutoIt forum. :)

For something like this I would suggest using Adlib. But if you can give us some more details as to why you need to do this we might be able to offer more focused help. ;)

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

Hello Melba23. I'm trying to make macro to scan if someone type to me on skype and auto reply on msg but first i need to learn how to make 2 independend loops :) 

I found timer function.

HotKeySet("{PAUSE}", "Terminate")

Dim $nTimer1 = TimerInit()
Dim $nTimer2 = TimerInit(), $nTimer2_diff = Random(8000,11000,1)

While 1
   If TimerDiff($nTimer1) > 120000 Then
      MouseClick("left")
      $nTimer1 = TimerInit()
   EndIf
   
   If TimerDiff($nTimer2) > $nTimer2_diff Then
      Send("{F12}"))
      $nTimer2 = TimerInit()
      $nTimer2_diff = Random(8000,11000,1)
   EndIf
   Sleep(10)
WEnd

Func Terminate()
   Exit 0
EndFunc

Does it look good?

Link to comment
Share on other sites

Hello Melba23. I'm trying to make macro to scan if someone type to me on skype and auto reply on msg but first i need to learn how to make 2 independend loops :)

 

That's a really cool idea. I can't work on this at work, but I'll put my mind to this when I get home

Thanks for your time

 

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...