EQ Database

Scripts and support for your favorite MUD client.
Grunelda
Sojourner
Posts: 47
Joined: Sat Sep 07, 2002 5:01 am

EQ Database

Postby Grunelda » Wed Feb 02, 2005 2:45 am

Looking for a Zmud Database script.

I've got several now, but cant get it to read out the stuff from the DBase correctly. Looking for a Soj?Toril working example to build from.

Thanks
Gizep
Sojourner
Posts: 150
Joined: Thu Mar 10, 2005 4:34 pm
Location: Menzoberranzan
Contact:

Postby Gizep » Fri Dec 02, 2005 2:25 pm

Been wanting to redo the one i posted everyone had problems with it....
So I'll do that here :)

First off, I am using Zmud 7.21, I have not tested with other versions and these rules are very specific so follow them exactly.

First of all, you need to import this section:

#CLASS {Identify} {disable}
#TRIGGER {Name '&itemname'} {}
#TRIGGER {Keyword '&keywords', Item type: &type} {}
#TRIGGER {Item will give you following abilities: &aflags} {}
#TRIGGER {Item is: &iflags} {}
#TRIGGER {Weight: &weight, Value: &value} {}
#TRIGGER {Affects :&taffects} {@affects = @affects @taffects}
#TRIGGER {Special Effects : &effects} {}
#TRIGGER {Combat Critical : &ccrit} {}
#TRIGGER {Damage Dice is '&damage'} {}
#TRIGGER {Called Effects : &ceffects} {}
#TRIGGER {AC-apply is* &ac} {}
#TRIGGER {$} {#T- Identify;createitem}
#TRIGGER {Item can be worn on: &location} {}
#CLASS 0


Make sure this is disabled before continuing, cuz it puts a blank record in..check the box that disables it on mud start up.


These are set up for my database format which i will detail below.

These drive the whole thing:
Need to always be enabled:

#TRIGGER {You feel informed:} {@itemname = "";@keywords = "";@type = "";@aflags = "";@iflags = "";@weight = "";@value = "";@ac = 0;@location = "";@affects = "";@taffects = "";@affects = "";@effects = "";@ccrit = "";@damage = "";@ceffects = "";#T+ Identify}


#ALIAS createitem {#T- Identify;@tempitem = "";@Found = 0;#DBFIRST;#WHILE (!%null( %rec)) {#IF (&Name = @itemname) {@Found = 1;#say Found It};#DBNEXT};#SAY FOUND: @Found;#IF (@Found == 0) {recordadd} {#say Already In Database Nice Waste My Scrolls!}}

#ALIAS recordadd {#Var ObjectDB "";#Addkey ObjectDB name @itemname;#Addkey ObjectDB keywords @keywords;#Addkey ObjectDB type @type;#Addkey ObjectDB aflags @aflags;#Addkey ObjectDB ac @ac;#Addkey ObjectDB location @location;#Addkey ObjectDB iflags @iflags;#Addkey ObjectDB weight @weight;#Addkey ObjectDB value @value;#Addkey ObjectDB affects @affects;#Addkey ObjectDB taffects @taffects;#Addkey ObjectDB affects @affects;#Addkey ObjectDB effects @effects;#Addkey ObjectDB ccrit @ccrit;#Addkey ObjectDB damage @damage;#Addkey ObjectDB ceffects @ceffects;#Addkey ObjectDB date %time;#NEW Name @ObjectDB;#SHOW "Item added to database.";#T- Identify}

#ALIAS lookup {#DBFIRST;@tempitem = "";@Found = 0;#WHILE (!%null( %rec)) {#IF (&Name = %1) {@tempitem = &name;#IF (&aflags != %null) {@tempitem = @tempitem &aflags};#IF (&iflags != %null) {@tempitem = @tempitem &iflags};#IF (&location != %null) {@tempitem = @tempitem &location};#IF (&ac != 0) {@tempitem = @tempitem AC:&ac};#IF (&damage != %null) {@tempitem = @tempitem &damage};#IF (&affects != %null) {@tempitem = @tempitem &affects};#IF (&effects != %null) {@tempitem = @tempitem &effects};#IF (&ceffects != %null) {@tempitem = @tempitem &ceffects};#IF (&ccrit != %null) {@tempitem = @tempitem &ccrit};#IF (&date != %null) {@tempitem = @tempitem Last ID:&date};@Found = 1};#DBNEXT};#IF (@Found = 1) {#say @tempitem} {#SAY Item Not In Database}}



Ok, to explain how it all works, very important.

