Matenia 628 Posted March 17, 2017 Share Posted March 17, 2017 Is there any way in my fight class to execute Lua code, whenever I die, once? I want it to call ReloadUI() to prevent the combat rotation from stopping randomly on a MoP client. I tried some custom scripts, but the bot never executed them (and there is that issue of only doing it ONCE too). Link to comment https://wrobot.eu/forums/topic/5407-executing-lua-code-only-once-after-i-die/ Share on other sites More sharing options...
Droidz 2738 Posted March 17, 2017 Share Posted March 17, 2017 Hello, in the fightclass editor, in "Additionnal C# code" (top left) put this code: static Main() { bool lastState = false; while (Conditions.ProductIsStarted) { if (Conditions.InGameAndConnectedAndProductStartedNotInPause && !Conditions.IsAttackedAndCannotIgnore) { if (lastState && !ObjectManager.Me.IsDeadMe) { Logging.WriteDebug("Retrieve corpse, ReloadUI"); Lua.LuaDoString("ReloadUI()"); } lastState = ObjectManager.Me.IsDeadMe; } Thread.Sleep(100); } } Link to comment https://wrobot.eu/forums/topic/5407-executing-lua-code-only-once-after-i-die/#findComment-24905 Share on other sites More sharing options...
Matenia 628 Posted March 17, 2017 Author Share Posted March 17, 2017 That bugs it entirely, so the bot only keeps working if I turn it on/off (for one fight, but it doesn't run unless I turn it on, and doesn't fight unless I turn it off). Probably a multithreading issue. But it's okay, I'll use this to write a custom plugin instead. Link to comment https://wrobot.eu/forums/topic/5407-executing-lua-code-only-once-after-i-die/#findComment-24908 Share on other sites More sharing options...
Droidz 2738 Posted March 17, 2017 Share Posted March 17, 2017 If you want than WRobot stop to reloadui you can change settings here http://wrobot.eu/forums/topic/4918-since-last-update-the-bot-spams-reloadui/?do=findComment&comment=22750 Link to comment https://wrobot.eu/forums/topic/5407-executing-lua-code-only-once-after-i-die/#findComment-24925 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