Jump to content

Script Optimizations


someguy567

Recommended Posts

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.

Link to comment
Share on other sites

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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