Sign in to follow this  
Followers 0
rtk217

plz help me improve the code

20 posts in this topic

#1 ·  Posted (edited)

plz help me improve this code

and also answer my question something in this code crashes after a while with error about recursive function

even though i havent set up any recursive functions at all.

any improvement to the code will be helpful

ohh and ignore the messy GUI thats not the problem here

can u plz tell me about the function of memopen, memclose, memwrite, memread

what variables should i put inside those and what will this functions return

here is the link to au3

http://planet.nana.co.il/rtk217de/macrosjmem.au3

Edited by rtk217

Share this post


Link to post
Share on other sites



plz help me improve this code

and also answer my question something in this code crashes after a while with error about recursive function

even though i havent set up any recursive functions at all.

any improvement to the code will be helpful

ohh and ignore the messy GUI thats not the problem here

dude thats a long code to check, upload the au3 file and post the link in the topic here, that would help

Share this post


Link to post
Share on other sites

plz help me

the code above give me after 20 minutes of running an error that says "recursive error exceeded to prever stack overflow the program is going to be closed"

Share this post


Link to post
Share on other sites

Your link is down so i cant have a look at your code ... Although from what i read a look wouldnt be enough...

I suspect that you either use a continuously growing array (_ArrayAdd maybe) or creating new variables until AutoIt reaches its limits....

Share this post


Link to post
Share on other sites

you can just attach a file here why not try that

when you post a message you can add it to the post.

And it will be on the autoit forum server

Share this post


Link to post
Share on other sites

ok the exact error is:

recursion level has been exceeded - autoit will now terminate program in order to prever stack overflow.

mse.au3

Share this post


Link to post
Share on other sites

ok the exact error is:

recursion level has been exceeded - autoit will now terminate program in order to prever stack overflow.

Made some changes, you are calling the function main repeatedly, i believe that's the recursion problem, can't test this but this might fix your problem, also added _Exit function, and updated _IsPressed function so that dll is only opened 1 time and then closed upon exit.

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

naaa still have the recursive problem

im thinking of reprogramming this program

maybe make an include file with some of the commands in function main.

u are correct its main that causes this to happen

but i still dont understand why, the function doesnt call it self or inherit itself.

meanwhile i did that after 300 runs of function main ( i read in the help file of autoit that recursive maximum is 384) the program restarts itself.

plz i need something better

Share this post


Link to post
Share on other sites

Ok, lets follow the path.

setup is called

block or main is called

if block is called, main is called from block

in main

if attack is called from main, attack calls main, hmmm recursion?

probably more.....


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

man iyt doesnt happen at the spot

it happens after like 30 minutes of the program running

im thinking myself

recursion is a function that calls itself or a function that calls another function to call her but uses inhertiage of its own defined variables.

there is no recursion

should i write another func that will be called from attack and then call main?

i really dont know where this gone wrong

Edited by rtk217

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

Here is a simple version of what your doing with those 2 function as an example:

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

so can u give me any other solutions to solve this problem?

Share this post


Link to post
Share on other sites

don't call main from attack function, as you can see from the example, main will resume once the attack function is done.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

gafrost is very sharp.... he taught me how to do many things in Autoit

i call him Mr. Wizard..

my suggestion.... listen to him'

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

well at first attack was part of main

so i think im gonna put that back in main and improve some functions in the code.

any suggestions how to make it more efficiant in resources and size?

ok this is the new code hope it will work without bugs!

mse.au3

Edited by rtk217

Share this post


Link to post
Share on other sites

I don't know if this will actually help make it more efficient or not, but maybe grabbing only the functions you need from your include files and putting it in your code instead of including the whole file. This way, it's only including the lines you need for your code, and not the hundreds of lines that you won't use anyway (because when you #include a file, it will append that whole file to your script when you make it a .exe

Share this post


Link to post
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
Sign in to follow this  
Followers 0