Go Back   RunUO - Ultima Online Emulation > RunUO > Custom Script Release Archive

Custom Script Release Archive This is a pre-script database archive of what our users had released.

 
 
Thread Tools Display Modes
Old 06-21-2006, 12:14 PM   #1 (permalink)
Forum Expert
 
BeneathTheStars's Avatar
 
Join Date: Jul 2005
Location: (South)Tip o' Texas
Posts: 1,294
Send a message via AIM to BeneathTheStars Send a message via MSN to BeneathTheStars
Default [2.0 & 1.0] Console Commands v1.2

Problem with version 1.2? PM me. Problem with 2.x? Post in that thread.

VERSION 2 IS OUT! : http://runuo.com/forums/showthread.php?t=71396


CC Current version: 1.2
Information
With this script, you may input(type) commands into the console(Server.exe) without having to log on.

Supported Commands:
  • Shutdown - Saves and shutsdown the server.
  • Shutdown nosave - Closes the server without saving.
  • Restart - Broadcasts to everyone the server is restarting, saves, and restarts the server.
  • [New] Restart nosave - Restarts the server without saving.
  • Broadcast - Type this command, then it will ask what you would like to broadcast to everyone. It will then rely what it broadcasted, on the console: Player : <what you said here>
  • Staff - Type this command, then it will ask you what you would like to broadcast to your staff. It will then rely what it broadcasted, on the console: Staff : <what you said here>
  • Online - Shows a list of every person online: Account, Char Name, IP.
  • Save - Saves the world.
  • Consolehear - Routes all speech to the console: Char Name (Region name): Speech
  • Listor Help - Shows a list of available commands.

From v1.1 to v1.2:
Various "Performance Enhancement" fixes. New command, restart nosave, added.

Helpers:
Phantom, noobie, Ravatar, Zippy(for the hearall script),DontDropTheSOAD, Lord Neo, Pyro-Tech, HomeDaddy.

Screen Shots:
http://www.imagedonkey.com/show.php?...ction.bmp.html

Note: Version 1.2A only works for RunUO 2.0
Note: Version 1.2B only works for RunUO 1.0

Suggestions, Comments, Criticism all welcome!
Know a command you want implemented? Suggest it!
Attached Files
File Type: cs CC1.2A.cs (9.6 KB, 180 views)
File Type: cs CC1.2B.cs (9.5 KB, 121 views)

Last edited by BeneathTheStars; 07-13-2006 at 12:27 PM.
BeneathTheStars is offline  
Old 06-21-2006, 06:07 PM   #2 (permalink)
Forum Novice
 
Lord Neo's Avatar
 
Join Date: Feb 2005
Location: Upstate NY Ithaca
Age: 39
Posts: 146
Default Crash Report - Debug

Heres the crash report it produced
Code:
Server Crash Report
===================

RunUO Version 2.0, Build 2357.32527
Operating System: Microsoft Windows NT 5.1.2600 Service Pack 2
.NET Framework: 2.0.50727.42
Time: 6/21/2006 3:33:46 PM
Mobiles: 5164
Items: 74323
Clients:
- Count: 1


Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Server.Misc.ServerConsole.OnSpeech(SpeechEventArgs args) in c:\Program Files\RunUO\RunUO-2.0-RC1\Scripts\1Custom\CCv1[1].0A.cs:line 35
   at Server.SpeechEventHandler.Invoke(SpeechEventArgs e)
   at Server.EventSink.InvokeSpeech(SpeechEventArgs e)
   at Server.Mobile.DoSpeech(String text, Int32[] keywords, MessageType type, Int32 hue)
   at Server.Mobiles.PlayerMobile.DoSpeech(String text, Int32[] keywords, MessageType type, Int32 hue) in c:\Program Files\RunUO\RunUO-2.0-RC1\Scripts\Mobiles\PlayerMobile.cs:line 2224
   at Server.Network.PacketHandlers.UnicodeSpeech(NetState state, PacketReader pvSrc)
   at Server.Network.MessagePump.HandleReceive(NetState ns)
   at Server.Network.MessagePump.Slice()
   at Server.Core.Main(String[] args)
