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 01-22-2005, 04:26 AM   #1 (permalink)
 
Join Date: Jan 2005
Age: 24
Posts: 174
Send a message via MSN to aleon
Thumbs up Status Page Competable To Runuo 1.0

Well in some shards people add there status page into the shard web site well why get tired of clicking and waiting to reach the site why not see the status in the real game here is the script it's compatable its good.(Thanks Bondb)Its his module but edited by me

Code:
using System;
using System.Diagnostics;
using System.Collections;
using System.Net;

using Server.Network;
using Server.Mobiles;
using Server.Accounting;
using Server.Guilds;
using Server.Items;
using Server.Misc;

namespace Server.Gumps
{
   public class StatusGump : Gump
   {
      public static void Initialize()
      {
         Commands.Register( "status", AccessLevel.Player, new CommandEventHandler( Status_OnCommand ) );
         Commands.Register( "ServerStatus", AccessLevel.Player, new CommandEventHandler( Status_OnCommand ) );
      }

      [Usage( "ServerStatus" )]
      [Description( "Show server status page." )]
      private static void Status_OnCommand( CommandEventArgs e )
      {
         e.Mobile.CloseGump( typeof(StatusGump) );
         e.Mobile.SendGump( new StatusGump( e.Mobile, 0, null, null ) );
      }

      public void AddBlackAlpha( int x, int y, int width, int height )
      {
         AddImageTiled( x, y, width, height, 2624 );
         AddAlphaRegion( x, y, width, height );
      }

      public static string FormatTimeSpan( TimeSpan ts )
      {
         return String.Format( "{0:D2}:{1:D2}:{2:D2}:{3:D2}", ts.Days, ts.Hours % 24, ts.Minutes % 60, ts.Seconds % 60 );
      }

      public static string FormatByteAmount( long totalBytes )
      {
         if ( totalBytes > 1000000000 )
            return String.Format( "{0:F1} GB", (double)totalBytes / 1073741824 );

         if ( totalBytes > 1000000 )
            return String.Format( "{0:F1} MB", (double)totalBytes / 1048576 );

         if ( totalBytes > 1000 )
            return String.Format( "{0:F1} KB", (double)totalBytes / 1024 );

         return String.Format( "{0} Bytes", totalBytes );
      }

      private ArrayList m_List;
      private int m_ListPage;
      private int[] m_CountList;

      public StatusGump( Mobile from, int listPage, ArrayList list, int[] count ) : base( 140, 80 )
      {
         from.CloseGump( typeof( StatusGump ) );

         m_List = list;
         m_ListPage = listPage;
         m_CountList = count;
         AddPage( 0 );

         AddBackground( 0, 0, 800, 600, 0x53 );

         AddImageTiled( 15, 15, 770, 17, 5154 );
         AddHtml( 15, 15, 770, 17, "<div align=\"center\" color=\"2100\">"+ ServerList.ServerName +"</div>", false, false );

	int t = NetState.Instances.Count;
	if (t != 0)
	{
		ArrayList KList = new ArrayList( NetState.Instances );
		for( int s = 0; s < t; ++s)
		{
			NetState nsk = KList[s] as NetState;
			if ( nsk == null )
				continue;
			Mobile mk = nsk.Mobile;
			if ( mk == null )
			{
				continue;
			}
			else
			{
				if ((from.AccessLevel == AccessLevel.Player && (( mk.AccessLevel == AccessLevel.Counselor && mk.Hidden ) || mk.AccessLevel >= AccessLevel.GameMaster )) || (from.AccessLevel >= AccessLevel.Player && mk.AccessLevel > from.AccessLevel))
				{
					--t;
				}
			}
		}
	}

         AddImageTiled( 15, 37, 190, 17, 5154 );
         AddLabel( 17, 36, 0x25, "Online :" );
         AddHtml( 160, 37, 30, 17, "<div align=\"right\" color=\"2100\">"+ t.ToString() +"</div>", false, false );

         AddImageTiled( 210, 37, 190, 17, 5154 );
         AddLabel( 212, 36, 0x68, "Accounts :" );
         AddHtml( 357, 37, 30, 17, "<div align=\"right\" color=\"2100\">"+ Accounts.Table.Count.ToString() +"</div>", false, false );

         AddImageTiled( 405, 37, 190, 17, 5154 );
         AddLabel( 407, 36, 2100, "Uptime :" );
         AddHtml( 485, 37, 109, 17, "<div align=\"right\" color=\"2100\">"+ FormatTimeSpan( DateTime.Now - Clock.ServerStart) +"</div>", false, false );

         AddImageTiled( 600, 37, 185, 17, 5154 );
         AddLabel( 602, 36, 2100, "RAM in use :" );
         AddHtml( 700, 37, 75, 17, "<div align=\"right\" color=\"2100\">"+ FormatByteAmount( GC.GetTotalMemory( false ) ) +"</div>", false, false );
            // A3C BB8 DAC E10 13BE 13EC 1400 1432 23F0 238C 23BE 2422 242C 2436 2454 2486 24A4 24AE 24B8 24EA 251C 254E 2557 2560 ?2776?
         AddBackground( 15, 59, 770, 526, 0x2454);
         AddBlackAlpha( 18, 62, 763, 520);
         AddLabelCropped(  20, 60, 220, 20, 2100, "Name" );
         AddLabelCropped( 222, 60, 209, 20, 2100, "Guild" );
         AddLabelCropped( 453, 60, 60, 20, 2100, "SumStats" );
         AddLabelCropped( 515, 60, 60, 20, 2100, "Skills" );
         AddLabelCropped( 577, 60, 60, 20, 2100, "Karma" );
         AddLabelCropped( 639, 60, 60, 20, 2100, "Fame" );
         AddLabelCropped( 701, 60, 60, 20, 2100, "Kills" );

         if ( m_List == null )
            m_List = new ArrayList( NetState.Instances );

         if ( (m_CountList == null) && (m_List.Count>25))
            m_CountList = new int[(int)(m_List.Count/25)];

         if ( listPage > 0 )
            AddButton( 744, 62, 0x15E3, 0x15E7, 1, GumpButtonType.Reply, 0 );
         else
            AddImage( 744, 62, 0x25EA );

         if ( (listPage + 1) * 25 < m_List.Count )
            AddButton( 761, 62, 0x15E1, 0x15E5, 2, GumpButtonType.Reply, 0 );
         else
            AddImage( 761, 62, 0x25E6 );
}
}
}
Just Add this into the custom folder the command is status if you want to change the command

