S7V7N

[Helped needed] Loop questions

3 posts in this topic

#1 ·  Posted

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!

Share this post


Link to post
Share on other sites



#2 ·  Posted

Not on topic: How do I edit my post?

OT: So resuming those 2 functions or how you call it only work once every x time the rest of the script is always looping, that's what i want

Share this post


Link to post
Share on other sites

#3 ·  Posted

@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


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.