Lord Neo is offline  
Old 06-21-2006, 06:52 PM   #3 (permalink)
Forum Expert
 
Pyro-Tech's Avatar
 
Join Date: Oct 2003
Location: Carbondale, IL
Age: 23
Posts: 1,801
Send a message via MSN to Pyro-Tech
Default

Here is another crash report....happened when trying to speak in-game:

it is a debug one....dunno if it is same as lord neo's or not so....

Code:
Server Crash Report
===================

RunUO Version 2.0, Build 2357.32527
Operating System: Microsoft Windows NT 5.1.2600 Service Pack 2
.NET Framework: 2.0.50727.42
Time: 6/21/2006 5:49:24 PM
Mobiles: 2425
Items: 100042
Clients:
- Count: 1


Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Server.Misc.ServerConsole.OnSpeech(SpeechEventArgs args) in d:\RunUO Server 2.0\Scripts\Custom\New Scripts\Systems\CCv1.0A.cs:line 35
   at Server.SpeechEventHandler.Invoke(SpeechEventArgs e)
   at Server.EventSink.InvokeSpeech(SpeechEventArgs e)
   at Server.Mobile.DoSpeech(String text, Int32[] keywords, MessageType type, Int32 hue)
   at Server.Mobiles.PlayerMobile.DoSpeech(String text, Int32[] keywords, MessageType type, Int32 hue) in d:\RunUO Server 2.0\Scripts\Mobiles\PlayerMobile.cs:line 2162
   at Server.Network.PacketHandlers.UnicodeSpeech(NetState state, PacketReader pvSrc)
   at Server.Network.MessagePump.HandleReceive(NetState ns)
   at Server.Network.MessagePump.Slice()
   at Server.Core.Main(String[] args)
__________________

Pyro-Tech is offline  
Old 06-21-2006, 08:05 PM   #4 (permalink)
Forum Expert
 
BeneathTheStars's Avatar
 
Join Date: Jul 2005
Location: (South)Tip o' Texas
Posts: 1,294
Send a message via AIM to BeneathTheStars Send a message via MSN to BeneathTheStars
Default

Uploaded a fixed, 1.1 version. Please download A or B, whichever you need. Thank you both! Again, i welcome all feedback!

Last edited by BeneathTheStars; 06-21-2006 at 08:08 PM.
BeneathTheStars is offline  
Old 06-21-2006, 10:10 PM   #5 (permalink)
Moderate
 
David's Avatar
 
Join Date: Nov 2002
Location: USA
Posts: 6,598
Default

Awesome! Thanks for this update. I use them even on my development shard...
__________________
David Forum Moderator
The RunUO.com Forum Moderator Team

Forum Rules and Guidelines
RunUO Forum Search Engine
Download RunUO 2.0 RC2
David is offline  
Old 06-22-2006, 04:46 PM   #6 (permalink)
Forum Expert
 
BeneathTheStars's Avatar
 
Join Date: Jul 2005
Location: (South)Tip o' Texas
Posts: 1,294
Send a message via AIM to BeneathTheStars Send a message via MSN to BeneathTheStars
Default

Well, a total of 45 downloads, and only david has something to say about it? Anyone care to share some constructive criticism, or at least a few words on it?
BeneathTheStars is offline  
Old 06-22-2006, 05:12 PM   #7 (permalink)
Forum Novice
 
Evil Jason's Avatar
 
Join Date: Jan 2005
Location: The People's Republic of Massachusetts
Age: 33
Posts: 158
Talking

As soon as i use it.. i'll give some.. hehe...


wait that sounded bad... well not bad i guess... but.. well. anyway .. I'll let you know.. lol




~Evil Jason
__________________
So long and thanks for all the fish. :D

