using System;
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;
namespace onNewDoodadExample {
public class mainClass : Core {
public static string GetPluginAuthor() {
return "user01";
}
public static string GetPluginVersion() {
return "1.0.0.0";
}
public static string GetPluginDescription() {
return "onNewDoodad Example";
}
// onNewDoodad Event Handler
private void processNewDoodad(DoodadObject obj) {
try {
// The lazy way is to check the distance and assume that any new Doodads near you are yours.
// A better way would be to match your unique ID with the owners ID on the doodad to verify its Yours, with a range of say 10 meters.
if (me.dist(obj) < 5) {
Log("New Doodad Found: "+obj.X.ToString()+", "+obj.Y.ToString()+", "+obj.Z.ToString());
}
} catch (Exception error) {
Log("There was an Error processing the newDoodad: "+error);
}
}
public void PluginRun() {
// public event CoreInternal.NewDoodad onNewDoodad
onNewDoodad += processNewDoodad;
while (true) {
Thread.Sleep(100);
}
}
public void PluginStop() {
// Nothing to do here
}
}
}