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

[Question] Do all the events work?

NotPanda

New Member
Joined
Jun 12, 2015
Messages
33
Reaction score
0
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

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:
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

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

Events works.
 
Typed everything up last night. Everything works way better than before now that I'm using the events.
 
Back
Top