• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • [Plugin] OnlyLootGold

    Discussion in 'Archives' started by Vastico, Sep 10, 2011.

    1. Vastico

      Vastico New Member

      Joined:
      Jul 28, 2011
      Messages:
      424
      Likes Received:
      10
      Trophy Points:
      0
      I took a look and I can add it. I'll update the code/file when I have it working.
       
    2. tomshawnson2

      tomshawnson2 New Member

      Joined:
      Apr 14, 2011
      Messages:
      10
      Likes Received:
      0
      Trophy Points:
      0
      i tried changing the lua part to try and make it loot green and higher quality as well, but doesnt seem to be working 100%
      Lua.DoString("for i=1,GetNumLootItems() do if LootSlotIsCoin(i) then LootSlot(i) ConfirmLootSlot(i) elseif LootSlotIsItem(i) _,_,_,q,l=GetLootSlotInfo(i) if q>1 then LootSlot(i) ConfirmLootSlot(i) end end end");
       
    3. crasy88

      crasy88 New Member

      Joined:
      Jan 14, 2012
      Messages:
      2
      Likes Received:
      0
      Trophy Points:
      0
      i would love this plugin if it was possible to make a option to what it should loot.
      Because i would love a plugin that would make u only loot quest items >.<!
      Great job making this one though!
       
    4. theatristformallyknownasG

      theatristformallyknownasG Active Member

      Joined:
      Jan 16, 2010
      Messages:
      3,041
      Likes Received:
      8
      Trophy Points:
      38
      Lootfilter understands colour of loot, combuctor understands colour of lot, can you just "borrow" some code :0

      G
       
    5. Vastico

      Vastico New Member

      Joined:
      Jul 28, 2011
      Messages:
      424
      Likes Received:
      10
      Trophy Points:
      0
      I finally got round to updating this, it's faster at looting and now loots blues and purples.

      Code:
      using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Text;
      using Styx.Plugins.PluginClass;
      using Styx;
      using Styx.WoWInternals.WoWObjects;
      using Styx.Helpers;
      using Styx.Logic.Pathing;
      using System.Threading;
      using Styx.Logic.Inventory.Frames.LootFrame;
      using System.Drawing;
      using Styx.WoWInternals;
      
      namespace OnlyLootGold
      {
      
          class OnlyLootGold : HBPlugin
          {
      
              public OnlyLootGold()
              {            
                  BotEvents.Player.OnMobKilled += OnMobKilled;
                  Bots.Gatherbuddy.GatherbuddySettings.Instance.LootMobs = false;
                  CharacterSettings.Instance.LootMobs = false;
                  CharacterSettings.Instance.LootChests = false;
              }
      
              public override string Author
              {
                  get { return "Vastico"; }
              }
      
              public override string Name
              {
                  get { return "OnlyLootGold"; }
              }
      
              public override Version Version
              {
                  get { return new Version(0, 0, 0, 2); }
              }
      
              private LocalPlayer Me = StyxWoW.Me;
              private WaitTimer lootTimer = new WaitTimer(TimeSpan.FromSeconds(15));
              private Queue<WoWUnit> KilledUnits = new Queue<WoWUnit>();
              private IDictionary<ulong, WaitTimer> Blacklist = new Dictionary<ulong, WaitTimer>();
      
              public override void Pulse()
              {
                  if (Me.Combat || Me.Dead || Me.IsGhost)
                  {
                      return;
                  }
                  List<ulong> removals = new List<ulong>();
                  foreach (KeyValuePair<ulong, WaitTimer> unit in Blacklist)
                  {
                      if (unit.Value.IsFinished)
                      {
                          removals.Add(unit.Key);
                      }
                  }
                  foreach (ulong remove in removals)
                  {
                      Blacklist.Remove(remove);
                  }
                  while (KilledUnits.Count > 0)
                  {
                      WoWUnit target = KilledUnits.Dequeue();
                      if (Blacklist.ContainsKey(target.Guid) || target.Distance > Styx.Logic.LootTargeting.LootRadius)
                      {
                          continue;
                      }
                      WaitTimer lootableTimer = new WaitTimer(TimeSpan.FromMilliseconds(1500));
                      lootableTimer.Reset();
                      while (!lootableTimer.IsFinished)
                      {
                          if (target.Lootable)
                          {
                              break;
                          }
                          System.Threading.Thread.Sleep(20);
                      }
                      if (!target.Lootable)
                      {
                          Logging.Write(Color.Crimson, "Blacklisted [loot][lootable] " + target.Name + ".");
                          Blacklist.Add(target.Guid, new WaitTimer(TimeSpan.FromMinutes(30)));
                          continue;
                      }
                      WaitTimer movementTimer = new WaitTimer(TimeSpan.FromSeconds(30));
                      movementTimer.Reset();
                      Logging.Write(Color.Crimson, "Moving to loot items from " + target.Name + ".");
                      while (target.Distance > 4 || !target.InLineOfSpellSight && !movementTimer.IsFinished)
                      {
                          Navigator.MoveTo(target.Location);
                          System.Threading.Thread.Sleep(20);
                      }
                      if (target.Distance > 4)
                      {
                          Logging.Write(Color.Crimson, "Blacklisted [loot][movement] " + target.Name + ".");
                          Blacklist.Add(target.Guid, new WaitTimer(TimeSpan.FromMinutes(30)));
                      }
                      else
                      {
                          Navigator.PlayerMover.MoveStop();
                          StyxWoW.SleepForLagDuration();
                          target.Interact();
                          StyxWoW.SleepForLagDuration();
                          WaitTimer lootTimer = new WaitTimer(TimeSpan.FromSeconds(5));
                          lootTimer.Reset();
                          Logging.Write(Color.Crimson, "Looting items from " + target.Name + ".");
                          while ((LootFrame.Instance == null || !LootFrame.Instance.IsVisible) && !lootTimer.IsFinished)
                          {
                              System.Threading.Thread.Sleep(20);
                          }
                          if (LootFrame.Instance == null || !LootFrame.Instance.IsVisible)
                          {
                              Blacklist.Add(target.Guid, new WaitTimer(TimeSpan.FromMinutes(30)));
                              Logging.Write(Color.Crimson, "Blacklisted [loot] " + target.Name + ".");
                          }
                          else
                          {
                              StringBuilder builder = new StringBuilder();
                              builder.Append("for i=1,GetNumLootItems() do ");
                                  builder.Append("if LootSlotIsCoin(i) then ");
                                      builder.Append("LootSlot(i) ConfirmLootSlot(i) ");
                                  builder.Append("elseif LootSlotIsItem(i) and select(4, GetLootSlotInfo(i)) > 2 then ");
                                      builder.Append("LootSlot(i) ConfirmLootSlot(i) ");
                                  builder.Append("end ");
                              builder.Append("end");
                              Lua.DoString(builder.ToString());
                              lootTimer = new WaitTimer(TimeSpan.FromMilliseconds(1500));
                              lootTimer.Reset();
                              while (!lootTimer.IsFinished)
                              {
                                  System.Threading.Thread.Sleep(20);
                                  Lua.DoString(builder.ToString());
                              }
                              Lua.DoString("CloseLoot()");
                              Logging.Write(Color.Crimson, "Looted items and closed loot frame.");
                          }
                      }
                  }
              }
      
              public void OnMobKilled(BotEvents.Player.MobKilledEventArgs args)
              {
                  KilledUnits.Enqueue(args.KilledMob);
              }
              
          }
      
      }
      Post any issues/bug as usual.
       
      Last edited: Apr 15, 2012
    6. cincshell

      cincshell New Member

      Joined:
      Dec 26, 2011
      Messages:
      6
      Likes Received:
      0
      Trophy Points:
      1
      there is a wow addon called lootfilter, set up the filter to delete all item that has been looted. Then u will only loot gold.
       
    7. xwozone

      xwozone Active Member

      Joined:
      Apr 1, 2012
      Messages:
      1,514
      Likes Received:
      3
      Trophy Points:
      38
      Going to test when ever i go farming. Any suggestions on a prime location?
       
    8. ossirian

      ossirian New Member

      Joined:
      May 5, 2011
      Messages:
      241
      Likes Received:
      5
      Trophy Points:
      0
      if you could make it only loot item upgrades via autoequip plugin somehow, blues, epics and quest items this would become an essential plugin for every leveller.

      perhaps make it modify the looting rules based on the bot base?
       
    9. zeldrak

      zeldrak Well-Known Member

      Joined:
      Oct 25, 2010
      Messages:
      3,516
      Likes Received:
      25
      Trophy Points:
      48
      Hey Vastico, could you either edit this to also include greens or post the proper code and where to place it? This is extremely helpful while I'm farming for rep and such, but I notice that I'm missing a shit ton of green items that can be DE'd or posted on the AH. I'm just trying to pull in every copper that I can get.
       
    10. Vastico

      Vastico New Member

      Joined:
      Jul 28, 2011
      Messages:
      424
      Likes Received:
      10
      Trophy Points:
      0
      You can change 'elseif LootSlotIsItem(i) and select(4, GetLootSlotInfo(i)) > 2' to 'elseif LootSlotIsItem(i) and select(4, GetLootSlotInfo(i)) > 1'

      Should work
       

    Share This Page