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-30-2006, 04:58 PM   #1 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Age: 28
Posts: 4,952
Default Sorious' [ViewStabled Command...

Ok, very simple, every wanna check what a player has in his stable. Well I have, yet never knew the command for it( or if one existed ). Anyway I recently saw a post on one of the forums of someone wondering how to do this, so i through this together. I am not going to support this with further update. It is what it is and will not be improved on cause frankly I don't have time. I wil l however try to fix crash related bugs if they occur.

Update 1.01
-Fixed a crash bug.

Installation:
The installation is very simple.

1. Unzip the package, and extract it to somewhere in your Scripts folder.
2. Reboot server.
3. Type [viewstabled and click on a target.

Known Bugs:
None at the moment.

Things to know:
There are a few flaws that will happen from using this command. It does not pay attention to the follower count on the specified player( this was done on purpose but you need to know it ). If you open the gump and click on one of the pets it will be sent to the player that owns it, thus upping the count of followers they have so be aware of this.

Hope you like it.
Attached Files
File Type: zip StableHelper.zip (1.3 KB, 145 views)
__________________
Jeff Boulanger
ConnectUO - Creator/Core Developer

Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO

Last edited by Jeff; 02-02-2006 at 11:58 AM.
Jeff is offline  
Old 01-30-2006, 05:24 PM   #2 (permalink)
Forum Master
 
Joeku's Avatar
 
Join Date: Feb 2005
Location: ShatteredSosaria.com
Posts: 9,261
Default

Code:
        public override void OnResponse( NetState sender, RelayInfo info )
        {
            int index = info.ButtonID - 1;

            BaseCreature pet = ( BaseCreature )m_List[index];

            pet.SetControlMaster( m_Targeted );

            if( pet.Summoned )
                pet.SummonMaster = m_Targeted;

            pet.ControlTarget = m_Targeted;
            pet.ControlOrder = OrderType.Follow;

            pet.MoveToWorld( m_Targeted.Location, m_Targeted.Map );

            pet.IsStabled = false;
            m_Targeted.Stabled.Remove( pet );
        }
Add:
Code:
if( m_Targeted.Followers + pet.ControlSlots > m_Targeted.FollowersMax )
{
   m_Targeted.SendMessage("You cannot un-stable this pet, because you don't have enough control slots to do so!");
   return;
}
Joeku is offline  
Old 01-30-2006, 05:32 PM   #3 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Age: 28
Posts: 4,952
Default

Quote:
Originally Posted by Joeku
Code:
        public override void OnResponse( NetState sender, RelayInfo info )
        {
            int index = info.ButtonID - 1;

            BaseCreature pet = ( BaseCreature )m_List[index];

            pet.SetControlMaster( m_Targeted );

            if( pet.Summoned )
                pet.SummonMaster = m_Targeted;

            pet.ControlTarget = m_Targeted;
            pet.ControlOrder = OrderType.Follow;

            pet.MoveToWorld( m_Targeted.Location, m_Targeted.Map );

            pet.IsStabled = false;
            m_Targeted.Stabled.Remove( pet );
        }
Add:
Code:
if( m_Targeted.Followers + pet.ControlSlots > m_Targeted.FollowersMax )
{
   m_Targeted.SendMessage("You cannot un-stable this pet, because you don't have enough control slots to do so!");
   return;
}
Then you gotta have the player put there pet away to check out what they have, i left it out on purpose. I was just warning everyone, But if anyone wants it they can add it themselves thanks for the reply tho.
__________________
Jeff Boulanger
ConnectUO - Creator/Core Developer

Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline  
Old 01-30-2006, 05:35 PM   #4 (permalink)
Forum Master
 
Joeku's Avatar
 
Join Date: Feb 2005
Location: ShatteredSosaria.com
Posts: 9,261
Default

I meant on the OnResponse method (the button that they click to unstable the pet, not to view their pets.) Unless I am incorrect in my assumption of what this script is...
Joeku is offline  
Old 01-30-2006, 05:43 PM   #5 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Age: 28
Posts: 4,952
Default

Quote:
Originally Posted by Joeku
I meant on the OnResponse method (the button that they click to unstable the pet, not to view their pets.) Unless I am incorrect in my assumption of what this script is...
ya, it simple brings up the same gump you get when you say [claimlist, thus clicking on a pet would call it out of the stable. This is what I intended it to do, I could extend on the idea a bit but like I said in my post this was a simple thing I did cause I needed it, and this is all I needed. If anyone wants to take on this script and mod it to something more useful well, be my guest...
__________________
Jeff Boulanger
ConnectUO - Creator/Core Developer

Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline  
Old 02-01-2006, 07:32 AM   #6 (permalink)
Forum Novice
 
Lord Neo's Avatar
 
Join Date: Feb 2005
Location: Upstate NY Ithaca
Age: 39
Posts: 146
Default

First Time I tried using this it crashed the server. It crashes right when you right click the gump to close it.
Heres the crash report in debug mode.
Code:
Server Crash Report
===================

Operating System: Microsoft Windows NT 5.1.2600.0
.NET Framework: 1.1.4322.2032
Time: 2/1/2006 6:29:54 AM
Mobiles: 20921
Items: 371802
Clients:
- Count: 2


Exception:
System.ArgumentOutOfRangeException: Index was out of range.  Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Collections.ArrayList.get_Item(Int32 index)
   at Server.StableHelper.StabledGump.OnResponse(NetState sender, RelayInfo info) in c:\Program Files\RUNUO\RunUO Software Team\RunUO 1.0\Scripts\Custom\ALL New Stuff\StableHelper\StableHelper.cs:line 98
   at Server.Network.PacketHandlers.DisplayGumpResponse(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 02-01-2006, 01:09 PM   #7 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Age: 28
Posts: 4,952
Default

Quote:
Originally Posted by Lord Neo
First Time I tried using this it crashed the server. It crashes right when you right click the gump to close it.
Heres the crash report in debug mode.
Code:
Server Crash Report
===================

Operating System: Microsoft Windows NT 5.1.2600.0
.NET Framework: 1.1.4322.2032
Time: 2/1/2006 6:29:54 AM
Mobiles: 20921
Items: 371802
Clients:
- Count: 2


Exception:
System.ArgumentOutOfRangeException: Index was out of range.  Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Collections.ArrayList.get_Item(Int32 index)
   at Server.StableHelper.StabledGump.OnResponse(NetState sender, RelayInfo info) in c:\Program Files\RUNUO\RunUO Software Team\RunUO 1.0\Scripts\Custom\ALL New Stuff\StableHelper\StableHelper.cs:line 98
   at Server.Network.PacketHandlers.DisplayGumpResponse(NetState state, PacketReader pvSrc)
   at Server.Network.MessagePump.HandleReceive(NetState ns)
   at Server.Network.MessagePump.Slice()
   at Server.Core.Main(String[] args)
Hmm odd, weird it did that, cause I didnt code it, its the code straight out of the distro, of well, ill look at it today if possible.
__________________
Jeff Boulanger
ConnectUO - Creator/Core Developer

Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline  
Old 02-01-2006, 02:01 PM   #8 (permalink)
Forum Newbie
 
Join Date: Dec 2005
Age: 45
Posts: 63
Default another good one

thanks for another good script but i do have a question for you sorious i dont know what time you have but im working on a quest and have hit a snag and was woundering if you could help me with it contact me by email and ill explain it all if you have the time thanks
goddessoflight is offline  
Old 02-01-2006, 02:13 PM   #9 (permalink)
Forum Expert
 
arul's Avatar
 
Join Date: Jan 2005
Location: Hic sunt leones ...
Age: 21
Posts: 1,300
Send a message via MSN to arul
Default

Quote:
Originally Posted by Sorious
Hmm odd, weird it did that, cause I didnt code it, its the code straight out of the distro, of well, ill look at it today if possible.
When you close the gump (right click) it sends to the server gumpresponse with button id 0, which in this case results in negative index and exception is thrown.
__________________
The blood that flows through me is not my own. The blood is from the past, not my own.
The blood that leads my life is not my own. The blood is my strength, I'm not alone.
arul is offline  
Old 02-01-2006, 02:28 PM   #10 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Age: 28
Posts: 4,952
Default

Quote:
Originally Posted by Seanchen.net
Simple fix:

Code:
int index = 0;
if ( info.ButtonID > 0 )
{
index = info.ButtonID - 1;
}
It might complain about doing that, if it does move the code inside the if block. There is only one possible error, its going to complain about setting a value within a if block, if you get any other error besides that then its your fault. I give permission to use this block of code to anyone who wants to support it, but do not contact me for help, because I will not answer your questions about it.
Thanks Seanchen.net
__________________
Jeff Boulanger
ConnectUO - Creator/Core Developer

Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline  
Old 02-02-2006, 12:14 AM   #11 (permalink)
Forum Novice
 
Lord Neo's Avatar
 
Join Date: Feb 2005
Location: Upstate NY Ithaca
Age: 39
Posts: 146
Default

might be a good idea to update the script in the first post.
__________________
http://www.hardradio.com
Ever been in the mens bathroom and looked over to see if the guy next you has a bigger post count than you?
Lord Neo is offline  
Old 02-02-2006, 11:58 AM   #12 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Age: 28
Posts: 4,952
Default

Quote:
Originally Posted by Lord Neo
might be a good idea to update the script in the first post.
Updated
__________________
Jeff Boulanger
ConnectUO - Creator/Core Developer

Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline  
Old 02-03-2006, 01:12 PM   #13 (permalink)
Forum Novice
 
Lord Neo's Avatar
 
Join Date: Feb 2005
Location: Upstate NY Ithaca
Age: 39
Posts: 146
Default Still isnt correct

Quote:
Originally Posted by Sorious
Updated
The script does not crash the server anymore, but when you go to close the GUMP by right clicking it, it will pull ONE of the players PETS from the stable!
__________________
http://www.hardradio.com
Ever been in the mens bathroom and looked over to see if the guy next you has a bigger post count than you?
Lord Neo is offline  
Old 02-03-2006, 01:29 PM   #14 (permalink)
Forum Expert
 
arul's Avatar
 
Join Date: Jan 2005
Location: Hic sunt leones ...
Age: 21
Posts: 1,300
Send a message via MSN to arul
Default

The way it is fixed is quite complicated in vain.
Simply do
Code:
if( info.ButtonID == 0 )
     return;

int index = info.ButtonID - 1;

// rest of the code...
__________________
The blood that flows through me is not my own. The blood is from the past, not my own.
The blood that leads my life is not my own. The blood is my strength, I'm not alone.
arul 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 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5