Jump to content

Script Optimizations


Recommended Posts

Posted

I'm looking for possible ways to optimize a script or lower CPU usage from my script. Are there any practices I should implement that are great for lowering CPU usage?

Also, there is something I notice with the scripts. If I use it, it will work fine normally but when I have say multiple of them running at the same time they will start to misclick with certain stuff, such as interacting with a NPC etc. Is this due to the CPU being a limiting factor or could it be something else? I am hoping to squeeze out as many bots as I can on a single server/vps.

Posted
  • Cache data as @ProjectPact mentioned
  • Avoid updating the cache every other second if it can be helped
  • Bulky logic and calculations belong in your main script loop
  • Keep rendering to a minimum and allow users to turn it off
  • Use multi-threading in places where it makes sense to handle multiple set of tasks separately
  • For power-users, script parameters > GUI
  • If the task is simple, then the code should be too. Don't go overboard with task nodes, switch-case states, etc. think 'happy path'.

Also, you should check out:

 

  • Like 4

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
  • Recently Browsing   0 members

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