Go Back   RunUO - Ultima Online Emulation > RunUO > Custom Script Releases

Custom Script Releases This forum is where you can release your custom scripts for other users to use.

Please note: By releasing your scripts here you are submitting them to the public and as such agree to make them public domain. The RunUO Team has made its software GPL for you to use and enjoy you should do the same for anything based off of RunUO.

Reply
 
Thread Tools Display Modes
Old 06-18-2007, 10:59 AM   #1 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,425
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default [RunUO 2.0]Cleanup Command w/options Gump

Cleanup

What is it?

Allows players to [cleanup their kills and the area.

NOTE: I was over 90% done with this before I even saw there was one very similar using XML, so any similarities between this system and that one are purely coincidental. This one does not require XML or any other addon.

CREDITS: The original inspiration for this was the old 1.0 [cleanup script that first combined [grab and [red in one script. (Author: phoo)

Installation:

- Drop in customs.
- If you have conflicting commands or items, make adjustments as necessary.

How to use:

- "[cleanup" will clean the area near the player of items and corpses to which they have looting rights.
- "[cleanop" brings up the Options Gump, allowing players to select which items they wish to collect or not.
- Admins using [cleanop will also have buttons allowing them to turn on or off the selected types globally.

Recommended:

- Provide a means for players to get a MoneyBag and a CleanupBag.

Changes/Updates:

6/18/2007 1:28PM - Fixed null reference exception causing Server crash.
11/10/2007 8:11AM - Added check to verify corpses have Owners.
Attached Files
File Type: zip Cleanup.zip (6.5 KB, 112 views)
File Type: zip Cleanup11-10-2007.zip (6.5 KB, 194 views)

Last edited by Lokai; 11-10-2007 at 09:12 AM. Reason: Hopefully fixed null reference issue
Lokai is offline   Reply With Quote
Old 06-18-2007, 01:00 PM   #2 (permalink)
Forum Novice
 
Join Date: Jan 2006
Posts: 204
Default

Not sure what is wrong... i use clean up and says admin needs to start the clean up system, I try to use [cleanop and it crashes.... any reason ?
Now I tried to add a cleanup stone manualy and it crashed and wont start server.... says fatal error...?????
Quote:
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Cleanup.CleanupStone..ctor()
at Server.Cleanup.Cleanup.GenCleanupStone(Mobile from)
at Server.Cleanup.Cleanup.cleanop_OnCommand(CommandEv entArgs e)
at Server.Commands.CommandSystem.Handle(Mobile from, String text, MessageType type)
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)
at Server.Engines.PartySystem.Chat3Guild.UnicodeSpeec hChat3(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
__________________
You Can Make a Good Living working for someone else, you can make a fortune working for yourself.
Hotshot is offline   Reply With Quote
Old 06-18-2007, 01:03 PM   #3 (permalink)
Forum Novice
 
Join Date: Jan 2006
Posts: 204
Default

server wont even start up !!!!!
Quote:
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Cleanup.CleanupStone.Serialize(GenericWrite r writer)
at Server.StandardSaveStrategy.SaveItems(SaveMetrics metrics)
at Server.DualSaveStrategy.<>c__DisplayClass1.<Save>b __0()
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
__________________
You Can Make a Good Living working for someone else, you can make a fortune working for yourself.
Hotshot is offline   Reply With Quote
Old 06-18-2007, 01:19 PM   #4 (permalink)
Forum Novice
 
Join Date: Jan 2006
Posts: 204
Default

Again downloading something from ya bro... and it crashed, do i need certian programs for it to compile with ? i had delete all the runuo 2.0 stuff and the folders and extract what i back up and will have to redo what i had done...again.
__________________
You Can Make a Good Living working for someone else, you can make a fortune working for yourself.
Hotshot is offline   Reply With Quote
Old 06-18-2007, 01:58 PM   #5 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,425
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

OW. Sorry about that. Let me see what happened. I did not get this on mine at all. I will pull up the scripts and see where I made my mistake.
Lokai is offline   Reply With Quote
Old 06-18-2007, 02:20 PM   #6 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,425
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

I apologize, I have removed the file from the first post until I can correct the error. I get the same error. Please kindly bear with me as I fix the problem.
Lokai is offline   Reply With Quote
Old 06-18-2007, 02:31 PM   #7 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,425
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

OK. All should be fixed now. I was able to create a new stone both using [cleanop with my Owner, and by using [add to add it manually. New zip is up on the first post.
Lokai is offline   Reply With Quote
Old 06-18-2007, 02:36 PM   #8 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,425
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Quote:
Originally Posted by Hotshot View Post
server wont even start up !!!!!

Hotshot, I need to add one more thing for your error. Just a sec.
Lokai is offline   Reply With Quote
Old 06-18-2007, 02:51 PM   #9 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,425
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

@Hotshot

Or, anyone else who installed the script, and still is not able to get your Server to load. Replace it with the one just uploaded, and it should be fine.
Lokai is offline   Reply With Quote
Old 06-18-2007, 04:00 PM   #10 (permalink)
Forum Novice
 
Join Date: Jan 2006
Posts: 204
Default

got it to work thanks... wish i knew the server would have started up after this fix, i deleted everything and redoing all that i have done in the past 2-3 days... :-( and as ya know... trying to make a shard excellent/kool and awesome... alot of work can be done in -2-3 days.
__________________
You Can Make a Good Living working for someone else, you can make a fortune working for yourself.
Hotshot is offline   Reply With Quote
Old 06-19-2007, 04:33 AM   #11 (permalink)
Newbie
 
Join Date: Jul 2005
Posts: 73
Default Works Great But.......

compiled with no errors.... loot goes into loot bag but gold goes into backpack. not in moneybag... Is that suppose to do that if so what is point in moneybag??????
purplemouse91 is online now   Reply With Quote
Old 06-19-2007, 07:11 AM   #12 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,425
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Quote:
Originally Posted by purplemouse91 View Post
compiled with no errors.... loot goes into loot bag but gold goes into backpack. not in moneybag... Is that suppose to do that if so what is point in moneybag??????
Actually, gold is currently splitting in to 2 places. During the 'Loot' phase, the gold is going in to the Moneybag, and during the 'Redeem' phase, gold is going in to the backpack.

If you want, change the Redeem method as follows to have Redeemed Corpses pay you in the Moneybag also (this is partial code, only one line was added, and one line changed, as below in RED.):

Code:
            eable.Free();
            Container moneyBag = GetMoneyBag(from);  //This one added
 
            foreach (Corpse c in Other)
            {
                if (c.Owner is PlayerMobile)
                {
                    from.SendMessage("This contains no redeemable soul.");
                    return;
                }
   
                else if (c.CanLoot(from))
                {
                    from.SendMessage("You Redeem the being's soul.");
                    //This one changed
                    moneyBag.DropItem(new Gold(Utility.RandomMinMax(1, 99),
                        Utility.RandomMinMax(100, 100 + (int)Math.Abs(c.Owner.Fame) + (int)Math.Abs(c.Owner.Karma))));
                    c.Delete();
                }
Lokai is offline   Reply With Quote
Old 06-20-2007, 03:53 AM   #13 (permalink)
Newbie
 
Join Date: Jul 2005
Posts: 73
Default

Quote:
Originally Posted by Lokai View Post
Actually, gold is currently splitting in to 2 places. During the 'Loot' phase, the gold is going in to the Moneybag, and during the 'Redeem' phase, gold is going in to the backpack.

If you want, change the Redeem method as follows to have Redeemed Corpses pay you in the Moneybag also (this is partial code, only one line was added, and one line changed, as below in RED.):

Code:
            eable.Free();
            Container moneyBag = GetMoneyBag(from);  //This one added
 
            foreach (Corpse c in Other)
            {
                if (c.Owner is PlayerMobile)
                {
                    from.SendMessage("This contains no redeemable soul.");
                    return;
                }
   
                else if (c.CanLoot(from))
                {
                    from.SendMessage("You Redeem the being's soul.");
                    //This one changed
                    moneyBag.DropItem(new Gold(Utility.RandomMinMax(1, 99),
                        Utility.RandomMinMax(100, 100 + (int)Math.Abs(c.Owner.Fame) + (int)Math.Abs(c.Owner.Karma))));
                    c.Delete();
                }
Thank you ... I was wrong about gold not going into bag it does and i see the split now .... Think I will just leave it as intended... Btw I love this script. good job..
purplemouse91 is online now   Reply With Quote
Old 10-11-2007, 03:36 PM   #14 (permalink)
Newbie
 
JimJava's Avatar
 
Join Date: Feb 2006
Posts: 13
Default This is very nice

but how do we add the MoneyBag and CleanupBag to the new players backpack? In CharacterCreation.cs Iv tryed this:

Quote:
private static void AddBackpack( Mobile m )
{
Container pack = m.Backpack;

if ( pack == null )
{
pack = new Backpack();
pack.Movable = false;

m.AddItem( pack );
}

PackItem( new RedBook( "a book", m.Name, 20, true ) );
PackItem( new Gold( 1000 ) ); // Starting gold can be customized here
PackItem( new Dagger() );
PackItem( new Candle() );
PackItem( new TokenBox( m ) );
PackItem( new TrashBackpack() );
PackItem( new PetBondingDeed() );
PackItem( new FreeBeetle() );
PackItem( new MoneyBag() );
PackItem( new CleanupBag() );
PackItem( new BrickHouseDeed() );
}
Only to get this error:

Quote:
RunUO - [www.runuo.com] Version 2.0, Build 2357.32527
Core: Running on .NET Framework Version 2.0.50727
Scripts: Compiling C# scripts...failed (1 errors, 8 warnings)
Warnings:
+ Customs/Evolution Dragon/EvolutionDragon.cs:
CS0108: Line 76: 'Server.Mobiles.EvolutionDragon.AllowMating' hides inherite
d member 'Server.Mobiles.BaseCreature.AllowMating'. Use the new keyword if hidin
g was intended.
+ Customs/Knives Chat 3.0 Beta 9/General/MultiConnection.cs:
CS0168: Line 65: The variable 'e' is declared but never used
CS0168: Line 134: The variable 'e' is declared but never used
CS0168: Line 165: The variable 'e' is declared but never used
CS0168: Line 184: The variable 'e' is declared but never used
CS0168: Line 201: The variable 'e' is declared but never used
CS0168: Line 252: The variable 'e' is declared but never used
+ Customs/Knives Chat 3.0 Beta 9/Gumps/Error Reporting/Errors.cs:
CS0618: Line 91: 'System.Web.Mail.MailMessage' is obsolete: 'The recommended
alternative is System.Net.Mail.MailMessage. Search Microsoft.com
kid=14202'
CS0618: Line 91: 'System.Web.Mail.MailMessage' is obsolete: 'The recommended
alternative is System.Net.Mail.MailMessage. Search Microsoft.com
kid=14202'
CS0618: Line 102: 'System.Web.Mail.SmtpMail' is obsolete: 'The recommended a
lternative is System.Net.Mail.SmtpClient. Search Microsoft.com
=14202'
+ Customs/Lucid's Systems/Advanced Archery/Items/Quivers/BaseQuiver.cs:
CS0162: Line 73: Unreachable code detected
CS0162: Line 114: Unreachable code detected
CS0162: Line 155: Unreachable code detected
CS0162: Line 222: Unreachable code detected
CS0162: Line 240: Unreachable code detected
+ Customs/Lucid's Systems/Advanced Archery/Targeting/StringerTarget.cs:
CS0168: Line 133: The variable 'skillCode' is declared but never used
+ Customs/FullToolbar.cs:
CS0219: Line 146: The variable 'StrPos' is assigned but its value is never u
sed
+ Multis/BaseHouse.cs:
CS0429: Line 58: Unreachable expression code detected
CS0162: Line 61: Unreachable code detected
+ Multis/HouseSign.cs:
CS0429: Line 103: Unreachable expression code detected
CS0162: Line 105: Unreachable code detected
Errors:
+ Misc/CharacterCreation.cs:
CS0246: Line 38: The type or namespace name 'MoneyBag' could not be found (a
re you missing a using directive or an assembly reference?)
CS1502: Line 38: The best overloaded method match for 'Server.Misc.Character
Creation.PackItem(Server.Item)' has some invalid arguments
CS1503: Line 38: Argument '1': cannot convert from 'MoneyBag' to 'Server.Ite
m'
CS0246: Line 39: The type or namespace name 'CleanupBag' could not be found(are you missing a using directive or an assembly reference?)
CS1502: Line 39: The best overloaded method match for 'Server.Misc.Character
Creation.PackItem(Server.Item)' has some invalid arguments
CS1503: Line 39: Argument '1': cannot convert from 'CleanupBag' to 'Server.Item'
CS0246: Line 40: The type or namespace name 'BrickHouseDeed' could not be fo
und (are you missing a using directive or an assembly reference?)
CS1502: Line 40: The best overloaded method match for 'Server.Misc.Character
Creation.PackItem(Server.Item)' has some invalid arguments
CS1503: Line 40: Argument '1': cannot convert from 'BrickHouseDeed' to 'Serv
er.Item'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
or is thier another way of getting the wanted outcome ?

P.S. Yeah that BrickhouseDeed Isnt working eather. Just thought id try adding that too.
JimJava is offline   Reply With Quote
Old 10-11-2007, 04:31 PM   #15 (permalink)
Forum Novice
 
Join Date: Dec 2006
Location: Southern Utah
Age: 29
Posts: 914
Send a message via Yahoo to greywolf79
Default

Will this work on RC1 of 2.0 as is? If not, is there a way to convert it? If so how?

GreyWolf.
greywolf79 is online now   Reply With Quote
Old 10-12-2007, 08:10 AM   #16 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,425
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Quote:
Originally Posted by greywolf79 View Post
Will this work on RC1 of 2.0 as is? If not, is there a way to convert it? If so how?

GreyWolf.
Not 100% positive, but I believe this to be RC1 ~AND~ SVN compliant.
Lokai is offline   Reply With Quote
Old 10-12-2007, 11:13 AM   #17 (permalink)
Forum Expert
 
Join Date: Nov 2004
Posts: 1,656
Send a message via ICQ to Murzin Send a message via AIM to Murzin Send a message via MSN to Murzin
Default

people are still making changes and mods to the original intent of my fixxed [grab script eh?

but this does seem like a good modification with actual options which is good.

one thing though, i remember someone made a system that let you attach variables to a playermobile without changing the actual playermobile.

if i were you i would look into a method of storing the variables on the playermobile without modifying the playermobile itself.
Murzin is offline   Reply With Quote
Old 10-12-2007, 12:26 PM   #18 (permalink)
Forum Novice
 
Join Date: Dec 2006
Location: Southern Utah
Age: 29
Posts: 914
Send a message via Yahoo to greywolf79
Default

Thanks... I will look into using it, try it out and what not. Also, I do not know if this is right all the way, but when I read about the ACC package it was supposed to help with that sort of edits... Make it so changes could be done to the playermobile and not have to be done directly to the file... But I might be wrong. I am still pretty new, I just talk alot (hence the high # of posts). If I was write, then I hope using the ACC package might help with improving the files as Murzin was thinking/hoping...

GreyWolf.
greywolf79 is online now   Reply With Quote
Old 10-13-2007, 01:35 AM   #19 (permalink)
Forum Expert
 
Join Date: Nov 2004
Posts: 1,656
Send a message via ICQ to Murzin Send a message via AIM to Murzin Send a message via MSN to Murzin
Default

while this is a good set, one thing i distinctly notice missing is something that may not have even occurred to you.

as a function of what they are, public shards like these typically have a high turn-over. one thing you could do to really make this robust is add a feature for the admin to set an " expire " option like the saved variables for each player will be automatically cleared after a certian period of time.

that would cut down on overhead and be a step in the right direction. i would reccomend a default of like after 1 month of not logging in, it would automatically clear their options so you wouldnt be endlessly saving those variables for someone who may never even come back.
Murzin is offline   Reply With Quote
Old 11-10-2007, 12:52 AM   #20 (permalink)
Forum Novice
 
LadyRhia's Avatar
 
Join Date: Jan 2006
Location: New Port Richey Fl.
Age: 51
Posts: 174
Send a message via Yahoo to LadyRhia
Default 2 crashes and my computer restarted itself too

hey 1st let me say We Love this script I hope you can tell me why it's crashing I'm attatching the 2 reports I have there were 3 crashes but the 1st one restarted my computer thus didn't generate a report. ok it wouldn't let me attatch them as .txt files. so I rared them together please tell me what happened this worked for a week til today.
Attached Files
File Type: rar Cleanup.rar (1.5 KB, 15 views)
__________________
Lady Rhia AKA Misty Dain Owner Unicorn Heaven Where Unicorns Are a Specialty!
LadyRhia is offline   Reply With Quote
Old 11-10-2007, 09:12 AM   #21 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,425
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Quote:
Originally Posted by LadyRhia View Post
hey 1st let me say We Love this script I hope you can tell me why it's crashing I'm attatching the 2 reports I have there were 3 crashes but the 1st one restarted my computer thus didn't generate a report. ok it wouldn't let me attatch them as .txt files. so I rared them together please tell me what happened this worked for a week til today.
OK. Looking at my Cleanup script, in the 'Redeem' method, I see nothing that could cause a null reference error. However, something I have not tested it this: if there is an item in range that is a corpse with no owner, then there would be no Fame or Karma associated with it. I guess it's possible there are corpses out there with no owner, but I had not thought of that before.

Here is the fix. I changed this line:

Code:
else if (c.CanLoot(from))
to this:

Code:
 
else if (c.Owner != null && c.CanLoot(from))
That should do it. I have uploaded the changed script.
Lokai is offline   Reply With Quote
Old 07-28-2008, 03:50 PM   #22 (permalink)
Forum Novice
 
Join Date: May 2005
Age: 36
Posts: 220
Default