Jump to content

I Need create a counter in this code, help!


gallarh
 Share

Recommended Posts

Global $sHeight = @DesktopHeight
Global $sWidth = @DesktopWidth
Global $UnPaused
HotKeySet("+1","_TogglePause") ; Press Shift+1 to start script
HotKeySet("+2", "_Terminate") ; Press Shift+2 to terminate script


    MsgBox(64, "=)")

While 1 ; Loop 1
Sleep(100) ; Waiting for function call. Pressing the Start hotkey ends this loop
ToolTip('Autobuyer paused. Press SHIFT+1 to resume/pause or SHIFT+2 to terminate.',0,0)
WEnd

Func _TogglePause()
   ToolTip('Autobuyer has started. Press SHIFT+1 to pause or SHIFT+2 to terminate.',0,0)
   $UnPaused = NOT $UnPaused
While $UnPaused ; Loop 2
MouseClick("left", 1189, 720, 1, 25)
MouseClick("left", 1073, 720, 1, 17)
MouseClick("left", 687, 447, 1, 2)
MouseClick("left", 1217, 682, 1, 30)
MouseClick("left", 1258, 686, 1, 80)
WEnd
EndFunc

Func _Terminate()
    If MsgBox(4, 'Do you want to exit?', 'Click Yes to exit, or No to continue') = 6 Then Exit
EndFunc   ;==>_Pause

Link to comment
Share on other sites

Welcome to AutoIt and the forum!

You need to provide more information. What should the counter count?
Which program do you try to automate?
MouseClicks are not very reliable as they depend on window position, screen resolution and might interfere with user actions.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

12 minutes ago, gallarh said:

Autobuyer has started

I don't want to imply anything illegal, but are Autobuyers not one type of bot and therefore against the forum rules ?

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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