Jump to content

reapler

Elite user
  • Posts

    288
  • Joined

  • Last visited

Reputation Activity

  1. Like
    reapler got a reaction from Apexx in Check If Target Has a Weapon   
    Well, you can use these methods to check your unit:
    /// <summary> /// Used to get the main hand weapon of an unit. /// </summary> /// <remarks>Using 3.3.5a(12340) offsets.</remarks> /// <param name="unit">The unit.</param> public int MainHandId(WoWUnit unit) { if (unit.PlayerControlled) return wManager.Wow.Memory.WowMemory.Memory.ReadInt32(unit.GetDescriptorAddress(0x4E4)); return wManager.Wow.Memory.WowMemory.Memory.ReadInt32(unit.GetDescriptorAddress(0xE0)); } public bool IsDisarmed(WoWUnit unit) { return unit.UnitFlags.HasFlag(UnitFlags.Disarmed); } public bool IsHumanoid(WoWUnit unit) { return unit.CreatureTypeTarget == "Humanoid"; } As you can see you need for the main hand id different offsets, which are for wotlk(maybe it works for other expansions).
    Please note that the id will still be returned for player characters even when shapeshifted or disarmed. If a npc / player doesn't carry a weapon, it will be zero.
    I think it should suffice to build a properly check for disarm.
  2. Like
    reapler got a reaction from Findeh in Heals Casting Twice With Timer   
    Hello, i've created a small example for this, everything else is explained in the comments:
    using System; using System.Collections.Generic; using System.Threading; using wManager.Plugin; using wManager.Wow.Class; using wManager.Wow.Enums; using wManager.Wow.Helpers; using wManager.Wow.ObjectManager; using static robotManager.Helpful.Logging; public class Main : IPlugin { #region Variables private bool _isLaunched; private int _msDelay = 200; private DateTime _unlockTime = DateTime.Now; private readonly HashSet<string> _noGcdSpells = new HashSet<string> { "Counterspell", //... //http://wowwiki.wikia.com/wiki/Cooldown => Abilities noted for not affecting nor being affected by the global cooldown: }; #endregion #region Properties public bool GcdActive => DateTime.Now < _unlockTime; #endregion #region WRobot Interface public void Initialize() { var pGuid = ToWoWGuid(ObjectManager.Me.Guid); EventsLuaWithArgs.OnEventsLuaWithArgs += delegate(LuaEventsId id, List<string> args) { if ( id == LuaEventsId.COMBAT_LOG_EVENT_UNFILTERED && args[2] == pGuid && !_noGcdSpells.Contains(args[9]) && ( args[1] == "SPELL_CAST_SUCCESS" || args[1] == "SPELL_HEAL" || args[1] == "SPELL_DAMAGE" ) ) { Write("lock"); _unlockTime = DateTime.Now.AddMilliseconds(_msDelay); } }; _isLaunched = true; Write("Loaded"); while (_isLaunched) { try { if (Conditions.ProductIsStartedNotInPause) { Pulse(); } } catch (Exception e) { WriteError(e.ToString()); } Thread.Sleep(30); } } public void Dispose() { _isLaunched = false; } public void Settings() { } #endregion #region Pulse public void Pulse() { var spell = new Spell("Lesser Heal"); if (!GcdActive && spell.IsSpellUsable && !ObjectManager.Me.IsCast && ObjectManager.Me.TargetObject.HealthPercent <= 90 ) { spell.Launch(false, false); //will cast the heal if "_msDelay" was passed } /* if (spell.IsSpellUsable && !ObjectManager.Me.IsCast && ObjectManager.Me.TargetObject.HealthPercent <= 90) { spell.Launch(false, false); //.IsSpellUsable is true after gcd was passed but the heal itself can delay //and cause double heal cast if no additional delay is added like above //so ObjectManager.Me.TargetObject.HealthPercent <= 90 would be true for a short time }*/ } #endregion #region Methods public string ToWoWGuid(ulong guid) { var wowGuid = ObjectManager.Me.Guid.ToString("x").ToUpper(); var c = 16 - wowGuid.Length; for (var i = 0; i < c; i++) { wowGuid = "0" + wowGuid; } return "0x" + wowGuid; } #endregion } if you are going to lower the tickspeed this will rarer happens, but it can still happen. Instant spells aren't included.
  3. Like
    reapler got a reaction from Apexx in Heals Casting Twice With Timer   
    Hello, i've created a small example for this, everything else is explained in the comments:
    using System; using System.Collections.Generic; using System.Threading; using wManager.Plugin; using wManager.Wow.Class; using wManager.Wow.Enums; using wManager.Wow.Helpers; using wManager.Wow.ObjectManager; using static robotManager.Helpful.Logging; public class Main : IPlugin { #region Variables private bool _isLaunched; private int _msDelay = 200; private DateTime _unlockTime = DateTime.Now; private readonly HashSet<string> _noGcdSpells = new HashSet<string> { "Counterspell", //... //http://wowwiki.wikia.com/wiki/Cooldown => Abilities noted for not affecting nor being affected by the global cooldown: }; #endregion #region Properties public bool GcdActive => DateTime.Now < _unlockTime; #endregion #region WRobot Interface public void Initialize() { var pGuid = ToWoWGuid(ObjectManager.Me.Guid); EventsLuaWithArgs.OnEventsLuaWithArgs += delegate(LuaEventsId id, List<string> args) { if ( id == LuaEventsId.COMBAT_LOG_EVENT_UNFILTERED && args[2] == pGuid && !_noGcdSpells.Contains(args[9]) && ( args[1] == "SPELL_CAST_SUCCESS" || args[1] == "SPELL_HEAL" || args[1] == "SPELL_DAMAGE" ) ) { Write("lock"); _unlockTime = DateTime.Now.AddMilliseconds(_msDelay); } }; _isLaunched = true; Write("Loaded"); while (_isLaunched) { try { if (Conditions.ProductIsStartedNotInPause) { Pulse(); } } catch (Exception e) { WriteError(e.ToString()); } Thread.Sleep(30); } } public void Dispose() { _isLaunched = false; } public void Settings() { } #endregion #region Pulse public void Pulse() { var spell = new Spell("Lesser Heal"); if (!GcdActive && spell.IsSpellUsable && !ObjectManager.Me.IsCast && ObjectManager.Me.TargetObject.HealthPercent <= 90 ) { spell.Launch(false, false); //will cast the heal if "_msDelay" was passed } /* if (spell.IsSpellUsable && !ObjectManager.Me.IsCast && ObjectManager.Me.TargetObject.HealthPercent <= 90) { spell.Launch(false, false); //.IsSpellUsable is true after gcd was passed but the heal itself can delay //and cause double heal cast if no additional delay is added like above //so ObjectManager.Me.TargetObject.HealthPercent <= 90 would be true for a short time }*/ } #endregion #region Methods public string ToWoWGuid(ulong guid) { var wowGuid = ObjectManager.Me.Guid.ToString("x").ToUpper(); var c = 16 - wowGuid.Length; for (var i = 0; i < c; i++) { wowGuid = "0" + wowGuid; } return "0x" + wowGuid; } #endregion } if you are going to lower the tickspeed this will rarer happens, but it can still happen. Instant spells aren't included.
  4. Like
    reapler got a reaction from Apexx in Buff Check - When NOT Eating OR Drinking   
    Hello, this should work:
    if ( !ObjectManager.Me.HaveBuff("Food") && !ObjectManager.Me.HaveBuff("Drink") //other conditions ) { new Spell("Battle Shout").Launch(); } But keep in mind it's not multi-language and special food needs an own check.
  5. Like
    reapler got a reaction from Apexx in C# WRotation - Check Product Party Healer Mode   
    @Apexx Hello, you need to add "\WRobot\Products\Party.dll" to your project references.
  6. Like
    reapler got a reaction from Pudge in Difference between Friendly and Hostile targets condition   
    Hello, i've created a small example how to use the c# code: heal.xml
    Because reactions are ordered you can use it like this:
    wManager.Wow.ObjectManager.ObjectManager.Me.TargetObject.Reaction > Reaction.Neutral  
  7. Like
    reapler got a reaction from Matenia in Quest Editor   
    Yes, it will be public. At first only for 3.3.5a then i'm going to continue working on my database for other versions.
  8. Like
    reapler got a reaction from nudl in Quest Editor   
    A small update from me:
    Since i'm almost done with the database, i can continue working on my editor again. But my first design wasn't really good. 
    I'm thinking to use a more simpler solution which doesn't require to assign a "Action parameter" at the sorted quests.
    In the end each action define a step which are selectable on the bar like this:
    By the way, if you have a custom pulse like "KillAndLoot",  "Gatherer" or something else which is often used, you are welcome to post it and i can create a seperate setting gui for it.
  9. Like
    reapler got a reaction from Kikkass in Quest Editor   
    Hello, i'm currently working on a quest editor because the provided one doesn't fit to my imagination.
    I wanted to add some custom functions like adding transport step, specific npc using and so on.
    It looks like this so far (not fully finished):

     
     
    For now i have a few questions of the quests editor window:

     
    -Is it really needed that the marked area to have more than one questid? if yes an example would be useful
    -Does the name of the quest affect the common quest product?  Here "quest1 - KillAndLoot".  So far i tested it, only the quest id influence it but i'm not sure if some other function will also need the name
     
    If you have also other ideas for the editor, please leave your suggestions here.
     
  10. Thanks
    reapler got a reaction from Apexx in WoWLocalPlayer GetStance?   
    I've looked over the spell class again and found this constructor:
    public Spell(string spellNameEnglish, bool showLog) So you need to add "false" on every instance of "Spell":
    public Spell GetActiveStance() { return new Spell(Lua.LuaDoString<List<string>>(@"local r = {} for i=1,10 do local _, n, a = GetShapeshiftFormInfo(i); if a then table.insert(r, tostring(n)); end end return unpack(r);").FirstOrDefault() ?? "", false); } public Spell BattleShout = new Spell("Battle Shout", false); //...  
    This should hopefully stop the spam.
  11. Thanks
    reapler reacted to Hzqvkr8aTLw4rv in Spell::KnownSpell always returns true   
    2.4.3 DBC (fightclass will create DBC folder in bot root)
    https://mega.nz/#!Fl1nVRyC!w6szGtAhEGUvho1Du5n1ZMB834L28Fg08oFYgOcjU6U
    FightClass that loads Spell DBC files and a child class to Spell where you easily can access this spelldata from https://github.com/Lillecarl/FightClass1
    That's all i've got for now, thanks for your help reapler! :)
  12. Thanks
    reapler got a reaction from Asoter in Change variable in plugin from quest profile   
    @Asoter Everything looks fine, checked names and values. For me it works: doesn't matter in "RunCode" or in plugin.
    You may try this snippet:
    using System; using System.Linq; using robotManager.Helpful; using wManager.Plugin; public class Main : IPlugin { public bool readyIntoDungeon { get { Logging.Write(this.GetType().GetProperties().FirstOrDefault().Name); return Var.GetVar<bool>(this.GetType().GetProperties().FirstOrDefault().Name); } set { Logging.Write(this.GetType().GetProperties().FirstOrDefault().Name); Var.SetVar(this.GetType().GetProperties().FirstOrDefault().Name, value); } } public void Initialize() { Logging.Write(""+readyIntoDungeon); } public void Dispose() { } public void Settings() { readyIntoDungeon = true; } } Click on settings button then start bot. If it's not printing "true", then something else could be wrong with your plugin. But without an insight into your code, i can't really define the problem.
  13. Thanks
    reapler got a reaction from Asoter in Change variable in plugin from quest profile   
    @Asoter Hello, in order to make a variable changeable by quester, you can transform your current variable into an property.
    Let's say you have an quest counter in your plugin defined as int:
    public int QuestCounter = 0; So you need to change this into this:
    public int QuestCounter { get { return robotManager.Helpful.Var.GetVar<int>(this.GetType().GetProperties().FirstOrDefault()?.Name); } set { robotManager.Helpful.Var.SetVar(this.GetType().GetProperties().FirstOrDefault()?.Name, value); } } You can still treat as an normal variable.
     
    And in Quester it looks like this:

    robotManager.Helpful.Var.SetVar("QuestCounter", 12);  
  14. Like
    reapler reacted to Matenia in Condition for Profession   
    This plugin reads profession level through Lua. You can check out the source code.
    Here is the relevant C# code:
    private void SetMiningSkill() { CurrentMining = Lua.LuaDoString<int>(@" miningSkill = 1; for i = 1, GetNumSkillLines() do local skillName, isHeader, isExpanded, skillRank, numTempPoints, skillModifier = GetSkillLineInfo(i) if isHeader and not isExpanded then ExpandSkillHeader(i); end end for i = 1, GetNumSkillLines() do local skillName, isHeader, isExpanded, skillRank, numTempPoints, skillModifier = GetSkillLineInfo(i) if not isHeader and skillName == ""Mining"" then miningSkill = skillRank end end ", "miningSkill"); }  
  15. Like
    reapler got a reaction from Photogenic in [Solved] Bot stops right before mob and wait for mob.   
    Since with the .xml it's difficult to do it particular for this purpose(you might need to block some behaviors & add additional c#) you may port it to c# or wait for someone that could change the behavior.
    So far i know there's no really clean workaround for this on xml fightclasses.
  16. Thanks
    reapler got a reaction from Photogenic in [Solved] How to detect debuff Type ?   
    Yep, that's not a secret that i love c# ;)
    I've tried on wotlk, it works flawless: Abolish Poison test.xml
    Dunno how it will work on tbc, but in the wow api i haven't found any considerable changes.
  17. Like
    reapler got a reaction from Avvi in Heals Casting Twice With Timer   
    Hello, you can use the "ObjectManager" and filter it with linq.
    I guess it will be used often, so I've made a method for it:
    /// <summary> /// Get attacking units from another unit /// </summary> /// <param name="from">Take hostile units from this unit</param> /// <param name="maxRange">Take hostile units within this range</param> /// <returns></returns> public List<WoWUnit> AttackingUnits(WoWUnit from, float maxRange = 10) { return ObjectManager.GetWoWUnitHostile().Where(i => from.Guid == i.TargetObject.Guid && from.Position.DistanceTo(i.Position) <= maxRange ).ToList(); } and use it in another method:
    if (condition1 && ... && AttackingUnits(ObjectManager.Me, 15).Count < 3 ) { //cast spell }  
  18. Like
    reapler got a reaction from Marsbar in Rogue Stealth to avoid players   
    Forgot that you are playing on vanilla, so "CancelUnitBuff" doesn't exist in the api.
    I replaced it just with another cast: StealthOnNearbyPlayers+stopfishing.xml
  19. Like
    reapler got a reaction from Matenia in C#, Time Since Combat Start   
    Hello, for this purpose you need a stopwatch and events:
    private readonly Stopwatch _combatTimer = new Stopwatch(); public void Initialize() { EventsLua.AttachEventLua(LuaEventsId.PLAYER_REGEN_DISABLED, CombatStart); EventsLua.AttachEventLua(LuaEventsId.PLAYER_REGEN_ENABLED, CombatEnd); } private void CombatStart(object context) { _combatTimer.Restart(); } private void CombatEnd(object context) { _combatTimer.Reset(); } usage in a method for example:
    if (_combatTimer.ElapsedMilliseconds > 8000) { Logging.Write("In combat since 8 seconds"); }  
  20. Like
    reapler got a reaction from hakancamli in how to conventers?   
    Hello, @hakancamli WRobot has in in "Quester" product under "Product Settings" on the left pane a button called "Easy profiles creator".
    After you have opened it, click on Tools > Helper Tools. Now you may scroll down and click "Buddy to WRobot".
    It's not guaranteed that the profile will work correctly, since used classes, methods or bot behavior can vary.
     
     
  21. Like
    reapler got a reaction from Findeh in Alot of questions about FightClass and API   
    Logging.Write(Lua.LuaDoString<string>("name, rank, icon, castTime, minRange, maxRange = GetSpellInfo(\"Shadow Word: Pain\")", "rank")); Can be used. But i guess you could also need "desc = GetSpellDescription(spellId)" but unfortunately for me it doesn't return any string to parse the damage values.
    Ok let's take FightEvents. I linked a fightclass which has "internal void BuffRotation()" on a loop. Once "public void Initialize()" is called from the interface(start bot), it will loop this method till you stop the bot.
    So that means the buffrotation aswell the other methods in your fightclass having no impact / affiliation on "FightEvents".
    The "FightEvents" or the other events in WRobot are triggered from the bot behavior itself (you can imagine like a guy reporting you what he's doing).
    So this "guy" tells you:
         I attack now this npc  = "wManager.Events.FightEvents.OnFightStart"
         While fighting i also report whats going on every ~30ms = "wManager.Events.FightEvents.OnFightLoop"
         the fight is over = "wManager.Events.FightEvents.OnFightEnd"
    This is useful for plugins for example but if you are going to write a fightclass, you wouldn't really need it.
    If you want to write a plugin which uses an item or do other action after a fight end, you could subscribe it like this:
    wManager.Events.FightEvents.OnFightEnd += delegate { wManager.Wow.Helpers.SpellManager.CastSpellByIdLUA(8690); //cast hearthstone };  
    If you write an plugin you could use your snippet on a loop or by subscribing it to "wManager.Events.MovementEvents.OnMoveToPulse".
    But i guess you are writing a fightclass anyway, so you can put this snippet to buffrotation or directly to while loop:
    internal void BuffRotation() { if (ObjectManager.Me.IsMounted) return; //if not mounted cast sprint var spelltocast = new Spell("Sprint"); if (wManager.Wow.Bot.States.ToTown.GoToTownInProgress && spelltocast.IsSpellUsable) { spelltocast.Launch(); } } or directly in while loop:
    internal void Rotation() { Logging.Write("[My fightclass] Is started."); while (_isLaunched) { try { if (!Products.InPause) { if (!ObjectManager.Me.IsDeadMe) { BuffRotation(); var spelltocast = new Spell("Sprint"); if (wManager.Wow.Bot.States.ToTown.GoToTownInProgress && spelltocast.IsSpellUsable && !ObjectManager.Me.IsMounted) { spelltocast.Launch(); } if (Fight.InFight && ObjectManager.Me.Target > 0) { Pull(); CombatRotation(); } } } } catch (Exception e) { Logging.WriteError("[My fightclass] ERROR: " + e); } Thread.Sleep(10); // Pause 10 ms to reduce the CPU usage. } Logging.Write("[My fightclass] Is now stopped."); } So you can see in the end it doesn't really matter. It's just for a better structure & readability.
  22. Like
    reapler got a reaction from Avvi in how to conventers?   
    Hello, @hakancamli WRobot has in in "Quester" product under "Product Settings" on the left pane a button called "Easy profiles creator".
    After you have opened it, click on Tools > Helper Tools. Now you may scroll down and click "Buddy to WRobot".
    It's not guaranteed that the profile will work correctly, since used classes, methods or bot behavior can vary.
     
     
  23. Like
    reapler got a reaction from arkhan in FC - Settings bug   
    Hello @arkhan, i've re-created it:
    public void ShowConfiguration() { CustomClass_ShamanSettings.Load(); CustomClass_ShamanSettings.CurrentSetting.ToForm(); CustomClass_ShamanSettings.CurrentSetting.Save(); } public class CustomClass_ShamanSettings : Settings { public static CustomClass_ShamanSettings CurrentSetting { get; set; } public bool Save() { try { return Save(AdviserFilePathAndName("CustomClass_Shaman", ObjectManager.Me.Name + "." + Usefuls.RealmName)); } catch (Exception e) { Logging.WriteError("CustomClass_ShamanSettings > Save(): " + e); return false; } } public static bool Load() { try { if (File.Exists(AdviserFilePathAndName("CustomClass_Shaman", ObjectManager.Me.Name + "." + Usefuls.RealmName))) { CurrentSetting = Load<CustomClass_ShamanSettings>(AdviserFilePathAndName("CustomClass_Shaman", ObjectManager.Me.Name + "." + Usefuls.RealmName)); return true; } CurrentSetting = new CustomClass_ShamanSettings { UGW = true, TGW = 4, MGW = 50 }; } catch (Exception e) { Logging.WriteError("CustomClass_ShamanSettings > Load(): " + e); } return false; } [Setting] [Category("GHOST WOLF SETTINGS")] [DisplayName("Ghost Wolf")] [Description("Use Ghost Wolf")] public bool UGW { get; set; } [Setting] [Category("GHOST WOLF SETTINGS")] [DisplayName("Use after X secondes")] [Description("Use Ghost Wolf after X secondes out of combat")] public int TGW { get; set; } [Setting] [Category("GHOST WOLF SETTINGS")] [DisplayName("Mana required")] [Description("Use Ghost Wolf only if mana is superior or equal")] public int MGW { get; set; } }  
  24. Like
    reapler reacted to Droidz in Register Combat_Log with args   
    If you can wait next update, I added OnEventsLuaWithArgs in vanilla and TBC, and I fixed problem with missing events.
  25. Like
    reapler reacted to Droidz in How to sell your profiles/fightclasses   
    Hello,
    I sent you a private message (and at all paid files seller).
    With this tools you can encrypt files (profiles/fightclasses/plugins/products), encrypted files can only be executed (file are decrypted and stereamed by the WRobot server, you cannot edit files with editor, and off course you cannot view original code. You can also (if you use encrypter option "user id") limit file usage at only one user account). This tools is available only for users with  "Premium Seller" status active (and you are allowed to encrypt only paid files) (now you need also premium status to sell files), WRobot will support encrypted files in next update (I think release tomorrow).
×
×
  • Create New...