UnknownUser
New Member
- Joined
- Jul 15, 2015
- Messages
- 6
- Reaction score
- 0
Being somewhat new to C#, It took me awhile to figure out how to use the onSkillCasting event, but after finally getting it to work, I have found that it does not trigger for a few spells. I think the correlation is not triggering level 55 spells, specifically God's Whip, Fiend's Knell, and Whirlwind's Blessing. It does seem to trigger for Grief's Cadence and Mirror Warp.
So I guess my questions will be: Am I doing something wrong? If so, what? If not, is this intended (ie not a bug)? If intended, is there a workaround? If not intended, any chance for a fix?
I include below my code:
So I guess my questions will be: Am I doing something wrong? If so, what? If not, is this intended (ie not a bug)? If intended, is there a workaround? If not intended, any chance for a fix?
I include below my code:
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 ArcheSampleCode
{
public class SampleCode : Core
{
static int DEBUG = 3; // Set Debug level 0-4
//Debug Function - Prints to log is debug level is greater than or equal to d
public void debug(int d, string message)
{
if (d <= DEBUG)
{
Log(message, false);
}
}
public static string GetPluginAuthor()
{
return "UnknownUser";
}
public static string GetPluginVersion()
{
return "1.0.0.0";
}
public static string GetPluginDescription()
{
return "Sample Code";
}
public void PluginRun()
{
debug(0, "Starting SampleCode Plugin");
onSkillCasting += SampleCode_onSkillCasting;
onNewDoodad += SampleCode_onNewDoodad;
while (true)
{
Thread.Sleep(300);
}
}
public void PluginStop()
{
}
public void SampleCode_onSkillCasting(Creature obj, SpawnObject obj2, Skill skill, double x, double y, double z)
{
string obj2Name = "";
if (obj2.type.ToString() == "Player")
{
Creature target = (Creature)(obj2);
obj2Name = target.name;
}
if (obj2.type.ToString() == "DoodadObject")
{
DoodadObject target = (DoodadObject)(obj2);
obj2Name = target.name;
}
if (obj2.type.ToString() == "Self")
{
obj2Name = me.name;
}
debug(3, "" + obj.name + " is casting " + skill.name + "(" + skill.id + ")" + " on " + obj2Name + "(" + obj2.type + ")");
}
void SampleCode_onNewDoodad(DoodadObject obj)
{
debug(3, "New Doodad: " + obj.name + ":" + obj.id);
}
}
}






