Go Back   RunUO - Ultima Online Emulation > RunUO > RunUO Post Archive

RunUO Post Archive The Archvie

Reply
 
Thread Tools Display Modes
Old 06-09-2004, 05:38 AM   #1 (permalink)
 
Join Date: May 2004
Age: 29
Posts: 148
Default html generation from mob *.cs scripts

WARNING !
Starting from version 0.6 you need to download ijl15.dll (Intel jpg library). I cant include the dll here because of file size limit, but you can download it here:

http://www.dll-files.com/dllindex/dll-files.shtml?ijl15

Put this dll in the same folder with mulext.exe

Summary:
This perl script parse *.cs scripts with mob classes, extract properties of the creature and produce html pages (with pictures if you want - you need uo client installed for this feature).

One sample of this script work you can see at the
http://alterra.twigsjoint.com/
Click "Inhabitants" then click "Critters"

History:
0.7
+ Hues support (from *.cs or from body.cfg) !
* Body.cfg updated

0.6
* Output images now produced in jpg format
* Fixed template parser function (Thanks to twig !)
* Small additions to config reader

0.56
* Again fixed some bug with mulext call from the script
* Added AOS monsters picture extraction support
* Fixed small bug in mulext

0.55
* Fixed bug with the embedded spaces in the path parameters to mulext
(Thanks to zardoz !)
* Fixed error with name caching of already extracted images
* Now csmob2html correctly (i hope extract several pics if several mobs class
defined in source .cs script

0.5
+ Picture extraction !
* Now only *.cs files are parsed

0.3
* Now the script correctly extract several mobs from one *.cs source file
* Several small fixes
+ Now you can set base classes, so the csmob2html produce pages only for them.
baseclasses variable in configuration file

0.2
+ All output pages now can be edited via templates located in ./tpl folder
* Fixed small bugs

0.1
+ First version

Installation:
Installation notes is in the readme.txt of the archive.
Attached Files
File Type: zip csmob2html.zip (54.4 KB, 325 views)
x-ray is offline   Reply With Quote
Old 06-09-2004, 06:56 PM   #2 (permalink)
Newbie
 
Join Date: Oct 2002
Location: Brazil
Age: 21
Posts: 74
Send a message via ICQ to Matador Doidao Send a message via MSN to Matador Doidao
Default

sounds great to use on a shard site
but i cant get it to work

can u send a link directly to the program i need?

thanks
__________________
=)
Matador Doidao is offline   Reply With Quote
Old 06-09-2004, 11:28 PM   #3 (permalink)
*flop*
 
Avangelon's Avatar
 
Join Date: Mar 2004
Location: US, TX
Age: 23
Posts: 56
Send a message via AIM to Avangelon Send a message via MSN to Avangelon Send a message via Yahoo to Avangelon
Smile

Great job! I really like how I can see my own shard monster stats, because my monster stats just may not be the same as uo.stratics.com Keep up this great work

Edit: 6/9/04 at 09:07 PM.
I just ran the script and dropped the css in the out directory and was looking at the index.html when I noticed that the last item on the list wasn't sorted properly hehe:
  • Wyvern
  • Zombie
  • vorpalbunny

Edit: 6/9/04 at 10:38 PM
I just uploaded it to my website in case you or anyone else wants to see the output. The above error is there too in case you want to see it ^_^.

Good job and Good luck,
Avangelon
__________________
boo!
AHHH
:confused:
Avangelon is offline   Reply With Quote
Old 06-10-2004, 03:08 AM   #4 (permalink)
 
Join Date: May 2004
Age: 29
Posts: 148
Default

Quote:
Originally Posted by Matador Doidao
sounds great to use on a shard site
but i cant get it to work

can u send a link directly to the program i need?

thanks
you can download win32 version of perl here:

http://www.activestate.com/Products/ActivePerl/

just click on "download now"

after installing configure script and run it by typing:

perl csmob2html.pl

