|
||
|
|
#1 (permalink) |
|
Join Date: Oct 2003
Posts: 11
|
I tried PMing this to Krrios but I'm sure hes pretty busy so I thought I might be able to get an answer here.
Hey, I was trying to write a plugin for Krrios' client and it isn't working. Wanted to see if anyone could help. I'm using VS.NET as an IDE. I created a new C# Class Library project. I reference only Exposer.dll, System.Drawing, and System.Windows.Forms. Heres my code: Code:
using System;
using Client;
using System.Windows.Forms;
namespace KUOCPlugin
{
public class Plugin1:Plugin
{
IExposed m_Exposed;
public Plugin1()
{
}
public override void Run(IExposed e)
{
MessageBox.Show("TEST");
this.m_Exposed = e;
}
public override bool OnKeyDown(KeyEventArgs e)
{
if (e.KeyCode == Keys.F10)
m_Exposed.Say("Hello World!");
return true;
}
}
}
I load the client and login and nothing happens (I expected a message box saying "TEST"), when I hit F10 also nothing happens. It seems like the library is never getting called. So for fun I changed the line from #Test.dll to #Test.test (there is no file Test.test), and next time I loaded the client I recieved a FileNotFound exception. I'm stumped, do you have any clue what I'm doing wrong? |
|
|
|
|
|
#3 (permalink) |
|
Not Nice
Join Date: Sep 2002
Posts: 780
|
Problem solved:
Plugin source: Code:
using System;
using Client;
using System.Windows.Forms;
namespace KUOCPlugin
{
public class Plugin1:Plugin
{
private IExposed m_Exposed;
public Plugin1()
{
}
public override string Name
{
get { return "Plugin1"; }
}
public override string Description
{
get { return "A plugin for testing!"; }
}
public override void Run(IExposed e)
{
MessageBox.Show("TEST");
this.m_Exposed = e;
}
public override bool OnKeyDown(KeyEventArgs e)
{
if (e.KeyCode == Keys.F10)
m_Exposed.Say("Hello World!");
return true;
}
}
}
Code:
C:\source>csc /t:library /r:exposer.dll /r:client.exe plugin.cs Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4 for Microsoft (R) .NET Framework version 1.1.4322 Copyright (C) Microsoft Corporation 2001-2002. All rights reserved. Code:
#plugin.dll Plugin1 |
|
|
|
|
|
#4 (permalink) |
|
Join Date: Oct 2003
Posts: 11
|
Thanks, I didn't realize I had to put the class name under #plugin.dll as well.
I ran into another problem though, not it seems as normal keys arent being passed to the client after they are cought with OnKeyDown. For example, if I press F10, I will see a Hello World, but I can't begin typing as I normaly would with the client. All other normal macros (spell macros and such) work, but then surprisingly things like alt+f4 do not work. Any suggestion? edit: I fixed it by changing return true to return false on the OnKeyDown command, not sure if thats what its supposed to be, but it fixed it. Now can anyone show me some source examples? I'de like to know how to display info on the client itself. For example, how Krrios' Ping plugin is able to display text on the client or how his Halos draw healthbars below players. Is System.Drawing used? Oh, and any info on OnPacketRecv/Send would be apprecieated, I can't seem to get the events called no matter what I do. And how can I use the Client.OnTick delegate? |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|