Jump to content

infinite loop not creating


Recommended Posts

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

 

Link to comment
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

Link to comment
Share on other sites

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


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

Link to comment
Share on other sites

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

I would guess Ashen Empires


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

Link to comment
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

Link to comment
Share on other sites

  • Moderators

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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

Link to comment
Share on other sites

  • Developers

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

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

  • Developers

what you mean ignore ppl?

Ok, let me try then: What is the purpose of the script you are creating?

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

  • Developers

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?

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

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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