Before I start using the events in archebuddy, do they work? I'm writing something to record how many coin purses I get and what i get from them.
- onGoldCountChanged
- onInvItemRemoved
- onNewInvItem
- onGoldCountChanged
- onInvItemRemoved
- onNewInvItem
Code:
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;
namespace CoinPurseRecords
{
public class CoinPurse : Core
{
public static string GetPluginAuthor()
{
return "NotPanda";
}
public static string GetPluginVersion()
{
return "0.0.1";
}
public static string GetPluginDescription()
{
return "Coin Purse Recorder";
}
public void PluginRun()
{
onNewInvItem += RecieveItem;
EnterRecord("New Session at " + DateTime.Now.ToString("MM\\/dd\\/yyyy h\\:mm tt") + " | " + getCurrentTerritory().displayName);
while(gameState == GameState.Ingame){
Thread.Sleep(100);
}
}
public void RecieveItem(Item item, int count){
EnterRecord(Time() + item.name);
}
public string Time()
{
string A = DateTime.Now.ToString("[hh:mm:ss] ");
return A;
}
public void EnterRecord(String x){
using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"Records" + me.name + ".txt", true))
{
Log(x);
file.WriteLine(x);
}
}
}
}
Last edited: