Sign in to follow this  
Followers 0
Oxin8

Getting the script to run faster

4 posts in this topic

I recently made a script to automates the playing of a game but it needs to run faster. any tips will help. for example:

is it faster to do this

if $x = 1 and $a = 3 then do watever

or is it faster to do

if $x = 1 then
if $a = 3 then do watever
endif

even little things will help. also, does the script run slower if i have unused functions? thx in advance.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

AFAIK and functions are faster than If functions so the first choice is better.

A script don't run slower if it has unused functions. Since their code is never executed, if you want to be even surer. Put a exit before the Func section:

Main script:

Exit

Func 1()

EndFunc

Func2()

EndFunc

Edited by ezzetabi

Share this post


Link to post
Share on other sites

what's AFAIK? in my script i compare quite a few things. i'm leaning towards select cases instead of if statements. any general tips to speed the script up?

<{POST_SNAPBACK}>

As Far As I Know... :ph34r:

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

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