Code:
Commands.Register( "status", AccessLevel.Player, new CommandEventHandler( Status_OnCommand ) );
change the status name into something else

Thnks Runuo More Post's From Me And All Runuo Fans Will Come Further More :
aleon is offline  
Old 01-22-2005, 03:49 PM   #2 (permalink)
 
Join Date: Oct 2003
Posts: 34
Send a message via ICQ to Merlex
Default It dont compile

you forgot to add these at the end of the script or it wont compile
}
}
}
Merlex is offline  
Old 01-22-2005, 05:49 PM   #3 (permalink)
 
Join Date: Jan 2005
Age: 24
Posts: 174
Send a message via MSN to aleon
Default

opps sorry forgot let's add them..
aleon is offline  
Old 01-23-2005, 01:47 AM   #4 (permalink)
 
Join Date: Oct 2003
Posts: 34
Send a message via ICQ to Merlex
Default Not a prob

I just figured if someone didnt tell ya you wil lget flooded with IM that it dont work haha
Merlex is offline  
Old 01-23-2005, 11:52 AM   #5 (permalink)
 
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
Default

oops was posting some errors i got, but i got them because i failed to copy ALL of the text in your script its fine now.
__________________
[list][*]Visit Spherical Solaris Website![*]Spherical Solaris Shard[/list:u]
SphericalSolaris is offline  
Old 01-23-2005, 01:46 PM   #6 (permalink)
 
Join Date: Jan 2005
Age: 24
Posts: 174
Send a message via MSN to aleon
Default

are there any problems ?
aleon is offline  
Old 01-23-2005, 03:02 PM   #7 (permalink)
 
Join Date: Nov 2004
Age: 44
Posts: 42
Default

Hello,

I have the nice Gump. It shows how many accounts I have and how many people are logged in, however it shows no stats for anyone.... I just cut and pasted into a clean RUO1.0.0 I am behind a router on a LAN with four users... Any ideas?

A.V.
averisimilitude is offline  
Old 01-23-2005, 05:48 PM   #8 (permalink)
 
Join Date: Jan 2005
Age: 24
Posts: 174
Send a message via MSN to aleon
Default

hmm well good idea ..start modifying my status script
aleon is offline  
Old 01-26-2005, 03:39 AM   #9 (permalink)
 
Join Date: Jan 2005
Age: 28
Posts: 24
Send a message via ICQ to frozencorpse Send a message via MSN to frozencorpse Send a message via Yahoo to frozencorpse
Default

