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 publish them under the GPL licensing terms. 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-27-2007, 09:58 PM   #1 (permalink)
CEO
Forum Novice
 
CEO's Avatar
 
Join Date: Jun 2004
Age: 49
Posts: 808
Default CEO's playerwealth.cs

/*
Script Name: playerwealth.cs
Author: CEO
Version: 1.0
Purpose: Registers command to create an html report of all player's wealth on shard.

Description: Creates playerwealth.html in your shard's root folder. This file contains a
breakdown of all player's wealth on your shard by account. The report 'walks' player's
backpacks and bank boxes as well as items in houses they own recording all gold and checks
for the account.

A nice color-coded report is then produced allowing you to see who the tycoons are on your shard!

Installation: Install your custom scripts folder and restart.

Usage: ]playerwealth
*/

To view a sample report, click here:

http://www.easyuo.com/downloads/sampleplayerwealth.html

(Names and numbers have been changed to protect the rich!)

Edit: Oh, RunUO 2.0 (the SVN distribution) only and you must have Owner privs to run.
Attached Files
File Type: cs playerwealth.cs (7.3 KB, 282 views)
File Type: cs playerwealthRC1.cs (7.4 KB, 69 views)
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list.
Please don't add me to your friends list, I have enough friends. Thx

Last edited by CEO; 06-15-2008 at 01:05 PM.
CEO is offline   Reply With Quote
Old 06-27-2007, 11:14 PM   #2 (permalink)
Forum Expert
 
Pyro-Tech's Avatar
 
Join Date: Oct 2003
Location: Carbondale, IL
Age: 25
Posts: 1,805
Send a message via MSN to Pyro-Tech
Default

Nice script...and helpfull too!
__________________

Pyro-Tech is offline   Reply With Quote
Old 06-27-2007, 11:36 PM   #3 (permalink)
Forum Expert
 
Pyro-Tech's Avatar
 
Join Date: Oct 2003
Location: Carbondale, IL
Age: 25
Posts: 1,805
Send a message via MSN to Pyro-Tech
Default

got an error for you...

Code:
 + Custom/New Scripts/Systems/Commands/playerwealth.cs:
    CS0029: Line 102: Cannot implicitly convert type 'System.Collections.ArrayLi
st' to 'System.Collections.Generic.List<Server.Multis.BaseHouse>'
    CS1502: Line 110: The best overloaded method match for 'System.Collections.G
eneric.List<Server.Multis.BaseHouse>.AddRange(System.Collections.Generic.IEnumer
able<Server.Multis.BaseHouse>)' has some invalid arguments
    CS1503: Line 110: Argument '1': cannot convert from 'System.Collections.Arra
yList' to 'System.Collections.Generic.IEnumerable<Server.Multis.BaseHouse>'
__________________

Pyro-Tech is offline   Reply With Quote
Old 06-28-2007, 12:03 AM   #4 (permalink)
CEO
Forum Novice
 
CEO's Avatar
 
Join Date: Jun 2004
Age: 49
Posts: 808
Default

Quote:
Originally Posted by Pyro-Tech View Post
got an error for you...

Code:
 + Custom/New Scripts/Systems/Commands/playerwealth.cs:
    CS0029: Line 102: Cannot implicitly convert type 'System.Collections.ArrayLi
st' to 'System.Collections.Generic.List<Server.Multis.BaseHouse>'
    CS1502: Line 110: The best overloaded method match for 'System.Collections.G
eneric.List<Server.Multis.BaseHouse>.AddRange(System.Collections.Generic.IEnumer
able<Server.Multis.BaseHouse>)' has some invalid arguments
    CS1503: Line 110: Argument '1': cannot convert from 'System.Collections.Arra
yList' to 'System.Collections.Generic.IEnumerable<Server.Multis.BaseHouse>'
Um? 2.0? It compiles clean for me and works fine.... Don't see anything wrong with that. The line is defining a List<> type. I think there's something different with your system.

