penumbra 4 Posted May 14, 2019 Share Posted May 14, 2019 Hello all, Has anyone built a C# script that automatically removes curses/poison or magic? I have been unable to find any examples of this Thanks! Link to comment https://wrobot.eu/forums/topic/11222-decursingcleansing-in-c/ Share on other sites More sharing options...
Zan 99 Posted May 14, 2019 Share Posted May 14, 2019 Did you try searching? Your answer is on the forums. Link to comment https://wrobot.eu/forums/topic/11222-decursingcleansing-in-c/#findComment-53600 Share on other sites More sharing options...
penumbra 4 Posted May 14, 2019 Author Share Posted May 14, 2019 31 minutes ago, Zan said: Did you try searching? Your answer is on the forums. Yes, all I could find was some Lua code, but nothing in C# that I could use Link to comment https://wrobot.eu/forums/topic/11222-decursingcleansing-in-c/#findComment-53604 Share on other sites More sharing options...
TheSmokie 242 Posted May 14, 2019 Share Posted May 14, 2019 33 minutes ago, penumbra said: Yes, all I could find was some Lua code, but nothing in C# that I could use Link to comment https://wrobot.eu/forums/topic/11222-decursingcleansing-in-c/#findComment-53605 Share on other sites More sharing options...
penumbra 4 Posted May 14, 2019 Author Share Posted May 14, 2019 28 minutes ago, The Smokie. said: Hey, this is a bit different. This looks for a specific debuff I am looking for function that can search through the debuffs for curse/magic etc. and then cast, I would not have the spell IDs of all the world afflictions Link to comment https://wrobot.eu/forums/topic/11222-decursingcleansing-in-c/#findComment-53606 Share on other sites More sharing options...
TheSmokie 242 Posted May 14, 2019 Share Posted May 14, 2019 4 minutes ago, penumbra said: Hey, this is a bit different. This looks for a specific debuff I am looking for function that can search through the debuffs for curse/magic etc. and then cast, I would not have the spell IDs of all the world afflictions Best bet is to add each spell Link to comment https://wrobot.eu/forums/topic/11222-decursingcleansing-in-c/#findComment-53607 Share on other sites More sharing options...
Marsbar 228 Posted May 14, 2019 Share Posted May 14, 2019 5 minutes ago, penumbra said: Hey, this is a bit different. This looks for a specific debuff I am looking for function that can search through the debuffs for curse/magic etc. and then cast, I would not have the spell IDs of all the world afflictions That's why you should run a little bit of LUA in your C#. There isn't an in built C# function for this. LUA is definitely the best way as it returns the specific debuff type. Link to comment https://wrobot.eu/forums/topic/11222-decursingcleansing-in-c/#findComment-53608 Share on other sites More sharing options...
penumbra 4 Posted May 14, 2019 Author Share Posted May 14, 2019 8 minutes ago, Marsbar said: That's why you should run a little bit of LUA in your C#. There isn't an in built C# function for this. LUA is definitely the best way as it returns the specific debuff type. Thanks, Im trying the following public bool hasDisease = false; hasDisease = Lua.LuaDoString<bool>("for i=1,40 do local texture, count, debuffType = UnitDebuff('player', i); if debuffType == 'Disease' then return true break; end end"); if (hasDisease && SpellManager.SpellUsableLUA("Abolish Disease") && ObjectManager.Me.ManaPercentage > 10 && !ObjectManager.Me.HaveBuff("Abolish Disease")) { Interact.InteractGameObject(ObjectManager.Me.GetBaseAddress); AbolishDisease.Launch(); Lua.LuaDoString("ClearTarget();"); hasDisease = false; } But that does not seem to work Link to comment https://wrobot.eu/forums/topic/11222-decursingcleansing-in-c/#findComment-53609 Share on other sites More sharing options...
penumbra 4 Posted May 14, 2019 Author Share Posted May 14, 2019 2 minutes ago, The Smokie. said: Is this for a fightclass or a quester? fightclass Link to comment https://wrobot.eu/forums/topic/11222-decursingcleansing-in-c/#findComment-53611 Share on other sites More sharing options...
Marsbar 228 Posted May 14, 2019 Share Posted May 14, 2019 9 minutes ago, penumbra said: Thanks, Im trying the following public bool hasDisease = false; hasDisease = Lua.LuaDoString<bool>("for i=1,40 do local texture, count, debuffType = UnitDebuff('player', i); if debuffType == 'Disease' then return true break; end end"); if (hasDisease && SpellManager.SpellUsableLUA("Abolish Disease") && ObjectManager.Me.ManaPercentage > 10 && !ObjectManager.Me.HaveBuff("Abolish Disease")) { Interact.InteractGameObject(ObjectManager.Me.GetBaseAddress); AbolishDisease.Launch(); Lua.LuaDoString("ClearTarget();"); hasDisease = false; } But that does not seem to work What expansion are you on? Your LUA looks incorrect. Using https://vanilla-wow.fandom.com/wiki/API_UnitDebuff as an example, debufftype would be the 5th property, not the 3rd like in your example. In lua you need to declare all the other properties before the one you want so you could do local _, _, _, _, debuffType = UnitDebuff('player', i) Link to comment https://wrobot.eu/forums/topic/11222-decursingcleansing-in-c/#findComment-53612 Share on other sites More sharing options...
penumbra 4 Posted May 14, 2019 Author Share Posted May 14, 2019 5 minutes ago, Marsbar said: What expansion are you on? Your LUA looks incorrect. Using https://vanilla-wow.fandom.com/wiki/API_UnitDebuff as an example, debufftype would be the 5th property, not the 3rd like in your example. In lua you need to declare all the other properties before the one you want so you could do local _, _, _, _, debuffType = UnitDebuff('player', i) Thanks, I am on WOTLK Link to comment https://wrobot.eu/forums/topic/11222-decursingcleansing-in-c/#findComment-53613 Share on other sites More sharing options...
Matenia 628 Posted May 14, 2019 Share Posted May 14, 2019 The parameters you're using in your Lua are vanilla. Link to comment https://wrobot.eu/forums/topic/11222-decursingcleansing-in-c/#findComment-53614 Share on other sites More sharing options...
penumbra 4 Posted May 14, 2019 Author Share Posted May 14, 2019 For those that come later: The following work for WOTLK hasDisease = Lua.LuaDoString<bool>("for i=1,40 do local _, _, _, _, debuffType = UnitDebuff('player', i); if debuffType == 'Disease' then return true; end end"); if (hasDisease && SpellManager.SpellUsableLUA("Abolish Disease") && ObjectManager.Me.ManaPercentage > 10 && !ObjectManager.Me.HaveBuff("Abolish Disease") && !ObjectManager.Me.InCombatFlagOnly) { Interact.InteractGameObject(ObjectManager.Me.GetBaseAddress); AbolishDisease.Launch(); Lua.LuaDoString("ClearTarget();"); hasDisease = false; } Marsbar 1 Link to comment https://wrobot.eu/forums/topic/11222-decursingcleansing-in-c/#findComment-53625 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