Yeah I have the same problem here, but I am running a 1.0.0 server so what can be wrong? I see no script in there to get the info to show. No Loops, no nothing Just the huge gump. rsss it can be a good work, but need to work and, now that you are fixing it, try to put some admin stuff like, I dont think its so good to show all this info to everyone, I mean, its kaind of "private" stuff you know? Yours stats and skills and all. I think that it can be interesting to put a bool if i need this info showing or not. ok? I can do it my self on the script but I think that an implement of your part could be the best way rs.

Good work, keep doing it.
frozencorpse is offline  
Old 01-26-2005, 03:43 AM   #10 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Quote:
Originally Posted by frozencorpse
Yeah I have the same problem here, but I am running a 1.0.0 server so what can be wrong? I see no script in there to get the info to show. No Loops, no nothing Just the huge gump. rsss it can be a good work, but need to work and, now that you are fixing it, try to put some admin stuff like, I dont think its so good to show all this info to everyone, I mean, its kaind of "private" stuff you know? Yours stats and skills and all. I think that it can be interesting to put a bool if i need this info showing or not. ok? I can do it my self on the script but I think that an implement of your part could be the best way rs.

Good work, keep doing it.
What?
Phantom is offline  
Old 01-26-2005, 04:05 AM   #11 (permalink)
Forum Newbie
 
Join Date: Feb 2004
Posts: 51
Default

lol, words out of my mouth Phantom.
nitewender is offline  
Old 01-26-2005, 12:48 PM   #12 (permalink)
 
Join Date: Nov 2004
Age: 44
Posts: 42
Default Working Gump

Hello,

After a bit of searching I found this and made sure it works with 1.0.0

Code:
// created by BondD
using System;
using System.Diagnostics;
using System.Collections;
using System.Net;

using Server.Network;
using Server.Mobiles;
using Server.Accounting;
using Server.Guilds;
using Server.Items;
using Server.Misc;

namespace Server.Gumps
{
   public class StatusGump : Gump
   {
      public static void Initialize()
      {
         Commands.Register( "SStat", AccessLevel.Player, new CommandEventHandler( Status_OnCommand ) );
         Commands.Register( "ServerStatus", AccessLevel.Player, new CommandEventHandler( Status_OnCommand ) );
      }

      [Usage( "ServerStatus" )]
      [Description( "Show server status page." )]
      private static void Status_OnCommand( CommandEventArgs e )
      {
         e.Mobile.CloseGump( typeof(StatusGump) );
         e.Mobile.SendGump( new StatusGump( e.Mobile, 0, null, null ) );
      }

      public void AddBlackAlpha( int x, int y, int width, int height )
      {
         AddImageTiled( x, y, width, height, 2624 );
         AddAlphaRegion( x, y, width, height );
      }

      public static string FormatTimeSpan( TimeSpan ts )
      {
         return String.Format( "{0:D2}:{1:D2}:{2:D2}:{3:D2}", ts.Days, ts.Hours % 24, ts.Minutes % 60, ts.Seconds % 60 );
      }

      public static string FormatByteAmount( long totalBytes )
      {
         if ( totalBytes > 1000000000 )
            return String.Format( "{0:F1} GB", (double)totalBytes / 1073741824 );

         if ( totalBytes > 1000000 )
            return String.Format( "{0:F1} MB", (double)totalBytes / 1048576 );

         if ( totalBytes > 1000 )
            return String.Format( "{0:F1} KB", (double)totalBytes / 1024 );

         return String.Format( "{0} Bytes", totalBytes );
      }

      private ArrayList m_List;
      private int m_ListPage;
      private ArrayList m_CountList;