時々私poop
Quote:
Welcome to Thunderdome, Bitch.
Evil Jason is offline  
Old 06-22-2006, 06:04 PM   #8 (permalink)
Forum Novice
 
Nam01's Avatar
 
Join Date: Mar 2005
Posts: 126
Default hahahaha

hahahahaha
Nam01 is offline  
Old 06-22-2006, 07:39 PM   #9 (permalink)
Forum Expert
 
Join Date: Nov 2004
Location: Southeast Missouri USA
Age: 35
Posts: 283
Default

I just grabbed a copy myself.
Very cool concept! Useful too
Ashlar is offline  
Old 06-22-2006, 08:08 PM   #10 (permalink)
Newbie
 
Join Date: Apr 2006
Location: Barcelona, Spain
Age: 22
Posts: 50
Default

Mi PC loves you. Thank you very much for this.
__________________
A.K.A. Ansalon

Our project to a roleplaying spanish shard

http://www.UltimoReducto.com
Alain Delocke is offline  
Old 06-23-2006, 01:00 AM   #11 (permalink)
Forum Expert
 
milt's Avatar
 
Join Date: Nov 2003
Location: Lancaster, PA
Age: 20
Posts: 1,606
Send a message via AIM to milt Send a message via Yahoo to milt Send a message via Skype™ to milt
Default

Very good idea, +karma.
__________________
--Milt, AKA Pokey
milt is offline  
Old 06-23-2006, 02:25 AM   #12 (permalink)
Forum Expert
 
Pyro-Tech's Avatar
 
Join Date: Oct 2003
Location: Carbondale, IL
Age: 23
Posts: 1,801
Send a message via MSN to Pyro-Tech
Default

I like it...saves me time having to log in to force a save when i need to shut down
__________________

Pyro-Tech is offline  
Old 06-23-2006, 02:37 AM   #13 (permalink)
Forum Expert
 
Liacs's Avatar
 
Join Date: Mar 2004
Location: Belgium / Germany
Age: 31
Posts: 1,031
Send a message via MSN to Liacs
Default

Wow, this looks veeeeery useful. Will test it tonight

Thanks!

Lia
__________________
;)My C# Bookshelf (carpented by Soultaker);)

BTW: Please ask questions in the adequat forum and not on a private message! Otherwise nobody can learn from it!
Liacs is offline  
Old 06-23-2006, 03:00 AM   #14 (permalink)
Forum Novice
 
Join Date: May 2004
Location: Canada
Age: 35
Posts: 158
Default

This I could use, ty for sharing
dragonlady is offline  
Old 06-23-2006, 03:40 AM   #15 (permalink)
Forum Newbie
 
Join Date: Jun 2006
Age: 28
Posts: 21
Default

this script is awesome. i use it on my 2.0 development shard and it is a life saver. saves the time of having to load of uog then login and then save/shutdown whatever. it has saved me countless minutes.

thanks!
Total Failure is offline  
Old 06-25-2006, 08:53 PM   #16 (permalink)
Forum Newbie
 
Join Date: Feb 2004
Location: Australia
Age: 39
Posts: 62
Send a message via MSN to HomeDaddy Send a message via Yahoo to HomeDaddy
Default

I love it, saves heaps of time. Don't need to log in to do a save etc.

Great job on this, it is something that was really lacking, in fact when I first set up the server i automatically tried to type save in the console window and was surprised it hadn't been thought of.

Oh, BTW, in the List command you didnt list all the commands, you missed consolehear, so I added that, then got carried away and expanded it to include descriptions of each command, as well as including the clasic 'help' just incase. I also re-arranged the list to, what for me, is a more logical order.
I also changed it so that when you do the restart command, the message it sends is from [Server] not [Staff], so players know it is an automated thing, not just staff telling them, but that's just me.

Here is mine if you would like to see it.

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using Server;
using System.Threading;
using Server.Commands;
using System.Diagnostics;
using Server.Gumps;
using Server.Network;
using Server.Mobiles;
using Server.Accounting;

