Jump to content

[Helped needed] Loop questions


 Share

Recommended Posts

Hey guys!

So i have a question on how I can make a script work, not dealing so good with this one

I want to make loops inside loops if possible

I want it to do 1 thing and wait like 5 minutes to do it again but everytime i try it the next step on the scripts waits 5 minutes to work

I want it to infinite do that inside the script but somehow don't mess with the rest of the script

While 1
       Local $i = 0
       Do
  ;find a mob
      $mob = PixelSearch($x1,$y1,$x2,$y2,$HuntingForColor,10)
      if not @error Then
      ;attack the mob
      MouseClick("left", $mob[0], $mob[1], 1, 1)
      Sleep(10000)
   EndIf
       Until $i = 0

;are we wealthy enough?
      $pot = PixelSearch(884, 323,1061, 531,0x000002,1)
      $hpBar = PixelSearch(866, 125,894, 137, 0x00FF00, 1)
      if @error Then
      ;eat
      MouseClick("left",910,299,1,1)
      Sleep(0800)
      EndIf
      
      While 1       <- I want this to be made every 10 minutes but don't mess with the rest of the script
      $hpBar = PixelSearch(866, 125,894, 137, 0x00FF00, 1)
      if @error Then
      ;eat
      MouseClick("left",910,299,1,1)
      Sleep(600000)
      EndIf
      Wend
      
      While 1       <- I want this to be made every 5 minutes but don't mess with the rest of the script
      ;find a mob
      $mob = PixelSearch($x1,$y1,$x2,$y2,$HuntingForColor,10)
      if not @error Then
      ;attack the mob
      MouseClick("left", $mob[0], $mob[1], 1, 1)
      Sleep(300000)
   EndIf
   Wend
Wend

Example how i wanted it to work (but it doesn't) ^ hope you get the point :P

Any help is appreciated!

Link to comment
Share on other sites

  • Developers

@S7V7N,

Welcome to the AutoIt forum. :)

Unfortunately you appear to have missed the Forum rules on your way in. (there is also a link in my signature) 
Please read them now particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. :naughty:

See you soon with a legitimate question I hope. :)

Jos

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

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