Jump to content
This site uses cookies! Learn More

This site uses cookies!

By continuing to use this site, you agree to allow us to store cookies on your computer. :)

Andoido

Quest Profile - Code Snippets (cont.)

Recommended Posts

Wasnt sure if i should post this on the topic above, or make a new - Up to you droidz.

 


 

//  TBC USe Item On Dead Mob ( Make Interact Quest Helper (dead mobs checked)

wManager.Events.InteractEvents.OnInteractPulse += (target, cancelable) =>
{
    var t = wManager.Wow.ObjectManager.ObjectManager.GetObjectByGuid(target);
    if (!t.IsValid)
        return;
    var e = t.Entry;
    if (e == 21859 || e == 21846)
    {
        System.Threading.Tasks.Task.Run(delegate {
            System.Threading.Thread.Sleep(wManager.Wow.Helpers.Usefuls.Latency + 100);
            wManager.Wow.Helpers.ClickOnTerrain.Item(31769, t.Position);
        });
    }
};

_____________________________________________________________________________________________________________________________________

    //  Droidz Code from "Code Snipets - Use Item on Hostile or Weakend Mob"
    //  Add step type "PickUp" (put quest name in parameter)
    //  Add step type "RunCod e", in parameter put this code:

    Thread t = new Thread(() =>
    {
        uint itemId = 62899;
        int questId = 28000;
        while (robotManager.Products.Products.IsStarted)
        {
            if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
            {
                if (!Quest.HasQuest(questId))
                    break;
                if (ObjectManager.Target.IsValid && ObjectManager.Target.IsAlive && ObjectManager.Target.HealthPercent <= 25)
                {
                    ItemsManager.UseItem(itemId);
                }
            }
            Thread.Sleep(500);
        }
    });
    t.Start();

    //(you need to have quest in your questlog, you can replace "62899" but the item id, "28000" by the quest id and "25" by the max target health)

    //Add step type "Pulse" (put quest name in parameter) (use quest type kill or interact)

    //Add step type "TurnIn" (put quest name in parameter)

    
    // Use item and GATHER
    
        Thread t = new Thread(() =>
    {
        uint itemId = 62899;
        int questId = 28000;
        while (robotManager.Products.Products.IsStarted)
        {
            if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
            {
                if (!Quest.HasQuest(questId))
                    break;
                if (ObjectManager.Target.IsValid && ObjectManager.Target.IsAlive && ObjectManager.Target.HealthPercent <= 25)
                {
                    ItemsManager.UseItem(itemId);
                    wManager.wManagerSetting.CurrentSetting.ListHarvest.Add(183933);            
                }
            }
            Thread.Sleep(500);
        }
    });
    t.Start();
    
    
_____________________________________________________________________________________________________________________________________
    
    
    
// Schakas Use Script On  - TBC Gathering items (New Life Q example)
    
ItemsManager.UseItem(22955);
Thread.Sleep(1000);
Interact.InteractGameObject(ObjectManager.GetWoWGameObjectByEntry(181433).First().GetBaseAddress);
Usefuls.WaitIsCastingAndLooting();


// Schakas Use Script On - For NPC's (didnt work for me)
    
ItemsManager.UseItem(22955);
Thread.Sleep(1000);
Interact.InteractGameObject(ObjectManager.GetWoWUnitByEntry(123, true).First().GetBaseAddress);
Usefuls.WaitIsCastingAndLooting();    
    
    
_____________________________________________________________________________________________________________________________________


// Is Complete Condition for Items

return ItemsManager.GetItemCountById(28513) >= 1;

// Has item More or Less Than RunCode
ItemsManager.GetItemCountById(11188) < 7
____________________________________________________________________________________________________________________________________


// Use inventory Solot Items

UseInventoryItem( 13 );
UseInventoryItem( 14 );

____________________________________________________________________________________________________________________________________

// Set chat text in game

DEFAULT_CHAT_FRAME:AddMessage("|cFFFFCE2ETramBot|r Zangermarsh Elevator - Go TO and wait")


_____________________________________________________________________________________________________________________________________


// If Has Quest + If Has Quest Complete RunCode

Quest.HasQuest(10446) && !Quest.GetQuestCompleted(10446)

_____________________________________________________________________________________________________________________________________

// Does Bot Know Spell (runcode)

!wManager.Wow.Helpers.SpellManager.KnowSpell(688)

// Class Code (runcode)
ObjectManager.Me.WowClass == WoWClass.Warlock

// If Has Item - RuNCode

ItemsManager.HasItemById(29912)

// Use Item (RunCode) -- Used to Use Items in Game.

ItemsManager.UseItem(25539);

// Equip Item By name (runcode)
wManager.Wow.Helpers.ItemsManager.EquipItemByName("Spectrecles");

_____________________________________________________________________________________________________________________________________


// Interact with NPC (RuNCode)

wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(-2917.88f, 4021.48f, 0.4276921f), 19296, 1, false);

