Matenia 628 Posted May 15, 2019 Share Posted May 15, 2019 Hey @Droidz is Lua.LuaDoString using a lock? I'm trying to figure something out. When I lock frames, my entire combat iterations works very fast. When I don't freeze them, it's very slow (about 8 times slower, even when putting a lock on ObjectManager.Locker). I have optimized my framework quite a lot in recent times and still don't understand why things can take as long as they do sometimes. I thought it might have something to do with me utilizing multi threading. Just trying to understand wRobot better and I happen to use a lot of Lua instead of reading from memory directly. TheSmokie 1 Link to comment https://wrobot.eu/forums/topic/11228-is-lualuadostring-using-a-lock/ Share on other sites More sharing options...
TheSmokie 242 Posted May 15, 2019 Share Posted May 15, 2019 I was wondering this question also, I thought it was because my pc is a few cans shy of a vista but I’m wondering now. Link to comment https://wrobot.eu/forums/topic/11228-is-lualuadostring-using-a-lock/#findComment-53636 Share on other sites More sharing options...
Droidz 2738 Posted May 15, 2019 Share Posted May 15, 2019 Hello, (when you don't use lock frame) Lua is slow because WRobot need to inject code in wow (that run in next frame refresh). If you call 5 times lua (on 1 thread) you need to wait ~5 wow frames, ~80ms with 60 fps. You can: - lockframe (it is a easier way, and in some case better) - avoid to use lua (but a lot of wrobot api methods use lua it is hard to know what methods you can use or not) - try to avoid useless lua call (by sample if you use "if (lua.do("is ok") && me.health < 10 && me.havetarget)" replace it by "if (me.havetarget && me.health < 10 && lua.do("is ok"))" - combine your lua scripts (if you use several lua calls in one condition try to combine it to one call) BetterSister, TheSmokie and duthibaut 2 1 Link to comment https://wrobot.eu/forums/topic/11228-is-lualuadostring-using-a-lock/#findComment-53656 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now