namespace Server.Misc
{
    class ServerConsole
    {
        private static bool Hearconsole;
        private static ArrayList m_ConsoleHear = new ArrayList();
        public static void Initialize()
        {
            EventSink.ServerStarted += new ServerStartedEventHandler(EventSink_ServerStarted);
            EventSink.Speech += new SpeechEventHandler(OnSpeech);
        }

        public static void EventSink_ServerStarted()
        {
            new Thread(new ThreadStart(ConsoleListen)).Start();
            Console.WriteLine("CC initialized...");
        }

        private static void OnSpeech(SpeechEventArgs args)
        {
            if (args.Mobile != null)
            {
                try
                {
                    string msg;
                    if (args.Mobile.Region.Name.Length > 0)
                        msg = String.Format("{0} ({1}): {2}", args.Mobile.Name, args.Mobile.Region.Name, args.Speech);
                    else
                        msg = String.Format("{0}: {1}", args.Mobile.Name, args.Speech);
                    if (Hearconsole)
                        Console.WriteLine(msg);
                }
                catch { }
            }
        }
        public static void ConsoleListen()
        {
            string input = Console.ReadLine();
            Next(input);
        }
        public static void PBroadCast()
        {
            string input = Console.ReadLine();
            BroadcastMessage(AccessLevel.Player, 0x35, String.Format("[Admin] {0}", input));
            Console.WriteLine("Player: {0}", input);
        }
        public static void SBroadCast()
        {
            string input = Console.ReadLine();
            BroadcastMessage(AccessLevel.Counselor, 0x35, String.Format("[Admin] {0}", input));
            Console.WriteLine("Staff: {0}", input);
        }
        public static void BroadcastMessage(AccessLevel ac, int hue, string message)
        {
            foreach (NetState state in NetState.Instances)
            {
                Mobile m = state.Mobile;

                if (m != null && m.AccessLevel >= ac)
                    m.SendMessage(hue, message);
            }
        }
        public static void Next(string input)
        {
            string line = input.ToLower();
            switch (line)
            {
                case "shutdown":
                    {
                        World.Save();
                        Core.Process.Kill();
                        break;
                    }
                case "shutdown nosave":
                    {
                        Core.Process.Kill();
                        break;
                    }
                case "restart":
                    {
                        BroadcastMessage(AccessLevel.Player, 0x35, String.Format("[Server] The Server is restarting ..."));
                        World.Save();
                        Process.Start(Core.ExePath);
                        Core.Process.Kill();
                        break;
                    }
                case "broadcast":
                    {
                        Console.WriteLine("What would you like to say to everyone?");
                        new Thread(new ThreadStart(PBroadCast)).Start();
                        break;
                    }
                case "online":
                    {
                        ArrayList list = new ArrayList();
                        List<NetState> states = NetState.Instances;
                        if (states.Count == 0)
                        { Console.WriteLine("There are no users online at this time."); }
                        for (int i = 0; i < states.Count; ++i)
                        {
                            Account a = states[i].Account as Account;
                            if (a == null)
                                continue;
                            Mobile m = states[i].Mobile;
                            if (m != null)
                                Console.WriteLine("- Account: {0}, Name: {1}, IP: {2}", a.Username, m.Name, states[i]);
                        }
                        break;
                    }
                case "list":
                    {
			Console.WriteLine(" ");
			Console.WriteLine("Commands:");
			Console.WriteLine("save -            Performs a forced save.");
			Console.WriteLine("shutdown -        Performs a forced save then shuts down the server.");
			Console.WriteLine("shutdown nosave - Shuts down the server without saving.");
			Console.WriteLine("restart -         Sends a message to players informing them that the server is");
			Console.WriteLine("                      restarting, performs a forced save, then shuts down and");
			Console.WriteLine("                      restarts the server.");
			Console.WriteLine("online -          Shows a list of every person online:");
			Console.WriteLine("                      Account, Char Name, IP.");
			Console.WriteLine("broadcast -       Type this command, then you will be prompted for a message");
			Console.WriteLine("                      to send. The message will then be relayed to all players.");
			Console.WriteLine("Staff -           Type this command, then you will be prompted for a message");
			Console.WriteLine("                      to send.  The message will then be relayed to all staff.");
			Console.WriteLine("consolehear -     Copies all local speech to this console:");
			Console.WriteLine("                      Char Name (Region name): Speech.");
			Console.WriteLine("list or help -    Shows this list.");
			Console.WriteLine(" ");
                        break;
                    }
                case "help":
                    {
			Console.WriteLine(" ");
			Console.WriteLine("Commands:");
			Console.WriteLine("save -            Performs a forced save.");
			Console.WriteLine("shutdown -        Performs a forced save then shuts down the server.");
			Console.WriteLine("shutdown nosave - Shuts down the server without saving.");
			Console.WriteLine("restart -         Sends a message to players informing them that the server is");
			Console.WriteLine("                      restarting, performs a forced save, then shuts down and");
			Console.WriteLine("                      restarts the server.");
			Console.WriteLine("online -          Shows a list of every person online:");
			Console.WriteLine("                      Account, Char Name, IP.");
			Console.WriteLine("broadcast -       Type this command, then you will be prompted for a message");
			Console.WriteLine("                      to send. The message will then be relayed to all players.");
			Console.WriteLine("Staff -           Type this command, then you will be prompted for a message");
			Console.WriteLine("                      to send.  The message will then be relayed to all staff.");
			Console.WriteLine("consolehear -     Copies all local speech to this console:");
			Console.WriteLine("                      Char Name (Region name): Speech.");
			Console.WriteLine("list or help -    Shows this list.");
			Console.WriteLine(" ");
                        break;
                    }
                case "save":
                    {
                        World.Save();
                        break;
                    }
                case "staff":
                    {
                        Console.WriteLine("What would you like to say to your staff?");
                        new Thread(new ThreadStart(SBroadCast)).Start();
                        break;
                    }
                case "consolehear"://credit to Zippy for the HearAll script!
                    {
                        Hearconsole = !Hearconsole;
                        if (Hearconsole)
                            Console.WriteLine("Now sending all speech to the console.");
                        else
                            Console.WriteLine("No longer sending speech to the console.");
                        break;
                    }
                default:
                    {
			Console.WriteLine(" ");
			Console.WriteLine("Commands:");
			Console.WriteLine("save -            Performs a forced save.");
			Console.WriteLine("shutdown -        Performs a forced save then shuts down the server.");
			Console.WriteLine("shutdown nosave - Shuts down the server without saving.");
			Console.WriteLine("restart -         Sends a message to players informing them that the server is");
			Console.WriteLine("                      restarting, performs a forced save, then shuts down and");
			Console.WriteLine("                      restarts the server.");
			Console.WriteLine("online -          Shows a list of every person online:");
			Console.WriteLine("                      Account, Char Name, IP.");
			Console.WriteLine("broadcast -       Type this command, then you will be prompted for a message");
			Console.WriteLine("                      to send. The message will then be relayed to all players.");
			Console.WriteLine("Staff -           Type this command, then you will be prompted for a message");
			Console.WriteLine("                      to send.  The message will then be relayed to all staff.");
			Console.WriteLine("consolehear -     Copies all local speech to this console:");
			Console.WriteLine("                      Char Name (Region name): Speech.");
			Console.WriteLine("list or help -    Shows this list.");
			Console.WriteLine(" ");
                        break;
                    }
            }
            new Thread(new ThreadStart(ConsoleListen)).Start();
        }
    }
}
One addition I would like to see is an expansion on the consolehear command so that it includes all public messages etc sent using Knives chat. I think it is the most widely used 'chat' system and I personally haven't seen a shard without it, and having the [c public messages shown as well as local speech would be a great addition, but I wouldn't know where to start.