Whenever the database is open, and you recite a scroll of identify, it will look the item up in the db and yell at ya if its already there. If it's not there, it will add it..


Rule #1
You must have your database open at all times when you want stuff to be recorded or look up anyway... I just minimize it and put it at top by the toolbars.

Rule #2
When you lookup items you must use this syntax: Which will display the information on the screen, and also Fill a variable that you can call from groupsay or tell etc:

Code: Select all

lookup "a shining set of steel greaves"


Rule #3
You need to define your own database named eqdb with the following fields:

name - Text
keywords - Text
location - Text
aflags - Text
iflags - Text
weight - Number
value - Number
ac - Number
affects - Text
effects - Text
ceffects - Text
ccrit - Text
date - Text
damage - Text
type - Text

Rule #4:
You must have these settings checked/unchecked in prefrences under Script Parser
Show Triggers - Unchecked
Echo Commands - Unchecked
Echo Messages - Unchecked
Echo Scripts - Unchecked
Capture Commands - Checked
Gag Password - Checked
Trigger on Commands - Checked
Wildcards in {} Triggers - Checked
Allow [] for Eval - Checked
Allow <> for Expand - Unchecked
a = b syntax - Checked
Strip "" Quotes - Checked
Expand Vars - Checked if you wanna be able to gsay the stats...
Null var refrences - Checked
Allow ; Comments - Checked
Allow // comments - Checked
Allow VBScript - Checked
Allow Jscript - Checked

After you have it working you can play with those prefs but if it breaks, it was cuz of one of those settings.

Follow these directions and you should be up and running with minimal problems and can build on it to make it even better if you want....
Last edited by Gizep on Fri Dec 02, 2005 2:54 pm, edited 3 times in total.
As long as we live in this world we are bound to encounter problems. If, at such times, we lose hope and become discouraged, we diminish our ability to face difficulties. If, on the other hand, we remember that it is not just ourselves but everyone who has to undergo suffering, this more realistic perspective will increase our determination and capacity to overcome troubles.
-- The Dali Lama
Gizep
Sojourner
Posts: 150
Joined: Thu Mar 10, 2005 4:34 pm
Location: Menzoberranzan
Contact:

Postby Gizep » Fri Dec 02, 2005 2:27 pm

say oh yeah when you got that all done after looking up an item you can just:

say @tempitem
As long as we live in this world we are bound to encounter problems. If, at such times, we lose hope and become discouraged, we diminish our ability to face difficulties. If, on the other hand, we remember that it is not just ourselves but everyone who has to undergo suffering, this more realistic perspective will increase our determination and capacity to overcome troubles.
-- The Dali Lama
Futaz
Sojourner
Posts: 16
Joined: Wed Feb 12, 2003 6:17 pm

Postby Futaz » Sun Dec 04, 2005 11:11 pm

Here is a tip.

I implemented the eq database. I had been doing a straight cut and paste of my Identifies to a text file. If you had done this also you can do the following to get those enties into the database.

1. check the Echo scripts in the Prefernce - Script Parser
2. check the Echo commands.
3. copy one entry over to a blank text file.
4. use Action/execute script and select the single entry text file.

This will put that item into the database. At this time I haven't been able to get it to work with a multiple entry text file, like my master list. But this should save you some plats from not having to re-identify those items.

Found a way on the mulitiple entry:
Select the Action/Send file to mud option with a delay of 1 between the lines.

Or you could do what Gizep did and write a perl script to convert the file to a csv format. Then input the infomation directly to the database.A
Last edited by Futaz on Mon Dec 05, 2005 1:02 am, edited 2 times in total.
Futaz Ul'Saruk de'Dubluth Kyor
Gizep
Sojourner
Posts: 150
Joined: Thu Mar 10, 2005 4:34 pm
Location: Menzoberranzan
Contact:

Postby Gizep » Sun Dec 04, 2005 11:33 pm

I wrote a perl script to put them into csv format from the mud once, was alot of crap like

if ($line =~ /Name \'/)
{
($junk, $name,$garbage) = split $line "\'";
$csvline .= "$garbage,";
}
I did this for every type of line, and wrote the record on "You feel informed"

not sure on exact syntax cuz i been awake all night.
As long as we live in this world we are bound to encounter problems. If, at such times, we lose hope and become discouraged, we diminish our ability to face difficulties. If, on the other hand, we remember that it is not just ourselves but everyone who has to undergo suffering, this more realistic perspective will increase our determination and capacity to overcome troubles.
-- The Dali Lama

Return to “MUD Client Help”

Who is online

Users browsing this forum: No registered users and 7 guests