Go Back   RunUO - Ultima Online Emulation > Developer's Corner > Programming > Visual Basic

Visual Basic Visual Basic Discussion

Reply
 
Thread Tools Display Modes
Old 02-08-2007, 07:30 AM   #1 (permalink)
Forum Newbie
 
Join Date: Jan 2007
Posts: 1
Default How to get Char pos?

How to get char pos (x,z) in VB6? Could anyone show me an example or same tips how to get it? I found something about hooking, but i'm not sure if its nessesary. If anyone know easy way to get X and Y pleese post it here.
Sorry for my english....
aldak23 is offline   Reply With Quote
Old 08-01-2007, 03:49 PM   #2 (permalink)
Newbie
 
Join Date: Oct 2004
Location: Charleston, SC
Age: 27
Posts: 37
Send a message via ICQ to LightShade Send a message via AIM to LightShade
Default

Code:
using System;
using System.IO;
using System.Text;
using System.Collections;

using Server;
using Server.Network;
using Server.Guilds;

namespace Server.Misc
{
	public class peoplePage : Timer
	{
		public static void Initialize()
		{new peoplePage().Start();}

		public peoplePage() : base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(15.0))
		{Priority = TimerPriority.FiveSeconds;}

		private static string Encode(string input)
		{
			StringBuilder sb = new StringBuilder(input);

			sb.Replace("&", "&");
			sb.Replace("<", "&lt;");
			sb.Replace(">", "&gt;");
			sb.Replace("\"", "&quot;");
			sb.Replace("'", "&apos;");

			return sb.ToString();
		}

		protected override void OnTick()
		{
			if (!Directory.Exists("web"))
				Directory.CreateDirectory("web");

			using (StreamWriter op = new StreamWriter("web/show.xml"))
			{
				op.WriteLine("<Players>");
				

				foreach (NetState state in NetState.Instances)
				{
					Mobile m = state.Mobile;

					if (m != null)
					{
						op.WriteLine("	<PlayerInfo>");
						op.WriteLine("		<PlayerName>" + m.Name + "</PlayerName>");
						
						op.WriteLine("		<AccessLevel>" + m.AccessLevel + "</AccessLevel>");
						
						if (m.AccessLevel >= AccessLevel.GameMaster)
						{
							op.WriteLine("		<DontShow>True</DontShow>");
						}
						else
						{
							op.WriteLine("		<DontShow>False</DontShow>");
						}
						
						if (m.Hidden != false)
						{
							op.WriteLine("		<Hidden>True</Hidden>");	
						}
						else
						{
							op.WriteLine("		<Hidden>False</Hidden>");
						}
						
						op.WriteLine("		<xCoord>" + m.X + "</xCoord>");		
						op.WriteLine("		<yCoord>" + m.Y + "</yCoord>");	
						op.WriteLine("		<zCoord>" + m.Z + "</zCoord>");	
						op.WriteLine("		<Facet>" + m.Map + "</Facet>");	
						
						op.WriteLine("	</PlayerInfo>");
						
					}
				}

				
				op.WriteLine("</Players>");
			}
		}
	}
}
Shows you how to get the information you asked for and write it to an XML file...in case you wanted to use it for online tracking or whatever. Its a good lil script that I use for my online maps. I've never put a lot of time into scripting for RunUO as i'm more interested in doing stuff on the web end, so I had Roth show me how to do this.

Last edited by LightShade; 08-01-2007 at 03:52 PM.
LightShade 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