And everyone, please don't PM saying your shard doesn't use Knives chat, im sure there are a few out there that don't.

Keep up the great work.

HDy
__________________
My signature was Deleted AGAIN by an unidentified person who didn't like what I had to say....

Last edited by HomeDaddy; 06-25-2006 at 10:01 PM.
HomeDaddy is offline  
Old 06-25-2006, 09:43 PM   #17 (permalink)
Forum Expert
 
BeneathTheStars's Avatar
 
Join Date: Jul 2005
Location: (South)Tip o' Texas
Posts: 1,294
Send a message via AIM to BeneathTheStars Send a message via MSN to BeneathTheStars
Default

Thx for the kind words all, and thx for the report HomeDaddy!
BeneathTheStars is offline  
Old 06-25-2006, 10:26 PM   #18 (permalink)
Forum Expert
 
BeneathTheStars's Avatar
 
Join Date: Jul 2005
Location: (South)Tip o' Texas
Posts: 1,294
Send a message via AIM to BeneathTheStars Send a message via MSN to BeneathTheStars
Default

Version 1.2 Released. Various "Performance Enhancement" fixes. New command, restart nosave, added.
BeneathTheStars is offline  
Old 06-25-2006, 11:18 PM   #19 (permalink)
Forum Newbie
 
Join Date: Jun 2006
Age: 28
Posts: 21
Default

