Jump to content

Help With GUI Again


Muchuchu
 Share

Recommended Posts

K I have been trying literally the past day to try and get this to work but I can't see mto find a way to. All I want is a GUI with a start button, and a stop button. The start button starts the whole script, the stop button stops the whole script (meaning it resets it back to start and pauses the script). I know how to make GUI just not the logic with it. The first part is what I want the GUI to look like, what do I add to make the start and stop button start the script?

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 306, 98, 193, 125)
$Label1 = GUICtrlCreateLabel("Press start to start the Flax picker, stop to stop it", 32, 16, 229, 17)
$Button1 = GUICtrlCreateButton("Button1", 64, 48, 65, 33)
$Button2 = GUICtrlCreateButton("Button2", 160, 48, 73, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; BELOW IS WHERE SCRIPT STARTS

Dim $arr[2][1000]
$i = 0

do
do
    do
    sleep("1000")
    $coord = PixelSearch( 0, 0, 1279, 1023, 0xABA24E, 50)
    if @ERROR Then
        PixelSearch( 0, 0, 1279, 1023, 0xABA24E , 50)
    endif
until Not @ERROR

$arr[0][$i] = $coord[0]
$arr[1][$i] = $coord[1]

sleep("100")
MouseMove( $coord[0] , $coord[1])
sleep("300")
mousedown("left")
sleep("400")
mouseup("left")
sleep("5000")
 $i = $i + 1
    
until $i = 1

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ^ CLICKS ON BANK
Dim $arr[2][1000]
$i = 0

do
 do
    sleep("1000")
    $coord2 = PixelSearch( 0, 0, 1279, 1023, 0x8093ED, 50)
    if @ERROR Then
        PixelSearch( 0, 0, 1279, 1023, 0x8093ED, 50)
    endif
until Not @ERROR

$arr[0][$i] = $coord2[0]
$arr[1][$i] = $coord2[1]

sleep("100")
MouseMove( $coord2[0] , $coord2[1])
sleep("300")
mousedown("left")
sleep("400")
mouseup("left")
sleep("14000")
 $i = $i + 1
    
until $i = 1



 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^ CLICKS ON QUEST
 
  Dim $arr[2][1000]
$i = 0
 
 do
 do
    sleep("1000")
    $coord4 = PixelSearch( 0, 0, 1279, 1023, 0xCDCDCC, 50)
    if @ERROR Then
        PixelSearch( 0, 0, 1279, 1023, 0xCDCDCC, 50)
    endif
until Not @ERROR

$arr[0][$i] = $coord4[0]
$arr[1][$i] = $coord4[1]

sleep("100")
MouseMove( $coord4[0] , $coord4[1])
sleep("300")
mousedown("left")
sleep("400")
mouseup("left")
sleep("14000")
 $i = $i + 1
    
until $i = 1
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ^CLICKS ON YEW TREES
 
     Dim $arr[2][1000]
$i = 0
 
 do
 do
    sleep("1000")
    $coord4 = PixelSearch( 0, 0, 1279, 1023,  0x577F3F, 50)
    if @ERROR Then
        PixelSearch( 0, 0, 1279, 1023,  0x577F3F, 50)
    endif
until Not @ERROR

$arr[0][$i] = $coord4[0]
$arr[1][$i] = $coord4[1]

sleep("100")
MouseMove( $coord4[0] , $coord4[1])
sleep("300")
mousedown("left")
sleep("400")
mouseup("left")
sleep("10000")
 $i = $i + 1
    
until $i = 2
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^CLICKS REGULAR TREES
 
   Dim $arr[2][1000]
$i = 0
 
 do
 do
    sleep("1000")
    $coord5 = PixelSearch( 0, 0, 1279, 1023,  0x6D6FB8, 50)
    if @ERROR then
        PixelSearch( 0, 0, 1279, 1023,  0x6D6FB8, 50)
        $i = $i + 1
    endif
until Not $i = 1

$arr[0][$i] = $coord5[0]
$arr[1][$i] = $coord5[1]

sleep("100")
MouseMove( $coord5[0] , $coord5[1])
sleep("300")
mousedown("left")
sleep("400")
mouseup("left")
sleep("10000")
 $i = $i + 1
    
until $i = 1
 
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^GOES TO FLAX

    Dim $arr[2][1000]
$i = 0

Do
sleep("2000")
     Send("{left down}")
     sleep("1850")
     Send("{left up}")
    sleep("1000")
     $i = $i + 1
    
until $i = 1
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
   Dim $arr[2][1000]
$i = 0
 
 do
 do
    $coord7 = PixelSearch( 0, 0, 1279, 1023,  0x0E7011, 50)
    if @ERROR Then
        PixelSearch( 0, 0, 1279, 1023, 0x0E7011, 50)
    endif
until Not @ERROR

$arr[0][$i] = $coord7[0]
$arr[1][$i] = $coord7[1]

$i = $i + 1
sleep("100")
MouseMove( $coord7[0] , $coord7[1])
sleep("300")
mousedown("left")
sleep("400")
mouseup("left")
sleep("6000")
 
    
until $i = 5
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  Dim $arr[2][1000]
$i = 0

 
 do
 do
    sleep("1000")
    $coord8 = PixelSearch( 0, 0, 1279, 1023,  0x525137, 50)
    if @ERROR Then
        PixelSearch( 0, 0, 1279, 1023,  0x525137, 50)
    endif
until Not @ERROR

$arr[0][$i] = $coord8[0]
$arr[1][$i] = $coord8[1]

sleep("100")
MouseMove( $coord8[0] , $coord8[1])
sleep("300")
mousedown("left")
sleep("400")
mouseup("left")
sleep("15000")
 $i = $i + 1
    
until $i = 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^clicks house thingy

Dim $arr[2][1000]
$i = 0
 
 do
 do
    sleep("1000")
    $coord9 = PixelSearch( 0, 0, 1279, 1023, 0x6E6666, 50)
    if @ERROR Then
        PixelSearch( 0, 0, 1279, 1023, 0x6E6666, 50)
    endif
until Not @ERROR

$arr[0][$i] = $coord9[0]
$arr[1][$i] = $coord9[1]

sleep("100")
MouseMove( $coord9[0] , $coord9[1])
sleep("300")
mousedown("left")
sleep("400")
mouseup("left")
sleep("14000")
 $i = $i + 1
    
until $i = 1

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Clicks road

Dim $arr[2][1000]
$i = 0
 
 do
 do
    sleep("1000")
    $coord10 = PixelSearch( 0, 0, 1279, 1023, 0xEFDC51, 50)
    if @ERROR Then
        PixelSearch( 0, 0, 1279, 1023, 0xEFDC51, 50)
    endif
until Not @ERROR

$arr[0][$i] = $coord10[0]
$arr[1][$i] = $coord10[1]

sleep("100")
MouseMove( $coord10[0] , $coord10[1])
sleep("300")
mousedown("left")
sleep("400")
mouseup("left")
sleep("14000")
 $i = $i + 1
    
until $i = 1


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; bank

   Dim $arr[2][1000]
$i = 0
 
 do
 do
    sleep("1000")
    $coord11 = PixelSearch( 0, 0, 1279, 1023, 0x766443, 50)
    if @ERROR Then
        PixelSearch( 0, 0, 1279, 1023, 0x766443, 50)
    endif
until Not @ERROR

$arr[0][$i] = $coord11[0]
$arr[1][$i] = $coord11[1]

sleep("100")
MouseMove( $coord11[0] , $coord11[1])
sleep("300")
mousedown("left")
sleep("400")
mouseup("left")
sleep("8000")
 $i = $i + 1
 
 until $i = 1
    
    
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; clicks bank booth
 
      Dim $arr[2][1000]
$i = 0

 do
 do

    sleep("1000")
    $coord12 = PixelSearch( 0, 0, 1279, 1023, 0x57B9BD, 50)
    if @ERROR Then
         $i = $i + 100
     endif
     
        
if not @ERROR then
$arr[0][$i] = $coord12[0]
$arr[1][$i] = $coord12[1]

sleep("100")
MouseMove( $coord12[0] , $coord12[1])
sleep("300")
mousedown("left")
sleep("400")
mouseup("left")
sleep("500")
 $i = $i + 1
 EndIf
 
 $i = $i + 1
 until $i > 100
 
 until $i > 100
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; continues
 
 
 Dim $arr[2][1000]
$i = 0
 
 do
 do
    sleep("1000")
    $coord13 = PixelSearch( 0, 0, 1279, 1023, 0x645741, 50)
    if @ERROR Then
        PixelSearch( 0, 0, 1279, 1023, 0x645741, 50)
    endif
until Not @ERROR

$arr[0][$i] = $coord13[0]
$arr[1][$i] = $coord13[1]

sleep("100")
MouseMove( $coord13[0] , $coord13[1])
sleep("300")
mousedown("left")
sleep("400")
mouseup("left")
sleep("2000")
 $i = $i + 1
 
 until $i = 1
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; exits out
 
 
  $i = 0

Do
sleep("1000")
     Send("{left down}")
     sleep("1850")
     Send("{left up}")
    sleep("1000")
     $i = $i + 1
    
until $i = 1

 
 until false
Edited by Muchuchu
Link to comment
Share on other sites

Try this. i hope it does what you want. :)

