Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Eoin
Newbie


Joined: 03 Feb 2005
Posts: 3

PostPosted: Thu Feb 03, 2005 4:45 pm   

Generating a EQ database from identify and auction - MERC
 
Wondering if anyone would have suggestions for generating lines in an eq database based on the identify and auction information from the mud. I've seens a number of these here but all seem a little simplistic for the format that the mud I play presents things. Examples:

From an Identify:

Object: mystical dragon sword Type: weapon
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Flags: glow owner magic anti-evil oiled
Weight: 20 Value: 80000 Level: 172
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Owner - *****
Average Damage: 90
Condition: [perfect]
Proficiency: sword
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Affects saving-spell by -10
Affects saving-breath by -10
Affects saving-petri by -10
Affects saving-rod by -10
Affects saving-para by -10
Affects damroll by 35
Affects hitroll by 35
Affects hp by 200
Affects mana by 500
Affects ac by -40
Affects constitution by 2
Affects wisdom by 2
Affects intelligence by 2
Affects dexterity by 2
Affects strength by 2
Affects hitroll by 12
Affects damroll by 11

From auction:

-=--=--=--=--=--=--=--=--=- [Auctions] -=--=--=--=--=--=--=--=-
-=--=--=--=--=--=--=--=--=-
<AUCTION #2 > Seller ********* Item: a bone dagger with a fur hilt Level: 112
Bids: 0 Winner: No Winners yet OB: 100 MB: 100 HB: 0

----------- Item -- Stats -----------
Object: dagger bone Type: weapon
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Flags: glow invis anti-evil
Weight: 2 Value: 25003 Level: 112
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Average Damage: 54
Condition: [perfect]
Proficiency: standard
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Affects hitroll by 19
Affects damroll by 15
Affects hp by 200
Affects mana by -200
-=--=--=--=--=--=--=--=--=-
-=--=--=--=--=--=--=--=--=- [Total 1 ] -=--=--=--=--=--=--=--=-



Anyone got suggestions?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Fri Feb 04, 2005 12:57 am   
 
This may not be too much help to you. It is the trigger I use in my own scripts for capturinging and parsing ID information. I always setup my databases the same way, but I do have to tweak the initial trigger pattern for each mud. Beyond that I simply keep adding new parsing rules with each mud. Most of them are controlled in the 3rd state and handled through %replace or %subchar.

#TRIGGER "IDCapture" {^Object '*' is type *, usable by *.$} {CapturingID=%line} "" {case}
#COND {} {#IF (%begins(%line,"-")=0) {CapturingID=%concat(@CapturingID,%cr,%line)} {#STATE IDCapture 2;#SET IDCapture 2 1}} {looplines|param=99}
#COND {} {CapturingID=%subchar(@CapturingID,"()","");CapturingID=%replace(@CapturingID,%cr,"|");CapturingID=%replace(@CapturingID,"Object '","KeyWords=");CapturingID=%replace(@CapturingID,"' is type ","|Type=");CapturingID=%replace(@CapturingID,"Wear Location: ","Wear=");CapturingID=%replace(@CapturingID,"Weapon type","WType");CapturingID=%replace(@CapturingID," usable","Usable");CapturingID=%replace(@CapturingID,"Extra flags ","Flags=");CapturingID=%replace(@CapturingID," value","Value");CapturingID=%replace(@CapturingID," level","Level");CapturingID=%replace(@CapturingID," is ","=");CapturingID=%replace(@CapturingID," by ","=");CapturingID=%replace(@CapturingID,"Armor class","TStats=AC");CapturingID=%replace(@CapturingID," pierce, ","-");CapturingID=%replace(@CapturingID," bash, ","-");CapturingID=%replace(@CapturingID," slash, and ","-");CapturingID=%replace(@CapturingID," vs. magic","");CapturingID=%replace(@CapturingID,"Damage","TStats=Dam");CapturingID=%replace(@CapturingID," to ","-");CapturingID=%replace(@CapturingID," average ","A");CapturingID=%subchar(@CapturingID,".,","||");#DELITEM CapturingID {};Affects="";#FORALL @CapturingID {#IF ((%begins( "%i", "Affects"))|(%begins( "%i", "Causes"))) {CapturingID=%delitem("%i",@CapturingID);Affects=%additem(%trim(%remove(%word("%i",1),"%i")),@Affects)} {#IF (%begins("%i","Has")) {CapturingID=%delitem("%i",@CapturingID);Affects=%additem(%concat(%word("%i",3)," of L",%word("%i",7)," ",%copy("%i", %pos(%word("%i",8),"%i"),255)),@Affects)}}};#IF (@Affects) {CapturingID=%concat(@CapturingID,"|(Affects=",@Affects,")")};IDedItem="";#ADDKEY IDedItem {@CapturingID};Affects="";#WHILE (@Affects="") {#LOOPDB @ItemSource {#ADDITEM Affects {%key}};#FORALL @Affects {#IF (%pos(%lower(%word(%db(@IDedItem,"KeyWords"),1)),%lower("%i"))) {#DELITEM Affects {%i};Affects=%push("%i",@Affects)} {#IF (%pos(%lower(%word(%db(@IDedItem,"KeyWords"),2)),%lower("%i"))) {#DELITEM Affects {%i};Affects=%push("%i",@Affects)} {#IF (%pos(%lower(%word(%db(@IDedItem,"KeyWords"),3)),%lower("%i"))) {#DELITEM Affects {%i};Affects=%push("%i",@Affects)}}}};Affects=%pick("p:Item Name","o:1",%replace(@Affects,",",%char(254)))};#ADDKEY IDedItem Name {%replace(@Affects,%char(254),",")};#ADDKEY IDedItem {Wear} {%replace(@IDedItem.Wear," ",",")};#DBLOAD ID;#VIEW All;#DBFIRST;#IF (%numrec!="") {StoreID} {CapturingID=%concat( "ID", %secs);#VAR @CapturingID @IDedItem {_nodef} {ID};#ADDITEM IDsPending @CapturingID}} {manual}

This may give you some ideas how to handle your situation. You can also search around the forums for other portions of my database script. I was working it into new help page and looking for input on that.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net