Quote:
Originally Posted by BeneathTheStars
Version 1.2 Released. Various "Performance Enhancement" fixes. New command, restart nosave, added.
Very nice update! restart nosave is awesome. keep up the great work!
Total Failure is offline  
Old 06-26-2006, 11:05 AM   #20 (permalink)
Forum Newbie
 
Join Date: Feb 2004
Location: Australia
Age: 39
Posts: 62
Send a message via MSN to HomeDaddy Send a message via Yahoo to HomeDaddy
Default

Nice addition with the Restart nosave, and thanks for the recognition for the verbose list.
I look forward to seeing V1.3 (including the consolehear function echoing knives chat [c messages.... lol)

Keep it up.
HDy
__________________
My signature was Deleted AGAIN by an unidentified person who didn't like what I had to say....
HomeDaddy is offline  
Old 06-26-2006, 12:58 PM   #21 (permalink)
 
Join Date: Dec 2005
Posts: 41
Default

Very nice! I've wanted this!
Padriac is offline  
Old 06-26-2006, 03:03 PM   #22 (permalink)
Forum Newbie
 
Join Date: Feb 2006
Posts: 30
Default

This is one of the best scripts in a long time.

I got a idea how to advance the script. The option of allowing ssh connection (and maybe telnet) to the server and be able to control the server using those commands. This will be most likley much more complicated but would still be a nice feature
Carlosos is offline  
Old 06-26-2006, 03:05 PM   #23 (permalink)
Forum Expert
 
BeneathTheStars's Avatar
 
Join Date: Jul 2005
Location: (South)Tip o' Texas
Posts: 1,294
Send a message via AIM to BeneathTheStars Send a message via MSN to BeneathTheStars
Default

Thx for the suggestions everyone! Working on the new version now.

To Carlosos - I will take some time to familiarize myself with thoose and see what i can come up with!
BeneathTheStars is offline  
Old 06-26-2006, 04:17 PM   #24 (permalink)
Forum Expert
 
Johabius's Avatar
 
Join Date: Dec 2004
Location: Kansas, USA
Age: 37
Posts: 4,964
Send a message via ICQ to Johabius Send a message via Yahoo to Johabius
Default

Thank you Charon! Very helpful thing to have on any shard!
__________________
In some cases stupid makes you win-Radwen
Johabius is offline  
Old 06-27-2006, 02:52 AM   #25 (permalink)
Forum Newbie
 
Join Date: Sep 2005
Posts: 20
Default

It would be great to see readline functionality in it. Sth like mysql client has - separate command line with history, not interrupted by console output.
Imperior is offline  
 

Bookmarks