Quote:
Originally Posted by Avangelon
I just ran the script and dropped the css in the out directory and was looking at the index.html when I noticed that the last item on the list wasn't sorted properly hehe:
This is not a "bug" but feature Looks like perl separate capital letters thats why 'Z' > 'v'.

I fix it if i have a free time
x-ray is offline   Reply With Quote
Old 06-10-2004, 03:11 AM   #5 (permalink)
*flop*
 
Avangelon's Avatar
 
Join Date: Mar 2004
Location: US, TX
Age: 23
Posts: 56
Send a message via AIM to Avangelon Send a message via MSN to Avangelon Send a message via Yahoo to Avangelon
Default

lol, I love those unexpected "features" don't you? :-P Don't worry about it, it's fine
__________________
boo!
AHHH
:confused:
Avangelon is offline   Reply With Quote
Old 06-10-2004, 08:24 AM   #6 (permalink)
 
Join Date: May 2004
Age: 29
Posts: 148
Default

Quote:
Originally Posted by Avangelon
lol, I love those unexpected "features" don't you? :-P Don't worry about it, it's fine
honestly speaking this behavior of perl is 100% correct
I just have not much expirence with perl coding
x-ray is offline   Reply With Quote
Old 06-10-2004, 09:55 AM   #7 (permalink)
 
hudel's Avatar
 
Join Date: Oct 2003
Location: Germany
Age: 38
Posts: 508
Send a message via ICQ to hudel
Default

hmm,... What does pearl do? I don't know this programm.
hudel is offline   Reply With Quote
Old 06-10-2004, 10:22 AM   #8 (permalink)
Forum Expert
 
stormwolff's Avatar
 
Join Date: Nov 2003
Location: The Internet
Age: 28
Posts: 3,510
Default

Quote:
Originally Posted by hudel
hmm,... What does pearl do? I don't know this programm.
A pearl is a mooth, lustrous, variously colored deposit, chiefly calcium carbonate, formed around a grain of sand or other foreign matter in the shells of certain mollusks and valued as a gem.

Perl is a general-purpose programming language invented in 1987 by Larry Wall. With over one million users worldwide, it has become the language of choice for World Wide Web development, text processing, Internet services, mail filtering, graphical programming, systems administration, and every other task requiring portable and easily-developed solutions.
stormwolff is offline   Reply With Quote
Old 06-10-2004, 10:34 AM   #9 (permalink)
Forum Expert
 
Captain The First's Avatar
 
Join Date: Jun 2003
Location: The Netherlands
Posts: 647
Default

Quote:
A pearl is a mooth, lustrous, variously colored deposit, chiefly calcium carbonate, formed around a grain of sand or other foreign matter in the shells of certain mollusks and valued as a gem.
*grins* you evil bastard :P

x-ray any chance you can bake this into a simple executable of some sort? I am too lazy to install another compiler, let alone wait for the 9mb download hehe

*edit*

and then I did anyway hehe

interesting script very useful
__________________
Captain The First
_________________

Undisclosed shard (status: building since Feb. 2003)
Captain The First is offline   Reply With Quote
Old 06-10-2004, 10:48 AM   #10 (permalink)
Forum Expert
 
stormwolff's Avatar
 
Join Date: Nov 2003
Location: The Internet
Age: 28
Posts: 3,510
Default

Quote:
Originally Posted by Captain The First
*grins* you evil bastard :P
Sorry, had to do it.
stormwolff is offline   Reply With Quote
Old 06-10-2004, 11:05 AM   #11 (permalink)
 
Join Date: Jan 2003
Age: 29
Posts: 34
Default

I know nothing about Perl language..

is there a way to add multiple root path for the monster list?

as my folders are organised like this:
Script/modified/Mobiles/Monsters
Script/Mobiles/Monsters

by the way, Tanks for this awesome script
wanna is offline   Reply With Quote
Old 06-10-2004, 12:18 PM   #12 (permalink)
Newbie
 