      public StatusGump( Mobile from, int listPage, ArrayList list, ArrayList count ) : base( 140, 80 )
      {
         from.CloseGump( typeof( StatusGump ) );
         
         m_List = list;
         m_ListPage = listPage;   
         m_CountList = count;
         AddPage( 0 );

         AddBackground( 0, 0, 800, 600, 0x53 );

         AddImageTiled( 15, 15, 770, 17, 5154 );
         AddHtml( 15, 15, 770, 17, "<div align=\"center\" color=\"2100\">"+ ServerList.ServerName +"</div>", false, false );

	int t = NetState.Instances.Count;
	if (t != 0)
	{
		ArrayList KList = new ArrayList( NetState.Instances );
		for( int s = 0; s < t; ++s)
		{
			NetState nsk = KList[s] as NetState;
			if ( nsk == null )
				continue;
			Mobile m = nsk.Mobile;
			if ( m == null )
			{
				continue;
			}
			else
			{
				if ((from.AccessLevel == AccessLevel.Player && (( m.AccessLevel == AccessLevel.Counselor && m.Hidden ) || m.AccessLevel >= AccessLevel.GameMaster )) || (from.AccessLevel >= AccessLevel.Player && m.AccessLevel > from.AccessLevel))
				{
					--t;
				}
			}
		}
	}

         AddImageTiled( 15, 37, 190, 17, 5154 );
         AddLabel( 17, 36, 0x25, "Online :" );
         AddHtml( 160, 37, 30, 17, "<div align=\"right\" color=\"2100\">"+ t.ToString() +"</div>", false, false );

         AddImageTiled( 210, 37, 190, 17, 5154 );
         AddLabel( 212, 36, 0x68, "Accounts :" );
         AddHtml( 357, 37, 30, 17, "<div align=\"right\" color=\"2100\">"+ Accounts.Table.Count.ToString() +"</div>", false, false );

         AddImageTiled( 405, 37, 190, 17, 5154 );
         AddLabel( 407, 36, 2100, "Uptime :" );
         AddHtml( 485, 37, 109, 17, "<div align=\"right\" color=\"2100\">"+ FormatTimeSpan( DateTime.Now - Clock.ServerStart) +"</div>", false, false );

         AddImageTiled( 600, 37, 185, 17, 5154 );
         AddLabel( 602, 36, 2100, "RAM in use :" );
         AddHtml( 700, 37, 75, 17, "<div align=\"right\" color=\"2100\">"+ FormatByteAmount( GC.GetTotalMemory( false ) ) +"</div>", false, false );
            // A3C BB8 DAC E10 13BE 13EC 1400 1432 23F0 238C 23BE 2422 242C 2436 2454 2486 24A4 24AE 24B8 24EA 251C 254E 2557 2560 ?2776?
         AddBackground( 15, 59, 770, 526, 0x2454);
         AddBlackAlpha( 18, 62, 763, 520);
         AddLabelCropped(  20, 60, 220, 20, 2100, "Name" );
         AddLabelCropped( 222, 60, 209, 20, 2100, "Guild" );
         AddLabelCropped( 453, 60, 60, 20, 2100, "SumStats" );
         AddLabelCropped( 515, 60, 60, 20, 2100, "Skills" );
         AddLabelCropped( 577, 60, 60, 20, 2100, "Karma" );
         AddLabelCropped( 639, 60, 60, 20, 2100, "Fame" );
         AddLabelCropped( 701, 60, 60, 20, 2100, "Kills" );

         if ( m_List == null )
            m_List = new ArrayList( NetState.Instances );

         if ( listPage > 0 )
            AddButton( 744, 62, 0x15E3, 0x15E7, 1, GumpButtonType.Reply, 0 );
         else
            AddImage( 744, 62, 0x25EA );

         if ( (listPage + 1) * 25 < m_List.Count )
            AddButton( 761, 62, 0x15E1, 0x15E5, 2, GumpButtonType.Reply, 0 );
         else
            AddImage( 761, 62, 0x25E6 );

         if ( m_List.Count == 0 )
            AddLabel( 20, 80, 0x25, "There are no clients to display." );
         
         int k = 0;
         
         if ( listPage > 0 )
         {
            for ( int z = 0; z < ( listPage - 1 ); ++z )
            {
               k = k + Convert.ToInt32(m_CountList[z]);
            }
         }
         
         for ( int i = 0, j = 0, index=((listPage*25)+k) ; i < 25 && index >= 0 && index < m_List.Count && j >= 0; ++i, ++j, ++index )
         {
            NetState ns = m_List[index] as NetState;

            if ( ns == null )
               continue;

            Mobile m = ns.Mobile;

            int offset = 80 + (i * 20);

            if ( m == null )
            {
               if ( Admin.AdminNetwork.IsAuth( ns ) )
                  AddLabelCropped( 20, offset, 220, 20, 2100, "(remote admin)" );
               else
                  AddLabelCropped( 20, offset, 220, 20, 2100, "(logging in)" );
            }
            else
            {
               if ((from.AccessLevel == AccessLevel.Player && (( m.AccessLevel == AccessLevel.Counselor && m.Hidden ) || m.AccessLevel >= AccessLevel.GameMaster )) || (from.AccessLevel >= AccessLevel.Player && m.AccessLevel > from.AccessLevel))
               {
                  --i;
               }
               else
               {
                  AddLabelCropped(  20, offset, 220, 20, 2100, m.Name );

                  Guild g = m.Guild as Guild;

                  if ( g != null )
                  {
                     string title = m.GuildTitle;
                     string Ftitle;
                     Ftitle = "[";
                     if ( title != null )
                        title = title.Trim();
                     else
                        title = "";
                     if ( title.Length > 0 )
                     {
                        Ftitle = Ftitle + title + ",";
                     }
                     Ftitle = Ftitle + g.Abbreviation + "]";
                  
                     AddLabelCropped( 222, offset, 209, 20, 2100, Ftitle );
                  }
    }
                    }
               }
          }
     }
}
A Gump is fine, but a Gump with Information is better. Thanks go to BondD.