Hmm, Though that line shouldn't be there.. It looks like older testing stuff. I'll remove some things a repost...
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list.
Please don't add me to your friends list, I have enough friends. Thx

Last edited by CEO; 06-28-2007 at 12:10 AM.
CEO is offline   Reply With Quote
Old 06-28-2007, 12:12 AM   #5 (permalink)
CEO
Forum Novice
 
CEO's Avatar
 
Join Date: Jun 2004
Age: 49
Posts: 808
Default

Yeah, some stuff I missed cleaning up. That shouldn't affect how it runs though.. You can remove a couple of lines that do nothing.. Or regrab it in a sec, I'll replace the current one.

Edit: Ok removed 2 lines and replaced. Though not sure if that's going to get rid of your issue... Compiled clean and tested fine for me...
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list.
Please don't add me to your friends list, I have enough friends. Thx

Last edited by CEO; 06-28-2007 at 12:17 AM.
CEO is offline   Reply With Quote
Old 06-28-2007, 01:15 AM   #6 (permalink)
Newbie
 
Join Date: Jun 2007
Age: 24
Posts: 40
Default

Great job!

Thanks for sharing!
Admin_Shaka is offline   Reply With Quote
Old 06-28-2007, 01:56 AM   #7 (permalink)
Forum Expert
 
Pyro-Tech's Avatar
 
Join Date: Oct 2003
Location: Carbondale, IL
Age: 25
Posts: 1,805
Send a message via MSN to Pyro-Tech
Default

thanks ill try it out here in a bit....

mine is 2.0...not an svn or anything so....
__________________

Pyro-Tech is offline   Reply With Quote
Old 06-28-2007, 04:58 AM   #8 (permalink)
Forum Expert
 
Liacs's Avatar
 
Join Date: Mar 2004
Location: Belgium / Germany
Age: 32
Posts: 1,038
Send a message via MSN to Liacs
Default

Oh, this looks good. I am going to try it!

Thanks for sharing!
__________________
;)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   Reply With Quote
Old 06-28-2007, 10:13 AM   #9 (permalink)
Forum Novice
 
nadious's Avatar
 
Join Date: Jan 2003
Location: (Near) Atlanta, GA
Posts: 527
Default

Is this html file generated automatically? Or do you have to run the command everytime you want the file to update it's information?
nadious is offline   Reply With Quote
Old 06-28-2007, 10:44 AM   #10 (permalink)
Forum Novice
 
Join Date: Jul 2006
Age: 30
Posts: 746
Default

I get same error are Pyro. 2.0 RC1 server

Code:
Errors:
 + Customs/playerwealth.cs:
    CS1502: Line 107: The best overloaded method match for 'System.Collections.G
eneric.List<Server.Multis.BaseHouse>.AddRange(System.Collections.Generic.IEnumer
able<Server.Multis.BaseHouse>)' has some invalid arguments
    CS1503: Line 107: Argument '1': cannot convert from 'System.Collections.Arra
yList' to 'System.Collections.Generic.IEnumerable<Server.Multis.BaseHouse>'
__________________
Friends Come and go but Enemies accumulate
oiii88 is offline   Reply With Quote
Old 06-28-2007, 11:23 AM   #11 (permalink)
CEO
Forum Novice
 
CEO's Avatar
 
Join Date: Jun 2004
Age: 49
Posts: 808
Default

Strange. That's what we're running, least I thought so. Can you look at your basehouse.cs in multis. Search for allHouses, around line 86. What is that code like. This is what I have in my basehouse.cs at those lines:


Code:
			List<BaseHouse> allHouses = new List<BaseHouse>( 2 );

				for ( int i = 0; i < acct.Length; ++i )
				{
					Mobile mob = acct[i];

					if ( mob != null )
						allHouses.AddRange( GetHouses( mob ) );
				}
And that's what I used as an example to create a list of player houses.

