RonSwanson 2 Posted January 24, 2017 Share Posted January 24, 2017 So I am working on a new warlock Fight Class in C# and I can get it to cast demon armor but I cant get it to cast any other spells. My debug I get [D] 23:57:55 - [Spell] Demon Skin (Id found: 687, Name found: Demon Skin, NameInGame found: Demon Skin, Know = True, IsSpellUsable = False) But that happens for every spell I try to cast. Also how would I get a if statement in the void walker , I need to check if an item = soul shard is in the inventory and the item count >= 1. API would be sexy lmao. Also how can I set my pet to attack? ObjectManager.Pet doesnt have an attack method. Also how can I check if my pet is tanking the mob? Last thing, I need to figure out how check if my target has a curse on him or not. Thanks! Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/ Share on other sites More sharing options...
iMod 99 Posted January 24, 2017 Share Posted January 24, 2017 3 hours ago, Doobie said: So I am working on a new warlock Fight Class in C# and I can get it to cast demon armor but I cant get it to cast any other spells. My debug I get [D] 23:57:55 - [Spell] Demon Skin (Id found: 687, Name found: Demon Skin, NameInGame found: Demon Skin, Know = True, IsSpellUsable = False) But that happens for every spell I try to cast. Also how would I get a if statement in the void walker , I need to check if an item = soul shard is in the inventory and the item count >= 1. API would be sexy lmao. Also how can I set my pet to attack? ObjectManager.Pet doesnt have an attack method. Also how can I check if my pet is tanking the mob? Last thing, I need to figure out how check if my target has a curse on him or not. Thanks! First tipp: Create a simple xml routine with one spell and the conditions you need and check the generated C# code. If you want to check items use: ItemsManager.GetItemCountById(1234) > 0 For your pet attack you could use lua: Lua.LuaDoString("PetAttack();"); You can check the target of the mob: WoWUnit target = ObjectManager.Me.TargetObject if (target.TargetObject != ObjectManager.Pet) { // Do something } If you want to check the debuff's at your target: Spell debuff = new Spell("DebuffName"); bool hasDebuff = ObjectManager.Me.TargetObject.HaveBuff(debuff.Ids); All that stuff is not tested but i hope it will help you out. Greez iMod RonSwanson 1 Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22269 Share on other sites More sharing options...
RonSwanson 2 Posted January 25, 2017 Author Share Posted January 25, 2017 17 hours ago, iMod said: First tipp: Create a simple xml routine with one spell and the conditions you need and check the generated C# code. If you want to check items use: ItemsManager.GetItemCountById(1234) > 0 For your pet attack you could use lua: Lua.LuaDoString("PetAttack();"); You can check the target of the mob: WoWUnit target = ObjectManager.Me.TargetObject if (target.TargetObject != ObjectManager.Pet) { // Do something } If you want to check the debuff's at your target: Spell debuff = new Spell("DebuffName"); bool hasDebuff = ObjectManager.Me.TargetObject.HaveBuff(debuff.Ids); All that stuff is not tested but i hope it will help you out. Greez iMod thanks any clue how to Stop Auto attacks? lmao Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22350 Share on other sites More sharing options...
iMod 99 Posted January 25, 2017 Share Posted January 25, 2017 Lua.DoString("StopAttack()"); This should prevent you from doing auto attacks, I'm not sure if the bot uses auto attack. if yes it could make problems in stopping it. Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22383 Share on other sites More sharing options...
RonSwanson 2 Posted January 25, 2017 Author Share Posted January 25, 2017 18 minutes ago, iMod said: Lua.DoString("StopAttack()"); This should prevent you from doing auto attacks, I'm not sure if the bot uses auto attack. if yes it could make problems in stopping it. Okay I will try think I tried that and it gave me a LUA error ingame dunno if thats a function in Lua. Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22386 Share on other sites More sharing options...
iMod 99 Posted January 25, 2017 Share Posted January 25, 2017 47 minutes ago, Doobie said: Okay I will try think I tried that and it gave me a LUA error ingame dunno if thats a function in Lua. It is a lua function. Which extension are you using? Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22393 Share on other sites More sharing options...
RonSwanson 2 Posted January 25, 2017 Author Share Posted January 25, 2017 1 hour ago, iMod said: It is a lua function. Which extension are you using? Thats the error im getting. Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22405 Share on other sites More sharing options...
iMod 99 Posted January 25, 2017 Share Posted January 25, 2017 32 minutes ago, Doobie said: Thats the error im getting. oh i think it should be Lua.DoString("StopAttack();"); Forgot the ; at the end of the lua command. If that wont work i'm out of ideas =/ i'm not that pro in lua commands. Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22415 Share on other sites More sharing options...
RonSwanson 2 Posted January 25, 2017 Author Share Posted January 25, 2017 2 minutes ago, iMod said: oh i think it should be Lua.DoString("StopAttack();"); Forgot the ; at the end of the lua command. I am using Lua.LuaDoString("StopAttack();"); And am getting the same error are you sure thats a method? Maybe I can try running a macro? Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22417 Share on other sites More sharing options...
iMod 99 Posted January 25, 2017 Share Posted January 25, 2017 Just now, Doobie said: I am using Lua.LuaDoString("StopAttack();"); And am getting the same error are you sure thats a method? Well the documentation says it ishttp://wowprogramming.com/docs/api/StopAttack Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22418 Share on other sites More sharing options...
RonSwanson 2 Posted January 25, 2017 Author Share Posted January 25, 2017 2 minutes ago, iMod said: Well the documentation says it ishttp://wowprogramming.com/docs/api/StopAttack Hmm I also tried Lua.RunMacroText("/stopattack") but nothing. I just want to be able to cast an ability without making the bout pulling out its weapon as what caster casts then gets his weapon out. Doesnt make sense. Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22420 Share on other sites More sharing options...
iMod 99 Posted January 25, 2017 Share Posted January 25, 2017 4 minutes ago, Doobie said: Hmm I also tried Lua.RunMacroText("/stopattack") but nothing. I just want to be able to cast an ability without making the bout pulling out its weapon as what caster casts then gets his weapon out. Doesnt make sense. Damn that was my other idea :D Well maybe you need to check the general bot setting. I'm not sure but i think there was a option for autoattacks. Found nothing like auto attack in the libs. May thats a question for @Droidz Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22421 Share on other sites More sharing options...
RonSwanson 2 Posted January 25, 2017 Author Share Posted January 25, 2017 15 minutes ago, iMod said: Damn that was my other idea :D Well maybe you need to check the general bot setting. I'm not sure but i think there was a option for autoattacks. Found nothing like auto attack in the libs. May thats a question for @Droidz Okay lol! [E] 17:15:29 - RunMacroText(string macro): System.NotImplementedException: RunMacroText(string macro) not impremented in WRobot for 1.12.1 at wManager.Wow.Helpers.Lua.RunMacroText(String macro) Thats the error I get when I try running a macro in the vanilla API @Droidz Is there a way to control auto attacks like toggle on and off with the C# Api? If not can we get that functonality. As auto attacking is fine levels 1 - 6 for example. But around 10 + ideally a caster will just be casting and wanding. Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22426 Share on other sites More sharing options...
iMod 99 Posted January 25, 2017 Share Posted January 25, 2017 Oh okay xD thats why i was asking what kind of extension you are playing ;) Those lua commands are not available in vanilla i think. So yeah @Droidz need to implement the macro method ;) not sure if that ever happen but just write him a message and ask him about it. Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22427 Share on other sites More sharing options...
Droidz 2738 Posted January 25, 2017 Share Posted January 25, 2017 Hello, in wow vanilla he doesn't have RunMacroText() and StopAttack() lua function (you can found lua api of vanilla here: http://vanilla-wow.wikia.com/wiki/World_of_Warcraft_API ). Why do you want stop AutoAttack? Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22428 Share on other sites More sharing options...
Droidz 2738 Posted January 25, 2017 Share Posted January 25, 2017 Use this lua code to disable autoattack: if (PlayerFrame.inCombat) then ClearTarget(); TargetLastTarget(); end Don't forget also to put range better than 15 yards at your fightclass (if range is smaller than 15 yards, wrobot relaunch autoattack), you can found this option in top/left of fightclass editor, or you can also with this c# code like here line 19. Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22432 Share on other sites More sharing options...
RonSwanson 2 Posted January 26, 2017 Author Share Posted January 26, 2017 4 hours ago, Droidz said: Use this lua code to disable autoattack: if (PlayerFrame.inCombat) then ClearTarget(); TargetLastTarget(); end Don't forget also to put range better than 15 yards at your fightclass (if range is smaller than 15 yards, wrobot relaunch autoattack), you can found this option in top/left of fightclass editor, or you can also with this c# code like here line 19. @iMod UPDATE: I have figured out how to check how many mobs are attacking me, now I need to check how many are attacking my pet. (: Works like a charm you are awesome! Okay now my next task that I cant figure out is trying to figure out if I have pulled more then 1 target. Just need to be able to see is more then one target is attacking myself and or my pet :b. The fight class is coming along very nicely, thanks for all the help so far guys :D. Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22450 Share on other sites More sharing options...
Droidz 2738 Posted January 26, 2017 Share Posted January 26, 2017 11 hours ago, Doobie said: UPDATE: I have figured out how to check how many mobs are attacking me, now I need to check how many are attacking my pet. (: http://wrobot.eu/forums/topic/4861-multitarget-rotation-c-trouble/?do=findComment&comment=22484 Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22485 Share on other sites More sharing options...
iMod 99 Posted January 26, 2017 Share Posted January 26, 2017 /// <summary> /// Gets all specified units in the specified range /// </summary> /// <param name="range">The range we are looking in</param> /// <param name="objectType">The type of object we are looking for</param> /// <returns>Returns a list of all available units of the given type</returns> public static IEnumerable<WoWUnit> GetUnits(int range, WoWObjectType objectType) { // Get units IEnumerable<WoWUnit> results = ObjectManager.GetWoWUnitHostile().Where(u => u.Type == objectType && u.IsAlive && (u.GetDistance <= range) && u.IsAttackable); // Return return results; } Get all mobs who attack your pet in a range of 15 (range based of your character not your pet) int attackingUnits = This.GetUnits(40, WoWObjectType.Units).Count(t => t.TargetObject == ObjectManager.Pet); Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22488 Share on other sites More sharing options...
RonSwanson 2 Posted January 27, 2017 Author Share Posted January 27, 2017 13 hours ago, Droidz said: http://wrobot.eu/forums/topic/4861-multitarget-rotation-c-trouble/?do=findComment&comment=22484 Thanks for all the help, do you guys know how to cast wand in C#? I can get the bot to cast it but like it never full casts because it seems like the wand spell keeps just getting toggled. I am using Spell.launch() to fire off the spell "Shoot" @Droidz @iMod Link to comment https://wrobot.eu/forums/topic/4819-isspellusable-always-false/#findComment-22536 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