Is there a script or a command that will pop up an alert in my chat box whenever a new player logs onto my shard?
 
you can simply hook into the event for that
I'm sorry - I don't understand what you're saying. What I am hoping to find is a script that works like the official Ultima Online servers. I was a Companion before they shut down the program. Being a Companion meant that every time a [Young] character entered the shard, a system message would appear. I could then jump to the new person or (I think) I could message them,.

What I'm looking for is a way to get a system message in my UO client whenever someone joins the server. I used [admin to jump to them and see if they need help but if there's a script that will do all this that would be brilliant.
 
What I ment is that you would go and look at the EventSink and then take the Login event and hook into that.
Like this.

C#:
EventSink.Login += OnLogin;

So here you got a full working example that gives a server wide message if a young player logs in.

C#:
using Server.Mobiles;

namespace Server.Custom.LoginMessage
{
    public static class LoginMessage
    {
        public static void Configure()
        {
            EventSink.Login += OnLogin;
        }

        private static void OnLogin(LoginEventArgs e)
        {
            if (((PlayerMobile)e.Mobile).Young)
            {
                World.Broadcast(0, false, "A new adventurer has arrived. The name is " + e.Mobile.Name);
            }
        }
    }
}
 
I was a companion too, those were fun times. I admitted I occasionally used my 'powers' for selfish needs. lol
I think i still have the document with the rules they handed out in the IRC chat room.
 
It would be easy to set something up like that, although learn from OSI mistake, add a switch that when certain commands are used you become frozen or very limited until the command is used again to return you to the home location. Also allow the command only to work in certain regions. At the beginning stages of the companion program they accidently let a teleport command in, so I made a few runes to some impossible to reach locations.
 
Sins I collect everything I can find about UO that would be interested it might be something I'm missing or older/newer version.

Here are some related things :D

The GM guide book is 181 MB so I don't add it.

Edit: I was an [companion] on Europa.

-Grim
 

Attachments

  • Companion.20000826.V2.0a.zip
    31.2 KB · Views: 20
  • Companion.20000923.V2.0b.zip
    25.2 KB · Views: 12
  • EM_Resp_II.zip
    6.2 KB · Views: 14
  • SeniorComp.20000810.V3.0.zip
    12.1 KB · Views: 12
  • ToolsTraining.V2.3.zip
    13.9 KB · Views: 22
  • UO Event Moderator Consulting (EARS Reuse) Template (rev. 11-07) (final_081125).zip
    22.3 KB · Views: 16
  • Counselor.20001129.V5.1.zip
    52.8 KB · Views: 16
Last edited:
I've been working on this script today, and got it to notify whenever a player logged in. That's ok, but it also notifies whenever a staff member logs in. With that, eventually people will know what player accounts belong to GMs as well. I thought about trying to use AccessLevel.Player, but I can't seem to get that to work. Does anyone have any thoughts on this? I want it to NOT broadcast when a staff member logs in.
 
Changing that section to something like

Code:
        private static void OnLogin(LoginEventArgs e)
        {
        if (e.Mobile.Player)
        {
            PlayerMobile pm = e.Mobile as PlayerMobile;
                    if (pm !=null && pm.Young  && (e.Mobile.AccessLevel == AccessLevel.Player) ) //broadcast for young players
                    {
                    World.Broadcast(0, false, "A new adventurer has arrived. The name is " + e.Mobile.Name);
                    }
        }
        }

should do the trick. I haven't actually tested the code since I already have a similar script in place. I think some of my formatting got chewed up in the paste but it should be ok :D
 
Thanks for the quick reply. I'll give it a go!
Post automatically merged:

Thanks Pyro and Falcor. What I ended up with in the end is:

C#:
using System;
using Server.Mobiles;

namespace Server.Custom.LoginMessage
{
    public static class LoginMessage
    {
        public static void Configure()
        {
            EventSink.Login += OnLogin;
        }

        private static void OnLogin(LoginEventArgs e)
        {
        if (e.Mobile.Player)
        {
            PlayerMobile pm = e.Mobile as PlayerMobile;
            if (pm !=null && pm.Young  && (e.Mobile.AccessLevel == AccessLevel.Player) ) //broadcast for young players
            {
            World.Broadcast(0, false, "A new adventurer has arrived! Hail and well met " + e.Mobile.Name + "!");
            }
            if (pm !=null && (e.Mobile.AccessLevel == AccessLevel.Player) )
            {
            World.Broadcast(0, false, "Welcome back to our shard " + e.Mobile.Name + "!");   
            }
        }
    }
}
}
 
Last edited:
If you change the "if" between the two possible broadcast commands to "else if", people will get one message or the other. Otherwise new players will get both messages when they log in since they still meet the conditions of the statement.
 
Back