Join Date: Apr 2004
Location: Alabama
Age: 19
Posts: 91
Send a message via ICQ to weaselboy246 Send a message via AIM to weaselboy246
Default

Say, could you possibly do this with accounts as well?
weaselboy246 is online now   Reply With Quote
Old 06-10-2004, 12:46 PM   #13 (permalink)
Forum Expert
 
stormwolff's Avatar
 
Join Date: Nov 2003
Location: The Internet
Age: 28
Posts: 3,510
Default

Quote:
Originally Posted by wanna
I know nothing about Perl language..

is there a way to add multiple root path for the monster list?

as my folders are organised like this:
Script/modified/Mobiles/Monsters
Script/Mobiles/Monsters

by the way, Tanks for this awesome script
Not the answer your looking for, but you can copy and paste the .cs files into a new direcotry then set it to scan that directory.
stormwolff is offline   Reply With Quote
Old 06-10-2004, 05:19 PM   #14 (permalink)
 
Join Date: May 2004
Age: 29
Posts: 148
Default

Quote:
Originally Posted by Captain The First
*grins* you evil bastard :P
x-ray any chance you can bake this into a simple executable of some sort? I am too lazy to install another compiler, let alone wait for the 9mb download hehe
You can serch for something sounds like perl2exe utility (www.yahoo.com ).
As i know, this kind of proggy exist.

Quote:
Originally Posted by weaselboy246
Say, could you possibly do this with accounts as well?
Not "this" - parsing static monster class and the pleyer entity will be a different things. I can do but depends what do you mean If you want the script that parsing the accounts.xml, sure, but what for ? I think there are not so many useful information in accounts.xml.
Or you want to see all PlayerMobile Chars stats ? If so, its better way to modify your WebStatus.cs because of:

1. Player mobile statistics changed in a short period of time. You need to renew this quickly
2. I dont know worlds file structures, so its better way to this from the core of engine.
3. I dont think the player will be happy to know what all his stats publicly accessed

Quote:
Originally Posted by wanna
is there a way to add multiple root path for the monster list?
Sure. There are two ways. One way suggested by the Stormwolff. You can simply copy all your scripts to the one location. Or you can add second path (or more) to the @dir array delimited by commas:

@dir = ("c:/path1/","c:/path2/");

I change such kind of arguments for program in the next release
x-ray is offline   Reply With Quote
Old 06-10-2004, 07:25 PM   #15 (permalink)
Newbie
 
Join Date: Apr 2004
Location: Alabama
Age: 19
Posts: 91
Send a message via ICQ to weaselboy246 Send a message via AIM to weaselboy246
Default

I was acually wondering about online paperdolls like in MyUO.
weaselboy246 is online now   Reply With Quote
Old 06-10-2004, 07:30 PM   #16 (permalink)
*flop*
 
Avangelon's Avatar
 
Join Date: Mar 2004
Location: US, TX
Age: 23
Posts: 56
Send a message via AIM to Avangelon Send a message via MSN to Avangelon Send a message via Yahoo to Avangelon
Default

Quote:
Originally Posted by weaselboy246
I was acually wondering about online paperdolls like in MyUO.
Yeah, that'd be nice to not have to use aspx for MyRunUO to see character status.... I MUCH rather use the linux/apache(/php|perl) combo for anything dealing with webpage related things.
Avangelon is offline   Reply With Quote
Old 06-12-2004, 12:54 AM   #17 (permalink)
 
Join Date: May 2004
Age: 29
Posts: 148
Default

Quote:
Originally Posted by Avangelon
Yeah, that'd be nice to not have to use aspx for MyRunUO to see character status.... I MUCH rather use the linux/apache(/php|perl) combo for anything dealing with webpage related things.
Actually, i dont know what is MyRunUO, is it some kind of web statistics ?
if you drop me a link to it, i can think about this
x-ray is offline   Reply With Quote
Old 06-12-2004, 01:58 AM   #18 (permalink)
Forum Expert
 