// Interact with OBJECT in Game (runcode)

wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithGameObject(new Vector3(2552.44, 856.9836, 51.49502), 148917);

// Interact With Game Object V2 (runcode)

wManager.Wow.Helpers.Interact.InteractGameObject(wManager.Wow.ObjectManager.Obje ctManager.GetNearestWoWGameObject
(wManager.Wow.ObjectManager.ObjectManager.GetWoWGameObjectByEntry(254241)).GetBaseAddress);

// Interact with DEAD NPC (runcode)

wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(-2917.88f, 4021.48f, 0.4276921f), 19296, 1, false, false);

// Go To Position - IF WITHIN x RANGE /// Am i within distance of x (runcode)

ObjectManager.Me.Position.DistanceTo2D(new Vector3(199.061f, 4238.42f, 121.7268f)) < 125

__________________________________________________________________________________________________________________________________


// Interact with Game Object V3  (use quest profile and overidepulse... quest type)

            while (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && !Conditions.IsAttackedAndCannotIgnore)
            {
                var o = wManager.Wow.ObjectManager.ObjectManager.GetNearestWoWGameObject(wManager.Wow.ObjectManager.ObjectManager.GetWoWGameObjectByEntry(218889));
                if (!o.IsValid)
                    break;
                wManager.Wow.Helpers.Interact.InteractGameObject(o.GetBaseAddress);
                Thread.Sleep(100);
            }

// Interact with Game Object (RunCode) 

            WoWGameObject gong = wManager.Wow.ObjectManager.ObjectManager.GetObjectWoWGameObject().FirstOrDefault(i => i.Entry == 148917 );
            if (gong != null)
            {
                wManager.Wow.Helpers.Interact.InteractGameObject(gong.GetBaseAddress);
            }
            
// Interact with Object -- Search for nearest Game Object and Interact

            WoWGameObject gong = ObjectManager.GetNearestWoWGameObject(ObjectManager.GetWoWGameObjectById("1234")).GetBaseAddress
            if (gong != null)
            {
                wManager.Wow.Helpers.Interact.InteractGameObject(gong.GetBaseAddress);
            }            
            

// Interact with NPC - Talk to NPC (RunCode)


            WoWUnit toTalk =
                wManager.Wow.ObjectManager.ObjectManager.GetObjectWoWUnit()
                    .SingleOrDefault(i => i.Entry == 75746);
            if (toTalk != null)
            {
                wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(toTalk.Position, toTalk.Entry, 1);
            }


__________________________________________________________________________________________________________________________________


// Harvest Item (Gather RunCode) - Best used after a follow path, or run to codes. Just followup the quester profile with gather or interact with npc. and include a "Is Complete code return ItemsManager.GetItemCountById(28513) >= 1;

wManager.wManagerSetting.CurrentSetting.ListHarvest.Add(192518);

__________________________________________________________________________________________________________________________________


// Move Backward (RunCode)

wManager.Wow.Helpers.Move.Backward(Move.MoveAction.PressKey,2000);

// Move Forward (RunCode)

wManager.Wow.Helpers.Move.Forward(Move.MoveAction.PressKey,2000);

__________________________________________________________________________________________________________________________________


// Display Code for my on screen display ( RunLuaCode )

MyFrame.text:SetText("TEXT HERE")

__________________________________________________________________________________________________________________________________


// Change Wrobots Current Settings (RuNCode)

wManager.wManagerSetting.CurrentSetting.AttackBeforeBeingAttacked = true;
wManager.wManagerSetting.CurrentSetting.CanAttackUnitsAlreadyInFight = true;


__________________________________________________________________________________________________________________________________


// Opening Objects (Clams, Boxes, Etc) RunCode  - https://wrobot.eu/forums/topic/5684-looting-inventory-item-containing-quest-items/


Thread t = new Thread(() =>
{
    while (robotManager.Products.Products.IsStarted)
    {
        if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
        {
            if (ObjectManager.Target.IsValid && ObjectManager.Target.IsAlive)
            {
robotManager.Helpful.Keyboard.DownKey(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, System.Windows.Forms.Keys.ShiftKey);
      Thread.Sleep(robotManager.Helpful.Others.Random(50, 150));
      ItemsManager.UseItem(7973);
      Thread.Sleep(robotManager.Helpful.Others.Random(50, 150));
      robotManager.Helpful.Keyboard.UpKey(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, System.Windows.Forms.Keys.ShiftKey);
      Thread.Sleep(robotManager.Helpful.Others.Random(50, 150));
            }
        }
        Thread.Sleep(10000);
    }
});
t.Start();

__________________________________________________________________________________________________________________________________


// Check Bind Location (RunCode)

Lua.LuaDoString<string>("bindlocation = GetBindLocation(); return bindlocation;") == "Allerian Stronghold"
&& ObjectManager.Me.Level >= 65 && ObjectManager.Me.Level <= 67
&& (wManager.Wow.Helpers.Usefuls.MapZoneName == "Shattrath City")
&& Quest.HasQuest(9990)


