someguy567 Posted September 6, 2018 Posted September 6, 2018 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.
ProjectPact Posted September 6, 2018 Posted September 6, 2018 Caching data would be a great place to start! 2
liverare Posted September 9, 2018 Posted September 9, 2018 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: 4
Alek Posted September 11, 2018 Posted September 11, 2018 Anything that you're painting. Scripts with fancy paints are certainly more cpu expensive than a script with absolutely no paint.
liverare Posted September 11, 2018 Posted September 11, 2018 6 hours ago, Alek said: Anything that you're painting. Scripts with fancy paints are certainly more cpu expensive than a script with absolutely no paint. Perhaps it's worth adding some sort of box you can tick/script parameter you can enter to forcibly turn it off/on.
Alek Posted September 11, 2018 Posted September 11, 2018 21 minutes ago, liverare said: Perhaps it's worth adding some sort of box you can tick/script parameter you can enter to forcibly turn it off/on. Low resource mode, if I have the checkbox there I will have complaints that users cant see their paints, even if it says "Disable paint". 1
flakeybanana Posted September 11, 2018 Posted September 11, 2018 Extra question : Will switching from webwalk to path's significantly reduce resource usage?
urmom Posted September 14, 2018 Posted September 14, 2018 On 9/11/2018 at 3:11 PM, flakeybanana said: Extra question : Will switching from webwalk to path's significantly reduce resource usage? it will