What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

[Rogue] Vanish then Sleep Issue

Obliv

New Member
Joined
Oct 18, 2011
Messages
636
Reaction score
6
Working on the Singular Sub Rogue CC and having a problem with Vanish. The current code is:

new Sequence(
Spell.Cast("Vanish"),
new Action(ret => StyxWoW.SleepForLagDuration()))),

Which works, but the bot isn't recognizing we can use Ambush (requires stealth / vanish) until it's already cast another ability. The only thing I can think of is that of is that the bot is acting too quick. I'm guessing I need a way to slow the bot down slightly more after Vanish to make sure when it does start attacking again it realizes we are able to Ambush.
 
Code:
                Spell.BuffSelf("Sprint", ret => StyxWoW.Me.IsMoving && StyxWoW.Me.HasAura("Stealth")),
                Spell.BuffSelf("Stealth"),
                new PrioritySelector(
                    ret => WoWMathHelper.CalculatePointBehind(StyxWoW.Me.CurrentTarget.Location, StyxWoW.Me.CurrentTarget.Rotation, 1f),
                    new Decorator(
                        ret =>
                        ((WoWPoint)ret).Distance2D(StyxWoW.Me.Location) > 3f && Navigator.CanNavigateFully(StyxWoW.Me.Location, ((WoWPoint)ret)),
                        new Action(ret => Navigator.MoveTo(((WoWPoint)ret))))
                    ),
                Spell.Cast("Vanish"),
                Spell.Cast("Ambush", ret => StyxWoW.Me.HasAura("Stealth")),

I know NOTHING about the spells or rouges, but curious what's wrong with the code above here I modified a bit to what you said?
 
when you Sleep, your locking the thread, so until the sleep is over, your bot isnt going to do anything.
Code:
                        // Wait until we got a target
                        new Wait(3, ret => Me.GotTarget,
                            new ActionIdle()))
you might wanna try something like that.
instead of sleep use a wait. it waits untill the value is true then continues.

heres a full functioning version waiting after making a healthstone.
Code:
                new Decorator(ret => !HaveHealthStone() && SpellManager.CanCast("Create Healthstone"),
                              new PrioritySelector(
                                  new Wait(4, ret => HaveHealthStone(),
                                  new ActionIdle()),
                                  new Action(ctx => SpellManager.Cast("Create Healthstone"))
                                                    ))
 
I finally... finally (you have no idea how long this took) figured out if I disabled the auto attacks it would work perfectly. Now just trying to figure out how to "use" equipped items. Trying Item.UseEquippedItem(15) doesn't activate my cloak, like I figured it would.

Thank you for always helping me out!
 
well theres a few things you can do. you can do a
Code:
Lua.DoString("RunMacroText(\"/Use ItemName"\)");
(that code isnt functional, but should give you an idea)

or you can Pull the Item.

Code:
foreach(WoWItem Item in Me.Inventory)
//its not me.inventory theres one that does all items not just Me.Bags where it just gets whats in the bags
{
if(item.name == *ItemNameHere*)
{
item.Use();
}
}

in Amplify on first check, i have it go out and fetch the Wow item and save it in a variable, if the Wow Item is invalid (ether it was used or deleted) then go get another one. then i have another method, that goes, if the wow item is valid and ready to be used, then use it.

its a 3 step process just to use a potion or managem, but it has low overhead because your not looking for the item all the time and works pretty well.

another thing is, when you equip items that have spells. you can (in most cases) cast it using the spell manager. (its not going to be there but you can force it if you know what the spell id of the spell the item has)

so really 3 diffrent ways to do it, its up to you on how you wanna do it.
 
Code:
foreach(WoWItem Item in Me.Inventory)
//its not me.inventory theres one that does all items not just Me.Bags where it just gets whats in the bags
{
if(item.name == *ItemNameHere*)
{
item.Use();
}
}

Simplified and Smexier:
Code:
public static void UseItem(string itemName)
{
    var someItem = Me.Inventory.Where(o => o.Name == itemName).FirstOrDefault();
    if (someItem != null)
        someItem.Use();
}
 
Singular has it somewhat builtin but it isn't working. I'll compare the code and see why. You guys rock. I'm trying to add the engineering glove enchant to work but testing with my parachute cloak since I don't have the glove chant.
 
Ok here's Apsalar's code:
return new Decorator(
ret =>
Settings.UseHandsEnchant &&
Me.CurrentTarget.IsWithinMeleeRange,
Item.UseEquippedItem(9)

Then he uses Commons.CreateUseHandsEnchant() to call for it in his Sub file. I don't know for sure if it works... although, he's using Item 9 which is not the gloves (at least by WoW definition). Is there a difference between WoW Item Slot # and this?

Singular uses: public static Composite UseEquippedItem(uint slot)
{
return new PrioritySelector(
ctx => StyxWoW.Me.Inventory.GetItemBySlot(slot),
new Decorator(
ctx => ctx != null && CanUseEquippedItem((WoWItem)ctx),
new Action(ctx => UseItem((WoWItem)ctx))));

}

Which, I'm trying to call with:
new Decorator(
ret => StyxWoW.Me.ActiveAuras.ContainsKey("Shadow Dance"),
new PrioritySelector(
//use_item,name=blackfang_battleweave_gloves,if=buff.shadow_dance.up
Item.UseEquippedItem(15), // (just as a test to see if it hits my cloak)
//berserking,if=buff.shadow_dance.up
Spell.BuffSelf("Blood Fury", ret => SpellManager.HasSpell("Blood Fury") && StyxWoW.Me.ActiveAuras.ContainsKey("Shadow Dance")),
Spell.BuffSelf("Berserking", ret => SpellManager.HasSpell("Berserking") && StyxWoW.Me.ActiveAuras.ContainsKey("Shadow Dance")),
Spell.BuffSelf("Escape Artist", ret => SpellManager.HasSpell("Escape Artist")) // (also using as a test since i don't have either buff above)
)
),

It pops Escape Artist, but refuses to use my cloak.
 
Back
Top