Jump to content

Stuck....


Recommended Posts

ok my autoit runs for like 45 min straight...then a message pops up saying...

Line 0: Sleep(1000) Error: Recursion level has been exceeded-AutoIt will quit prevent stack overflow.

does anybody else get this? please help me and how do i take this off so it would run like 24/7? thanks

Link to comment
Share on other sites

  • Developers

You probably keep on calling a function inside the function it self...

Something like

Func ABC()
;
    ABC()
;
Endfunc

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

sorry im a newb at this AutoIt program. i downloaded this somewhere and i have no idea how to script it or somthin. help? lol thanks

Well a good idea is to start reading the Helpfile... contains lots of good info..... :whistle:

If you know which portion of the code gives the error you can post it so we are able to help out .......

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

where can i find the help file? yea im a newb...

Download the Full install set from : http://www.hiddensoft.com/autoit3/downloads.php

After installation the AutoIt.chm will be in the program directory.

Start with the "Using AutoIt section"... that should help you on your way .....

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

Post the code that is giving you the problem. Then we can take a look at it. The error message comes from calling a function from within itself too many times. Such as:

Func Fibinacci($term)
     If $Term<1 Then
           Return 0
     ElseIf $Term<3 Then
           Return 1
     Else
           return Fibinacci($Term-1) + Fibinacci($Term-2)
     Endif
EndFunc

Notice that the Fininacci function calls itself with two different arguments to determine the value it should return. In many cases of recurssion, like the Fininacci function, there is often a non-recursive solution that is easier on memory, processing and execution time.

Func Fibiniacci($Term)
     Local $x1, $x2, $x3, $i

     If $Term<1 Then
           Return 0
     ElseIf $Term<3 Then
           Return 1
     Else
           $x1 = 1
           $x2 = 1
           For $i = 3 to $Term
               $x3 = $x1 + $x2
               $x1 = $x2
               $x2 = $x3
           Next
     Endif
     Return $x2
EndFunc

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Link to comment
Share on other sites

What script are you running? Can you please post it?

The people here are very helpful, but are not mind readers  :whistle:  You need to tell us more about what you are doing with AutoIt for us to help

$5 says its a bot for a game... If I'm right, does that make me a mind reader? If I'm right, do I get $5?
Link to comment
Share on other sites

valik how smart of u and u r correct! n e wayz i told u guys that im a newb and i just downloaded this(not the AutoIt program i downloaded THIS PROGRAM dat had all the scripts done) so i didnt make the script. hope that helps a little

Helps us understand, but not really to help us help you.

OK, I think that there is a plan of action for you to try to find out what's going on.

First ensure that you have a copy of the AutoIt3 help file (see AutoIt Download, the help file is part of the AutoIt download)

Next copy your script to a temporary file and open the copy in a Text Editor. Notepad (or Wordpad) will do if you haven't got anything else, although an editor with AutoIt syntax highlighting will help a lot

Go through the script making sure that it is indented properly. By this I mean that after every control statement you indent subsequent lines by 2 spaces, say. This indentation continues until you reach another control statement, when you indent by another 2 spaces, or the matching control end statement, when you un-indent (undent :whistle: ) by two spaces. The control statements, with examples, are:

Do
    statements
    ...
Until <exp[b][/b]ression>

For <variable> = <start> TO <stop> [Step <stepval>]
    statements
    ...
Next

Func functioname ( [ByRef] $param1, ..., [ByRef] $paramN)
    ...
    [Return [value]]
EndFunc

If <exp[b][/b]ression> Then
    statements
    ...
[ElseIf exp[b][/b]ression-n Then
    [elseif statements ... ]]
    ...
[Else
    [else statements]
    ...
EndIf

Select
    Case <exp[b][/b]ression>
        statement1
        ...
    [Case 
        statement2
        ...]
    [Case Else
        statementN
        ...]
EndSelect

While <exp[b][/b]ression>
    statements
    ...
WEnd

If you have done this properly, then the last statement in the file will be in the first column (lined up with the first statement in the file)

Identify all cases of recursion, i.e. where a function calls itself (see Valik's earlier post). Check that all such cases of recursion have a terminating condition, i.e. there must be a path through the function that does not call itself, this means that there must be a control statement (usually an If) and/or a return statement in the middle.

Identify all cases of mutual recursion, i.e. when one function calls another, which in turn calls the first one. For example

Func Foo()
  Bar()
EndFunc

Func Bar()
  Foo()
EndFunc

The problem here is that it won't be as obvious as this and could easily involve more than two functions. Again check for terminating conditions

You can ignore all calls to AutoIt functions (that is why you need the help file, to allow you to identify these). It is possible that you have uncovered a bug in AutoIt but very unlikely - much more likely that the script has an error

OK, if you do this then you should be able to see where it is going wrong - perhaps. Experienced programmers basically have the ability to mentally do this, which is why we've asked you to post the script itself.

If you cannot see the problem yourself, then lets sanitise the script a bit more

Take the copy of the script (you did do this didn't you) and replace all of the following statements

MouseClick(...)

MouseDown(...)

MouseMove(...)

MouseUp(...)

Send(...)

with STUFF()

Replace multiple consecutive STUFF() statements with a single STUFF() statement

Replace the names of all files in the Run(...) and RunWait(...) statements with dummy names, similarly replace all the names of window titles in WinXXX(..) commands with dummy names (where WinXXX is any of the commands in the Window Management section of the help file).

You can also change the names of functions, or anything else that you think that could identify your game and what you are trying to do in it, to something a bit blander (use Func1, Func2, Func3, etc. for function names, for example).

Now do you think that the sanitised script is vague enough to allow you to post it? If not could you email it to me?

GrahamS

Link to comment
Share on other sites

sorry im lost. i can not find the original script cuz i dont know where. if u have aim or something i will send you the program i downloaded and maybe you could find the script. yea there is nothing that was included when i downloaded the program..except the program itself with the scripts done...no other folders no nothing. thanks

Link to comment
Share on other sites

If it's already been compiled, then there is nothing any of us can do to help you. Since what you say tells me that it is, the only way to "fix" it is to learn AutoIt and write your own or try to find the source files(s) on the website.

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