Go Back   RunUO - Ultima Online Emulation > RunUO > Utility Support > PlayUO (Krrios' Client)

PlayUO (Krrios' Client) Support & Etc for Krrios's UO Client.

Reply
 
Thread Tools Display Modes
Old 06-28-2004, 07:09 AM   #1 (permalink)
 
Join Date: Oct 2003
Posts: 11
Default Plugins

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 built the project without any errors and moved the DLL file to the /Plugins folder and also added #Test.dll to the Plugins.def.

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?
supster is offline   Reply With Quote
Old 07-01-2004, 07:43 AM   #2 (permalink)
 
Join Date: Oct 2003
Posts: 11
Default

Anyone?
supster is offline   Reply With Quote
Old 07-01-2004, 06:33 PM   #3 (permalink)
Not Nice
 
zero's Avatar
 
Join Date: Sep 2002
Posts: 780
Default

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;
		}
	}
}
Command prompt:
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.
Plugins.def:
Code:
#plugin.dll
Plugin1
Then just move your plugin.dll to the plugins folder with macros.dll.
zero is offline   Reply With Quote
Old 07-01-2004, 09:20 PM   #4 (permalink)
 
Join Date: Oct 2003
Posts: 11
Default

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?
supster is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5