#include <GUIConstants.au3>
  
  #Region ### START Koda GUI section ### Form=
  $Form1 = GUICreate("Form1", 306, 98, 193, 125)
  $Label1 = GUICtrlCreateLabel("Press start to start the Flax picker, stop to stop it", 32, 16, 229, 17)
  ;$Button1 = GUICtrlCreateButton("Start", 64, 48, 65, 33)
  ;$Button2 = GUICtrlCreateButton("Stop", 160, 48, 73, 33)
  $CheckBox = GUICtrlCreateCheckbox("Run!",100,79,70,17)
  
  GUISetState(@SW_SHOW)
  #EndRegion ### END Koda GUI section ###
  
  While 1
      $nMsg = GUIGetMsg()
      Switch $nMsg
          Case $GUI_EVENT_CLOSE
              Exit
      EndSwitch
      If GUICtrlRead($CheckBox) = $GUI_CHECKED then Start()
  WEnd
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; BELOW IS WHERE SCRIPT STARTS
  Func Start()
  Dim $arr[2][1000]
  $i = 0
  
  Do
      Do
          Do
              Sleep("1000")
              $coord = PixelSearch(0, 0, 1279, 1023, 0xABA24E, 50)
              If @error Then
                  PixelSearch(0, 0, 1279, 1023, 0xABA24E, 50)
              EndIf
          Until Not @error
          if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
          $arr[0][$i] = $coord[0]
          $arr[1][$i] = $coord[1]
          Sleep("100")
          MouseMove($coord[0], $coord[1])
          Sleep("300")
          MouseDown("left")
          Sleep("400")
          MouseUp("left")
          if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
          Sleep("5000")
          $i = $i + 1
          if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
      Until $i = 1
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ^ CLICKS ON BANK
      if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
      Dim $arr[2][1000]
      $i = 0
  
      Do
          if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
          Do
              if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
              Sleep("1000")
              $coord2 = PixelSearch(0, 0, 1279, 1023, 0x8093ED, 50)
              If @error Then
                  PixelSearch(0, 0, 1279, 1023, 0x8093ED, 50)
              EndIf
          Until Not @error
  
          $arr[0][$i] = $coord2[0]
          $arr[1][$i] = $coord2[1]
  
          Sleep("100")
          MouseMove($coord2[0], $coord2[1])
          Sleep("300")
          MouseDown("left")
          Sleep("400")
          MouseUp("left")
          Sleep("14000")
          if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
          $i = $i + 1
  
      Until $i = 1
  
  
  
  
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^ CLICKS ON QUEST
  
      Dim $arr[2][1000]
      $i = 0
  
      Do
          if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
          Do
              if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
              Sleep("1000")
              $coord4 = PixelSearch(0, 0, 1279, 1023, 0xCDCDCC, 50)
              If @error Then
                  PixelSearch(0, 0, 1279, 1023, 0xCDCDCC, 50)
              EndIf
          Until Not @error
  
          $arr[0][$i] = $coord4[0]
          $arr[1][$i] = $coord4[1]
  
          Sleep("100")
          MouseMove($coord4[0], $coord4[1])
          Sleep("300")
          MouseDown("left")
          Sleep("400")
          MouseUp("left")
          Sleep("14000")
          if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
          $i = $i + 1
  
      Until $i = 1
  
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ^CLICKS ON YEW TREES
  
      Dim $arr[2][1000]
      $i = 0
  
      Do
          Do
              if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
              Sleep("1000")
              $coord4 = PixelSearch(0, 0, 1279, 1023, 0x577F3F, 50)
              If @error Then
                  PixelSearch(0, 0, 1279, 1023, 0x577F3F, 50)
              EndIf
          Until Not @error
  
          $arr[0][$i] = $coord4[0]
          $arr[1][$i] = $coord4[1]
          if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
  
          Sleep("100")
          MouseMove($coord4[0], $coord4[1])
          Sleep("300")
          MouseDown("left")
          Sleep("400")
          MouseUp("left")
          Sleep("10000")
          if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
          $i = $i + 1
  
      Until $i = 2
  
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^CLICKS REGULAR TREES
  
      Dim $arr[2][1000]
      $i = 0
  
      Do
          Do
              if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
              Sleep("1000")
              $coord5 = PixelSearch(0, 0, 1279, 1023, 0x6D6FB8, 50)
              If @error Then
                  PixelSearch(0, 0, 1279, 1023, 0x6D6FB8, 50)
                  $i = $i + 1
              EndIf
          Until Not $i = 1
          
  
          $arr[0][$i] = $coord5[0]
          $arr[1][$i] = $coord5[1]
  
          Sleep("100")
          MouseMove($coord5[0], $coord5[1])
          Sleep("300")
          MouseDown("left")
          Sleep("400")
          MouseUp("left")
          Sleep("10000")
          if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
          $i = $i + 1
  
      Until $i = 1
  
  
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^GOES TO FLAX
  
      Dim $arr[2][1000]
      $i = 0
  
      Do
          Sleep("2000")
          Send("{left down}")
          Sleep("1850")
          Send("{left up}")
          Sleep("1000")
          $i = $i + 1
  
      Until $i = 1
  
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
  
      Dim $arr[2][1000]
      $i = 0
  
      Do
          Do
              if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
              $coord7 = PixelSearch(0, 0, 1279, 1023, 0x0E7011, 50)
              If @error Then
                  PixelSearch(0, 0, 1279, 1023, 0x0E7011, 50)
              EndIf
          Until Not @error
  
          $arr[0][$i] = $coord7[0]
          $arr[1][$i] = $coord7[1]
  
          $i = $i + 1
          Sleep("100")
          MouseMove($coord7[0], $coord7[1])
          Sleep("300")
          MouseDown("left")
          Sleep("400")
          MouseUp("left")
          Sleep("6000")
          if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
      Until $i = 5
  
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
      Dim $arr[2][1000]
      $i = 0
  
  
      Do
          Do
              if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
              Sleep("1000")
              $coord8 = PixelSearch(0, 0, 1279, 1023, 0x525137, 50)
              If @error Then
                  PixelSearch(0, 0, 1279, 1023, 0x525137, 50)
              EndIf
          Until Not @error
  
          $arr[0][$i] = $coord8[0]
          $arr[1][$i] = $coord8[1]
  
          Sleep("100")
          MouseMove($coord8[0], $coord8[1])
          Sleep("300")
          MouseDown("left")
          Sleep("400")
          MouseUp("left")
          Sleep("15000")
          if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
          $i = $i + 1
  
      Until $i = 1
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^clicks house thingy
  
      Dim $arr[2][1000]
      $i = 0
  
      Do
          Do
              if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
              Sleep("1000")
              $coord9 = PixelSearch(0, 0, 1279, 1023, 0x6E6666, 50)
              If @error Then
                  PixelSearch(0, 0, 1279, 1023, 0x6E6666, 50)
              EndIf
          Until Not @error
          $arr[0][$i] = $coord9[0]
          $arr[1][$i] = $coord9[1]
          Sleep("100")
          MouseMove($coord9[0], $coord9[1])
          Sleep("300")
          MouseDown("left")
          Sleep("400")
          MouseUp("left")
          Sleep("14000")
          if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
          $i = $i + 1
      Until $i = 1
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Clicks road
      Dim $arr[2][1000]
      $i = 0
      Do
          Do
              if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
              Sleep("1000")
              $coord10 = PixelSearch(0, 0, 1279, 1023, 0xEFDC51, 50)
              If @error Then
                  PixelSearch(0, 0, 1279, 1023, 0xEFDC51, 50)
              EndIf
          Until Not @error
          $arr[0][$i] = $coord10[0]
          $arr[1][$i] = $coord10[1]
          Sleep("100")
          MouseMove($coord10[0], $coord10[1])
          Sleep("300")
          MouseDown("left")
          Sleep("400")
          MouseUp("left")
          Sleep("14000")
          if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
          $i = $i + 1
      Until $i = 1
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; bank
      Dim $arr[2][1000]
      $i = 0
      Do
          Do
              if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
              Sleep("1000")
              $coord11 = PixelSearch(0, 0, 1279, 1023, 0x766443, 50)
              If @error Then
                  PixelSearch(0, 0, 1279, 1023, 0x766443, 50)
              EndIf
          Until Not @error
          $arr[0][$i] = $coord11[0]
          $arr[1][$i] = $coord11[1]
          Sleep("100")
          MouseMove($coord11[0], $coord11[1])
          Sleep("300")
          MouseDown("left")
          Sleep("400")
          MouseUp("left")
          Sleep("8000")
          if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
          $i = $i + 1
      Until $i = 1
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; clicks bank booth
      Dim $arr[2][1000]
      $i = 0
      Do
          if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
          Do
              if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
              Sleep("1000")
              $coord12 = PixelSearch(0, 0, 1279, 1023, 0x57B9BD, 50)
              If @error Then
                  $i = $i + 100
              EndIf
              If Not @error Then
                  $arr[0][$i] = $coord12[0]
                  $arr[1][$i] = $coord12[1]
                  Sleep("100")
                  MouseMove($coord12[0], $coord12[1])
                  Sleep("300")
                  MouseDown("left")
                  Sleep("400")
                  MouseUp("left")
                  Sleep("500")
                  $i = $i + 1
              EndIf
              $i = $i + 1
          Until $i > 100
      Until $i > 100
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; continues
      Dim $arr[2][1000]
      $i = 0
  
      Do
          if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
          Do
              if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return
              Sleep("1000")
              $coord13 = PixelSearch(0, 0, 1279, 1023, 0x645741, 50)
              If @error Then
                  PixelSearch(0, 0, 1279, 1023, 0x645741, 50)
              EndIf
          Until Not @error
          $arr[0][$i] = $coord13[0]
          $arr[1][$i] = $coord13[1]
          Sleep("100")
          MouseMove($coord13[0], $coord13[1])
          Sleep("300")
          MouseDown("left")
          Sleep("400")
          MouseUp("left")
          Sleep("2000")
          $i = $i + 1
      Until $i = 1
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; exits out
      $i = 0
      Do
          Sleep("1000")
          Send("{left down}")
          Sleep("1850")
          Send("{left up}")
          Sleep("1000")
          $i = $i + 1
  
      Until $i = 1
  Until False
  EndFunc
You can help! Donate to AutoIt! or, visit ClimatePREDICTION.netMy posts:Travian Bot Example (100+ servers) BETAHow to Host you code/app for free! (unlimited team number) (Public or Private)"Sir, we're surrounded!" "Excellent. We can attack in any direction!"
Link to comment
Share on other sites

Linux thank you so much. Now I can decompile and figure out what everything does. Much appreciated.

no problem mate.

if the program still lags, you can make a function to replace your sleep.

Func MySleep($Mseconds)

Local $Count = 0

do

if GUICtrlRead($CheckBox) = $GUI_UNCHECKED then return

sleep(99)

$count += 100

until $Count =>$Mseconds

endfunc

this will disable the sleep in case of checking the checkbox.

its only an idea, it may be possible diferent aproaches

You can help! Donate to AutoIt! or, visit ClimatePREDICTION.netMy posts:Travian Bot Example (100+ servers) BETAHow to Host you code/app for free! (unlimited team number) (Public or Private)"Sir, we're surrounded!" "Excellent. We can attack in any direction!"
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...