Sign in to follow this  
Followers 0
destluck

infinite loop not creating

18 posts in this topic

Alright so i have this script and  when i run its it executes once then stops why is that?

while 1
   $aPixel = PixelSearch(417, 680, 435, 691, 0xEF4A4A)
   If IsArray($aPixel) = False Then
      WinActivate("text")
      WinWaitActive("text")
      Local $coord = PixelSearch(354, 238, 457, 339, 0x7B1818)
         MouseMove($coord[0], $coord[1])
         MouseClick("left")
      EndIf
      sleep(10)
WEnd

 

Share this post


Link to post
Share on other sites



Stops, or exits? Because if you mean it pauses, it's probably because the WinWaitActive is waiting for the window to appear and be active, and if that doesn't happen it's going to wait forever, or at least until you close the script manually.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

nah just exits the script its no more in my tray at the bottom

Share this post


Link to post
Share on other sites

Perhaps the game you are using it on is closing the script



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

What game is it for? Some have anti-bot measures in place.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

What game is it for? Some have anti-bot measures in place.

I would guess Ashen Empires



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

the second script i posted works fine but not the first. would you guys think i scipted something wrong.

the first scriot i posted in the thread  executes the script once. and instead of checking again like a infinite loop it just stops

Share this post


Link to post
Share on other sites

no your code is correct and it runs on my machine. does it also stop when your game is not running ?


[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites

it runs fine untill the conditions to enter the IF statement are valid, then it executes the IF statement and then the script stops instead of starting over.

is there a alternate way i could make the loop infinite

Share this post


Link to post
Share on other sites

bad luck :thumbsdown:


[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

I would guess Ashen Empires

 

I doubt it, destluck has already been Moderated for game related posts, and told not to start another. I'm sure he's not that stupid ;)

So as soon as he tells us what application he's trying to manipulate, we can help :)

Edited by JLogan3o13
1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

i know some programmnig languages have Jumpto or call functions

does Autoit have em i cant seem to find it.

i could just have the script run and then do a call function/jumpto to bring it back to the top of the script

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

i know some programmnig languages have Jumpto or call functions

does Autoit have em i cant seem to find it.

i could just have the script run and then do a call function/jumpto to bring it back to the top of the script

Nope, try reading some more in the helpfile and doing a little more research before asking.... this is one of those that have been asked many times.

Also am wondering how long you think you can ignore people here and still continue to ask questions.

Jos

Edited by Jos

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

Share this post


Link to post
Share on other sites

what you mean ignore ppl?

Share this post


Link to post
Share on other sites

oh that im trying to have a task repeat itself over and over

Share this post


Link to post
Share on other sites

oh that im trying to have a task repeat itself over and over

Please do not BS with me, you get one more chance: What are you trying to automate with the initial script posted?


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        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.
Sign in to follow this  
Followers 0