Quote:
Originally Posted by nadious View Post
Is this html file generated automatically? Or do you have to run the command everytime you want the file to update it's information?
You have to run the command, or you can add it into your reports.cs file to fire off automatically as well with other reports.
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list.
Please don't add me to your friends list, I have enough friends. Thx

Last edited by CEO; 06-28-2007 at 11:27 AM.
CEO is offline   Reply With Quote
Old 06-28-2007, 11:40 AM   #12 (permalink)
Forum Novice
 
Join Date: Jul 2006
Age: 30
Posts: 746
Default

Line 86 Basehouse.cs

Code:
				ArrayList allHouses = new ArrayList( 2 );

				for ( int i = 0; i < acct.Length; ++i )
				{
					Mobile mob = acct[i];

					if ( mob != null )
						allHouses.AddRange( GetHouses( mob ) );
__________________
Friends Come and go but Enemies accumulate
oiii88 is offline   Reply With Quote
Old 06-28-2007, 02:21 PM   #13 (permalink)
CEO
Forum Novice
 
CEO's Avatar
 
Join Date: Jun 2004
Age: 49
Posts: 808
Default

You guys are not running 2.0 or at least RC1 or the latest or something..

http://svn.runuo.com/repos/runuo/dev.../BaseHouse.cs:

Code:
				List<BaseHouse> allHouses = new List<BaseHouse>();

				for ( int i = 0; i < acct.Length; ++i )
				{
					Mobile mob = acct[i];

					if ( mob != null )
						allHouses.AddRange( GetHouses( mob ) );
				}
Arraylist stuff was changed for List<> usage and is a difference of 1.0 and 2.0... I also synced a fresh version of the SVN at 187 and it is using the List<> format. Don't know what you guys are running, but it's not the 2.0 I'm using...
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list.
Please don't add me to your friends list, I have enough friends. Thx
CEO is offline   Reply With Quote
Old 06-28-2007, 02:25 PM   #14 (permalink)
Forum Novice
 
Join Date: Jul 2006
Age: 30
Posts: 746
Default

When I boot my server it says I am running
Code:
 RunUO - [www.runuo.com] Version 2.0, Build 2357.32527
I thought it was RC1 because I downloaded it straight from the site and didnt have to compile it like I believe you have to do the SVNs maybe I am wrong.

Edit: I just downloaded the latest RC1 rar extracted it and checked the version and it says
" Version 2.0.2357.32527 " Which is the same as my running shard.
__________________
Friends Come and go but Enemies accumulate

Last edited by oiii88; 06-28-2007 at 02:29 PM.
oiii88 is offline   Reply With Quote
Old 06-28-2007, 03:01 PM   #15 (permalink)
CEO
Forum Novice
 
CEO's Avatar
 
Join Date: Jun 2004
Age: 49
Posts: 808
Default

No idea, whatever you're running it's not the same. I've grabbed 187 clean, compiled it with playerwealth.cs the only added extra and it worked fine.

Quote:
RunUO - [www.runuo.com] Version 2.0, Build 2735.17689
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...done (cached)
Scripts: Compiling VB.NET scripts...no files found.
Scripts: Verifying...done (2107 items, 500 mobiles)
Regions: Loading...done
World: Loading...done (0 items, 0 mobiles) (0.01 seconds)
This server has no accounts.
Do you want to create the owner account now? (y/n)
Username: admin
Password: admin
Account created.
Restricting client version to 6.0.1.5. Action to be taken: Annoy
Reports: Stats: Loading...done
Reports: Staff: Loading...done
Address: 127.0.0.1:2593
Address: 192.168.2.5:2593
Client: 127.0.0.1: Connected. [1 Online]
Login: 127.0.0.1: Valid credentials for 'admin'
Login: 127.0.0.1: Account 'admin' at character list
Login: 127.0.0.1: New character being created (account=admin)
- Character: ceo (serial=0x00000001)
- Started: New Haven (3503, 2574, 14) in Trammel
Core: Using dual save strategy
World: Saving...done in 0.35 seconds.
[playerwealth generated:
Quote:
Player Wealth report generated on 6/28/2007 11:01:39 AM
Total Accounts: 1
Total Characters: 1
Total Houses: 0
Total Gold/Checks: 1,000

Player Wealth
Account Gold Checks Total % of shard
1 accounts < 10000 not reported. 1,000 100.00%
You guys need to figure out what your issue is and why you're not running current code. I've spent far too much time on this. It compiles clean, runs fine and works!
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list.
Please don't add me to your friends list, I have enough friends. Thx

Last edited by CEO; 06-28-2007 at 03:03 PM.
CEO is offline   Reply With Quote
Old 06-28-2007, 03:31 PM   #16 (permalink)
Forum Novice
 
Join Date: Jul 2006
Age: 30
Posts: 746
Default

Quote:
Originally Posted by CEO View Post
You guys need to figure out what your issue is and why you're not running current code. I've spent far too much time on this. It compiles clean, runs fine and works!
Well if you go to runuo.com and click download and download the package they have posted as runuo2.0rc1 it is the exact same version as I am running. So I dont see how I can not be running current code. Anyways thanks just to bad i cant run it....
__________________
Friends Come and go but Enemies accumulate
oiii88 is offline   Reply With Quote
Old 06-28-2007, 04:34 PM   #17 (permalink)
CEO
Forum Novice
 
CEO's Avatar
 
Join Date: Jun 2004
Age: 49
Posts: 808
Default

Quote:
Originally Posted by oiii88 View Post
Well if you go to runuo.com and click download and download the package they have posted as runuo2.0rc1 it is the exact same version as I am running. So I dont see how I can not be running current code. Anyways thanks just to bad i cant run it....
Well you can modify your version to use arraylist. It'll be pretty much the same as the example in your version of basehouse.cs at 86.

Ah, the version in the download section <> SVN 187.

Quote:
Date Added: 06-16-2006
A year old! I guess RC1 <> SVN 187?

I checked it and it is old ArrayList code. Use the SVN version. As far as I know SVN is the way to get the latest/greatest, site admins should make it clear it's not the same as SVN and maybe provide an SVN link on those pages. Supporting multiple versions gets tough, I'll no longer write for 1.0, but if we gotta check difs between the download version vs. SVN that'll be a pita. Switch to SVN and you'll be good to go.
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list.
Please don't add me to your friends list, I have enough friends. Thx

Last edited by CEO; 06-28-2007 at 04:45 PM.
CEO is offline   Reply With Quote
Old 06-28-2007, 05:57 PM   #18 (permalink)
Forum Novice
 
Join Date: Jul 2006
Age: 30
Posts: 746
Default

Ok thanks for looking into it. I am editing the version I downloaded to use Arraylist as you mentioned. So far Ive gotten 5 of the compiling errors fixed guess if I get anymore errors on this compile Ill post in script support.
__________________
Friends Come and go but Enemies accumulate
oiii88 is offline   Reply With Quote
Old 06-29-2007, 11:35 PM   #19 (permalink)
Forum Expert
 
Pyro-Tech's Avatar
 
Join Date: Oct 2003
Location: Carbondale, IL
Age: 25
Posts: 1,805
Send a message via MSN to Pyro-Tech
Default

also i don't know for sure, but if you have any basehouse edit's...does that make a difference?

and how hard is it to update to SVN's?
__________________

Pyro-Tech is offline   Reply With Quote
Old 06-30-2007, 12:01 AM   #20 (permalink)
CEO
Forum Novice
 
CEO's Avatar
 
Join Date: Jun 2004
Age: 49
Posts: 808
Default

Quote:
Originally Posted by Pyro-Tech View Post
also i don't know for sure, but if you have any basehouse edit's...does that make a difference?

and how hard is it to update to SVN's?
Porbably not a difference, just looks for gold and checks...

You need to get an SVN client, I recommend Tortoise.
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list.
Please don't add me to your friends list, I have enough friends. Thx
CEO is offline   Reply With Quote
Old 07-04-2007, 11:50 PM   #21 (permalink)
Forum Novice
 
Join Date: Oct 2005
Posts: 196
Default

So you have to have RunUO2.0 SVN to run this? You can't use RunUO 2.0 [RC1]?
Drayvock is offline   Reply With Quote
Old 07-05-2007, 02:59 PM   #22 (permalink)
CEO
Forum Novice
 
CEO's Avatar
 
Join Date: Jun 2004
Age: 49
Posts: 808
Default

Quote:
Originally Posted by Drayvock View Post
So you have to have RunUO2.0 SVN to run this? You can't use RunUO 2.0 [RC1]?
For those that are scripting 'challenged' I've added a .zip file that contains the modifications to work on the RC1 version from runuo.com/downloads here are the two lines that need to be changed.

Line 103:

Code:
List<BaseHouse> allHouses = new List<BaseHouse>(2);
to
Code:
ArrayList allHouses = new ArrayList(2);

and

Line 113:

Code:
BaseHouse house = allHouses[i];
to
Code:
BaseHouse house = (BaseHouse) allHouses[i];
And that was it! That version compiles clean for RC1!
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list.
Please don't add me to your friends list, I have enough friends. Thx

Last edited by CEO; 07-06-2007 at 01:10 PM.
CEO is offline   Reply With Quote
Old 07-11-2007, 08:53 PM   #23 (permalink)
Forum Novice
 
Join Date: Aug 2003
Age: 33
Posts: 447
Send a message via MSN to aventae
Default

Quote:
Originally Posted by CEO View Post
/*
Script Name: playerwealth.cs
Author: CEO
Version: 1.0
Purpose: Registers command to create an html report of all player's wealth on shard.

Description: Creates playerwealth.html in your shard's root folder. This file contains a
breakdown of all player's wealth on your shard by account. The report 'walks' player's
backpacks and bank boxes as well as items in houses they own recording all gold and checks
for the account.

A nice color-coded report is then produced allowing you to see who the tycoons are on your shard!

Installation: Install your custom scripts folder and restart.

Usage: ]playerwealth
*/

To view a sample report, click here:

http://www.easyuo.com/downloads/sampleplayerwealth.html

(Names and numbers have been changed to protect the rich!)

Edit: Oh, RunUO 2.0 (the SVN distribution) only and you must have Owner privs to run.
Awesome Job Ceo .. script went in very smoothly.. no errors =)
Most scripts i usually have to tweek a bit to get them working lol
aventae is offline   Reply With Quote
Old 07-12-2007, 05:52 AM   #24 (permalink)
Forum Expert
 
Liacs's Avatar
 
Join Date: Mar 2004
Location: Belgium / Germany
Age: 32
Posts: 1,038
Send a message via MSN to Liacs
Default

Great!
I got rid of the 10.000gp barrier, because I am just too curious!
Well done!
This is something I can definately learn from!

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   Reply With Quote
Old 07-12-2007, 10:10 AM   #25 (permalink)
Forum Novice
 
nadious's Avatar
 
Join Date: Jan 2003
Location: (Near) Atlanta, GA
Posts: 527
Default

Forgive me for being pretty ignorant in C#... but does anyone know what code I would add (or alter) in the report.cs file to make this happen automatically when the reports are ran?

I tried to do it myself... but I have NO idea what to do in there.

EDIT: Also... is there way to not make it poll anything higher than access level of a player or seer? I have an admin that has 10 million (and is taking up the #1 spot), and we cant' figure out where that total is coming from. He has no gold in the bank or on his pack.. no checks....

I love for it to just report that player's totals and not anything that the admins / GMs have.

EDIT, EDIT - Nevermind, we just deleted the GM account. It was a problem somewhere in the account. He had no gold on him, yet it was reporting 10 million. Once we nuked the account, it started working right.

Last edited by nadious; 07-12-2007 at 12:34 PM.
nadious is offline   Reply With Quote
Reply

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 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5