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

[Plugin] - BankStack - Bag Sorting

xsol

Member
Joined
Nov 7, 2011
Messages
503
Reaction score
12
Required AddOns: BankStack
Purpose: Things should be neat.
ToDo: this could be used as a place to start a plugin that lets you setup a list of commands to run at specific or "random" times.

The plugin will simply run the /sort command for BankStack every 15-30 minutes.

PHP:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;

using Styx;
using Styx.Logic;
using Styx.Helpers;
using Styx.Logic.Combat;
using Styx.Logic.Pathing;
using Styx.WoWInternals;
using Styx.Combat.CombatRoutine;
using Styx.WoWInternals.WoWObjects;
using Styx.Plugins.PluginClass;

namespace xsol.toolkit
{
    public class BagSort: HBPlugin
    {
        private Random rGen = new Random();
        private static LocalPlayer Me { get { return ObjectManager.Me; } }

        public override string Name { get { return "BagSort"; } }
        public override string Author { get { return "xsol"; } }
        public override Version Version { get { return new Version(0, 0); } }
        public override bool WantButton { get { return false; } }
        public override string ButtonText { get { return " "; } }

        public void Log(String sText)
        {
            Logging.Write("[" + Name + "] " + sText);
        }

        DateTime lastSort = DateTime.MaxValue;
        public override void Pulse()
        {
            if (lastSort > DateTime.Now)
            {
                Logging.Write(System.Drawing.Color.Beige, "Sorting Bags");
                Lua.DoString("SlashCmdList[\"SORT\"]();");
                lastSort = DateTime.Now;
            }
            else
            {
                if (lastSort.AddMinutes(rGen.Next(15, 30)) < DateTime.Now)
                {
                    Logging.Write(System.Drawing.Color.Beige, "Sorting Bags");
                    Lua.DoString("SlashCmdList[\"SORT\"]();");
                    lastSort = DateTime.Now;
                }
            }
        }
    }
}
 
  • Like
Reactions: Ama
nice work! this solves my problem
 
didnt know wow had a built in sort function, interesting. i thought you would of had to manually write an old school bubble sort method.
 
didnt know wow had a built in sort function, interesting. i thought you would of had to manually write an old school bubble sort method.

wow has no built-in function for sorting. This function comes from the addon BankStack
 
Thanks for a nice addon. As I am total noob when it comes to codding,w as thinking to modify your code and use it maybe for some other things to. If I wanna execute other commads I just need to edit this line:

Lua.DoString("SlashCmdList[\"SORT\"]();");

and instead of SORT write something like "2 WTS mom/dad and whole family"
 
Back
Top