A.V.
averisimilitude is offline  
Old 01-28-2005, 10:44 AM   #13 (permalink)
 
Join Date: Jun 2003
Posts: 190
Default

Ja...I was gonna say...this script had already been released by someone and works just fine in 1.0. (with the info, that is)
Dark Rage is offline  
Old 02-01-2005, 01:13 AM   #14 (permalink)
 
Join Date: Nov 2004
Location: Lorain, ohio
Age: 24
Posts: 53
Send a message via ICQ to Xzao Send a message via AIM to Xzao Send a message via MSN to Xzao
Default

might wanna toss
Code:
                         }
                    }
               }
          }
     }
}
into the end of the code if you want it to work
Xzao is offline  
Old 04-11-2005, 08:43 PM   #15 (permalink)
An Army of One
 
soldierfortune's Avatar
 
Join Date: Jul 2004
Location: Florida
Age: 41
Posts: 203
Send a message via ICQ to soldierfortune
Default

hmm i added this (all the code even) and it compiles and works in game but all i get is character names but none of their info is there. IE, fame karma and such. Any Ideas?

Thanks,
Dan
__________________
Proud to serve in the US Army
1988-1992
101st Airborne Desert Shield/Desert Storm
soldierfortune is offline  
Old 04-14-2005, 10:36 PM   #16 (permalink)
 
mikefrisk's Avatar
 
Join Date: Dec 2004
Location: test
Age: 20
Posts: 54
Send a message via ICQ to mikefrisk Send a message via AIM to mikefrisk
Default

I have the same problem
mikefrisk is offline  
Old 04-16-2005, 02:08 AM   #17 (permalink)
Forum Expert
 
Iomega0318's Avatar
 
Join Date: Feb 2005
Location: Dirt City,TX
Age: 21
Posts: 608
Send a message via ICQ to Iomega0318 Send a message via AIM to Iomega0318 Send a message via MSN to Iomega0318 Send a message via Yahoo to Iomega0318
Default

If yall dont mind me asking.. how do ppl add the status page into their webserver.. i have a site but i dunno how to put it in can anyone help me??
Iomega0318 is offline  
Old 04-16-2005, 10:15 AM   #18 (permalink)
An Army of One
 
soldierfortune's Avatar
 
Join Date: Jul 2004
Location: Florida
Age: 41
Posts: 203
Send a message via ICQ to soldierfortune
Default

Quote:
Originally Posted by Iomega0318
If yall dont mind me asking.. how do ppl add the status page into their webserver.. i have a site but i dunno how to put it in can anyone help me??
Search these boards there is like 5 threads on this subject. Use "status" in your search and you will get the answeres you need.

Dan
__________________
Proud to serve in the US Army
1988-1992
101st Airborne Desert Shield/Desert Storm
soldierfortune is offline  
Old 04-16-2005, 11:19 PM   #19 (permalink)
Forum Expert
 
Iomega0318's Avatar
 
Join Date: Feb 2005
Location: Dirt City,TX
Age: 21
Posts: 608
Send a message via ICQ to Iomega0318 Send a message via AIM to Iomega0318 Send a message via MSN to Iomega0318 Send a message via Yahoo to Iomega0318
Default

ahh ok ty.. i tried some searches but got nothing perhaps that will do it tyvm :P
Iomega0318 is offline  
Old 04-16-2005, 11:20 PM   #20 (permalink)
Forum Expert
 
Iomega0318's Avatar
 
Join Date: Feb 2005
Location: Dirt City,TX
Age: 21
Posts: 608
Send a message via ICQ to Iomega0318 Send a message via AIM to Iomega0318 Send a message via MSN to Iomega0318 Send a message via Yahoo to Iomega0318
Default

Quote:
Proud to serve in the US Army
1988-1992
101st Airborne Desert Shield/Desert Storm
and btw dude you rock... :P
Iomega0318 is offline  
Old 04-16-2005, 11:38 PM   #21 (permalink)
An Army of One
 
soldierfortune's Avatar
 
Join Date: Jul 2004
Location: Florida
Age: 41
Posts: 203
Send a message via ICQ to soldierfortune
Default

Thanks Bro,
Dan
__________________
Proud to serve in the US Army
1988-1992
101st Airborne Desert Shield/Desert Storm
soldierfortune is offline  
 

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