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.
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;
}
}
}
}
}