stormwolff's Avatar
 
Join Date: Nov 2003
Location: The Internet
Age: 28
Posts: 3,510
Default

Myrunuo is the runuo version of myuo from osi/eagames. Currently the code for it is in the distro. It takes player skills and paperdoll info and outputs it into a mysql database.

Zulu made some asp pages available, but most people seem to think it would be nice to have a php or html version of these pages.

Stuffed or Starving?
stormwolff is offline   Reply With Quote
Old 06-13-2004, 03:56 AM   #19 (permalink)
 
Join Date: May 2004
Age: 29
Posts: 148
Default

Version 0.2 reposted. Now output pages editable via templates.
x-ray is offline   Reply With Quote
Old 06-13-2004, 03:59 AM   #20 (permalink)
*flop*
 
Avangelon's Avatar
 
Join Date: Mar 2004
Location: US, TX
Age: 23
Posts: 56
Send a message via AIM to Avangelon Send a message via MSN to Avangelon Send a message via Yahoo to Avangelon
Thumbs up

Quote:
Originally Posted by x-ray
Version 0.2 reposted. Now output pages editable via templates.
Awesome! Thanks ^_^
__________________
boo!
AHHH
:confused:
Avangelon is offline   Reply With Quote
Old 06-13-2004, 05:40 AM   #21 (permalink)
Forum Novice
 
Join Date: Dec 2003
Location: South-Africa
Age: 19
Posts: 165
Default Uhhhm

Im a noob with perl, and im not sure what caused this but, when I first ran the script I made some HTML files, but I wasnt happy, so I Did it again (Of course I delete the old files) but when I finished Generating the files it had double the fields, 2 str fields and so on .... Now when I tried it it has like 18 str fields
How do I fix this ?
I Have deleted all the files, including the script!
Any Idea's ?
DaLaw66 is offline   Reply With Quote
Old 06-13-2004, 10:37 PM   #22 (permalink)
God of Pandora
 
KillerBeeZ's Avatar
 
Join Date: Jun 2003
Location: Gainesville GA
Age: 31
Posts: 2,000
Default

This is indeed awsome, well done and thank you.

I do have a bug to report, tho it might not be a bug, it might be a fluke

I have a creature called a Rainbow Wyrm which is tamable at 115 skill and uses 15 pet slots, yet the page generated shows a - for the min taming skill (required slots show up fine).

So far this is the only creature I've seen like this.

Also, is there a way to make this so it looks for only Mobile scripts? like BaseCreature?

I have the default creatures in the normal places, and a huge number of customs in another area and quite a few mobiles that go with systems on the shard, and they are located in the respective system folder, thus I had to spend about an hour moving all the mobile scripts to use this, and even then I think I missed some. Granted, it would likely have taken 6 months to code this all by hand, but if this can detect only the BaseCreature scripts, I can just use the root RunUO folder and it would get them all, and it would still leave out the vendors with no need to move files ... if this is not possible, I still say this is a damn good system
__________________
The Den of KillerBeeZ...Kender's Komments, uncensored commentary from the Kender. Plus anything else the Kender might have in his pouches.
KillerBeeZ is offline   Reply With Quote
Old 06-14-2004, 01:01 AM   #23 (permalink)
 
Join Date: May 2004
Age: 29
Posts: 148
Default

Quote:
Originally Posted by DaLaw66
Im a noob with perl, and im not sure what caused this but, when I first ran the script I made some HTML files, but I wasnt happy, so I Did it again (Of course I delete the old files) but when I finished Generating the files it had double the fields, 2 str fields and so on .... Now when I tried it it has like 18 str fields
How do I fix this ?
I Have deleted all the files, including the script!
Any Idea's ?
Its strange, another run of the script OVERWRITE all previously created pages. The page itself created from the template pagebody.tpl Check it for the double fields.
Dont know what to say... Is anybody get the same problem ?

