Jump to content

Getting the script to run faster


Oxin8
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Developers

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:

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

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