__________________________________________________________________________________________________________________________________

// Add ALL Items in BAG to Do Not Sell List -  All Items in Bag

        foreach (var woWItem in wManager.Wow.Helpers.Bag.GetBagItem())
        {
            if (!string.IsNullOrWhiteSpace(woWItem.Name) && !wManager.wManagerSetting.CurrentSetting.DoNotSellList.Contains(woWItem.Name))
                wManager.wManagerSetting.CurrentSetting.DoNotSellList.Add(woWItem.Name);
        }


// Abandon All Quests In Log

for i=1,GetNumQuestLogEntries() do
    SelectQuestLogEntry(i);
    SetAbandonQuest();
    AbandonQuest();
end


// Abandon Quest by IDictionary

local questId = 12345;
for i=1,GetNumQuestLogEntries() do
    local _, _, _, _, _, _, _, id = GetQuestLogTitle(i);
    if id == questId then
        SelectQuestLogEntry(i);
        SetAbandonQuest();
        AbandonQuest();
    end
end

__________________________________________________________________________________________________________________________________

// Desolace Kodo Quest Codes.

// [Is Complete Condition for Quest]
return wManager.Wow.ObjectManager.ObjectManager.Target.IsValid && wManager.Wow.ObjectManager.ObjectManager.Target.Reaction >= wManager.Wow.Enums.Reaction.Friendly;

// Target Unit by Name: RunCode

ObjectManager.Me.Target = ObjectManager.GetWoWUnitByName("Tamed Kodo").First().Guid;

// Face your Position ( do 180) RuNCode

MovementManager.Face(ObjectManager.Me.Position)

__________________________________________________________________________________________________________________________________

// Skillline - Is Complete Condition

return wManager.Wow.Helpers.Skill.GetValue(wManager.Wow.Enums.SkillLine.Lockpicking) >= 75;


__________________________________________________________________________________________________________________________________

// Used to farm (Lockpicking Example - //  OverridePulseCSharpCode                                                                                                                                                                            

if (GoToTask.ToPosition(new Vector3(-1455.473f, -3968.029f, 7.562639f)))
{
    while (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && Skill.GetValue(SkillLine.Lockpicking) < 75)
    {
        var obj = ObjectManager.GetObjectWoWGameObject()
            .FirstOrDefault(o => !wManager.wManagerSetting.IsBlackListed(o.Guid) && o.Entry == 123330 || o.Entry == 123333 || o.Entry == 123331);
        if (obj != null)
        {
            Interact.InteractGameObject(obj.GetBaseAddress);
            Usefuls.WaitIsCastingAndLooting();
            Lua.LuaDoString("LootCloseButton:Click();");
            wManager.wManagerSetting.AddBlackList(obj.Guid, 5000, true);
        }
        
    }
}
return true;

__________________________________________________________________________________________________________________________________

// Buy From Vendor (runcode)

Lua.LuaDoString("BuyMerchantItem(1,1)"); // version 1

wManager.Wow.Helpers.Vendor.BuyItem("Walking Stick",1); // Version w

__________________________________________________________________________________________________________________________________


// FLY - Custom Fly Code ---- FLYING CODE RunCode

var position = new Vector3(-1770.37f, 3262.19f, 5.10852f);
int npcEntryId = 6726;

if (!ObjectManager.Me.IsOnTaxi)
{
    if (wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(position, npcEntryId))
    {
 int node;
        Usefuls.SelectGossipOption(GossipOptionsType.taxi);

 node = wManager.Wow.Helpers.Lua.LuaDoString<int>("for i=0,30 do if string.find(TaxiNodeName(i),'Orgrimmar') then return i end end");
          
        wManager.Wow.Helpers.Lua.LuaDoString("TakeTaxiNode(" + node + ")");
    }
}



// Zangermarsh -- Elevator Code - RunCodes in an IF/EndIf statment.

If

if (ObjectManager.GetWoWGameObjectByyId(183177).FirstOrDefault().GetDistance <= 10) {
  Logging.Write("Elevator already here.Lets wait - waiting for elevator");
}
while (ObjectManager.GetWoWGameObjectByyId(183177).FirstOrDefault().GetDistance <= 10) {Thread.Sleep(500);};

Logging.Write("Waiting for the Tram");
while (ObjectManager.GetWoWGameObjectByyId(183177).FirstOrDefault().GetDistance > 10) {Thread.Sleep(500);};


// step inside the tram
wManager.Wow.Helpers.Move.Forward(Move.MoveAction.PressKey,1000);

wait 1500

while (ObjectManager.Me.Position.DistanceTo2D( new Vector3(283.8558f, 5945.312f, 149.8242f, "None")) >10) {Thread.Sleep(100);};

wait 100

wManager.Wow.Helpers.Move.Backward(Move.MoveAction.PressKey,5500);

// Custom Follow Path to run away from Elevator

EndIf

 

 

 

Edited by Andoido

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×