Quote:
Originally Posted by KillerBeeZ
I have a creature called a Rainbow Wyrm which is tamable at 115 skill and uses 15 pet slots, yet the page generated shows a - for the min taming skill (required slots show up fine).
The csmob2html itself is only pattern matching, not the lexical analyzer or interpreter I add only few patterns in it, so it produced about 80%-95% correct ouput pages depends on the syntax style and complexity of the sources. Just send me (or post) wyrm script here, and i will add/fix the pattern.

Quote:
Originally Posted by KillerBeeZ
Also, is there a way to make this so it looks for only Mobile scripts? like BaseCreature?
Sure. Nice idea. Thanks.
I will add option in config file, where you can specifing the parent classes and scripts will generate outpur pages only for the sources with this parents.
x-ray is offline   Reply With Quote
Old 06-14-2004, 07:12 AM   #24 (permalink)
God of Pandora
 
KillerBeeZ's Avatar
 
Join Date: Jun 2003
Location: Gainesville GA
Age: 31
Posts: 2,000
Default

I'm not sure whats different about the Rainbow wyrm that would cause this, but here is is

Code:
using System;
using Server;
using Server.Items;

namespace Server.Mobiles
{
	[CorpseName( "a Rainbow Wyrm corpse" )]
	public class RainbowWyrm : BaseCreature
	{
		[Constructable]
		public RainbowWyrm () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Body = 49;
			Name = "a Rainbow Wyrm";
			BaseSoundID = 362;
			Hue = 1381;

			SetStr( 921, 960 );
			SetDex( 121, 160 );
			SetInt( 386, 425 );

			SetHits( 1933, 2456 );

			SetDamage( 27, 65 );

			SetDamageType( ResistanceType.Physical, 50 );
			SetDamageType( ResistanceType.Cold, 50 );

			SetResistance( ResistanceType.Physical, 55, 70 );
			SetResistance( ResistanceType.Fire, 15, 35 );
			SetResistance( ResistanceType.Cold, 80, 99 );
			SetResistance( ResistanceType.Poison, 40, 50 );
			SetResistance( ResistanceType.Energy, 40, 50 );

			SetSkill( SkillName.EvalInt, 99.1, 100.0 );
			SetSkill( SkillName.Magery, 99.1, 100.0 );
			SetSkill( SkillName.MagicResist, 99.1, 100.0 );
			SetSkill( SkillName.Tactics, 97.6, 100.0 );
			SetSkill( SkillName.Wrestling, 90.1, 100.0 );

			Fame = 35000;
			Karma = -35000;

			VirtualArmor = 84;

			Tamable = true;
			ControlSlots = 15;
			MinTameSkill = 115;

			int gems = Utility.RandomMinMax( 3, 15 );

			for ( int i = 0; i < gems; ++i )
				PackGem();

			AddItem( new Gold( 1000, 5000 ) );
            		PackWeapon( 5, 9 );
            		PackMagicItems( 5, 9 );

		}

		public override int TreasureMapLevel{ get{ return 5; } }
		public override int Meat{ get{ return 25; } }
		public override int Hides{ get{ return 50; } }
		public override HideType HideType{ get{ return HideType.Barbed; } }
		public override int Scales{ get{ return 10; } }
		public override ScaleType ScaleType{ get{ return ScaleType.All; } }
		public override FoodType FavoriteFood{ get{ return FoodType.Meat | FoodType.Gold; } }

		public RainbowWyrm( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
}
__________________
The Den of KillerBeeZ...Kender's Komments, uncensored commentary from the Kender. Plus anything else the Kender might have in his pouches.
KillerBeeZ is offline   Reply With Quote
Old 06-14-2004, 04:42 PM   #25 (permalink)
 
Join Date: Mar 2003
Posts: 7
Default

а как насчёт картинок монстров ? есть предложения ?
GuRu_lv is offline   Reply With Quote
Reply