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
Motient
Beginner


Joined: 14 Mar 2004
Posts: 18
Location: USA

PostPosted: Sun Oct 24, 2004 7:00 pm   

need help on an Identify Database
 
I am trying to build a db to store IDs that I want to ID and I have no clue of where to start I created the fields for it and this is what code I have extracted from the forums so far for what I want to do. Any ideas how to complete it?
Code:

#CLASS {ID}
#VAR dbvar {""}
#TRIGGER {$} {
  #if (%find( @item.name) = "") {#new "" @item}
  #t- identify
  }
#TRIGGER {Object '&{item.name}', Item type: &{item.type}} {}
#TRIGGER {Item is: &{item.prop}} {}
#TRIGGER {Affects: HITROLL By &{item.hitroll}} {}
#TRIGGER {Affects: DAMROLL By &{item.damroll}} {}
#TRIGGER {Affects: DEX By &{item.dex}} {}
#TRIGGER {Affects: INT By &{item.int}} {}
#TRIGGER {Affects: STR By &{item.str}} {}
#TRIGGER {Affects: CON By &{item.con}} {}
#TRIGGER {Affects: CHA By &{item.   cha}} {}
#TRIGGER {Affects: WIS By &{item.wis}} {}
#TRIGGER {Level Restriction: &{item.level}} {}
#TRIGGER {for an average per-round damage of &{item.avgdam}.} {}
#TRIGGER {Weapon Type: &{item.wtype}} {}
#TRIGGER {Weight: &{item.weight}, Value: &{item.value}} {}
#TRIGGER {Class Restrict: &{item.crest}} {}
#TRIGGER {Race Restrict: &{item.rrest}} {}
#CLASS 0


and below is what I want to extract from 3 different examples


Object 'a dragon's tail', Item type: Weapon
Item is: NECRO WARRIOR RANGER
Weight: 50, Value: 5000, Rent: 4730
Item Level: 40
Damage Ranges from 4 to 10 for an average damage of 7.0.
This weapon has an attack type of 'Thrash'.
Can affect you as :
Affects: DAMROLL By 2
Affects: SAVE_SPELL By 1
Affects: MAXMOVE By -100

Class Restrictions: Necromancer, Warrior, Ranger


Object 'a hematite amulet', Item type: Armor
Item is: INVIS THIEF WARRIOR PALADIN
Weight: 3, Value: 10000, Rent: 2950
Item Level: 60
AC-apply is 2
Can affect you as :
Affects: DAMROLL By 2
Affects: HITROLL By 1
Affects: SAVE_SPELL By -1

Class Restrictions: Thief, Warrior, Paladin



Object 'black latex pants', Item type: Clothing
Item is: EVIL MAGE NECRO THIEF WARRIOR VAMPIRE
Weight: 1, Value: 5000, Rent: 6500
Item Level: 40
AC-apply is 2
Can affect you as :
Affects: STR By 1
Affects: SAVE_PARA By 1

Alignment Restrictions: Evil
Class Restrictions: Mage, Necromancer, Thief, Warrior
Race Restrictions: Vampire
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Mon Oct 25, 2004 12:17 pm   
 
Take look at the finished scripts section. You may have a script written there that will work for you or you can modify one of those scripts.
If you go to the search and search on the word identify in the finished scripts you will get nine results. Below is the link to get to the search functionality.
http://forums.zuggsoft.com/phpbb/search.php

Good Luck! Smile
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Mon Oct 25, 2004 10:18 pm   
 
You might also want to take a look at my post from about 3 weeks ago titled "What do you think of this help page?" It still needs some polish before it goes into the help file but it is the basis for a section on advanced database scripting. It contains pretty much all the script you would need to get the database going. Of course there is always some tweaking.

If you have any comments on the structure of it as a help page please post in that topic. All other questions should go here.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Motient
Beginner


Joined: 14 Mar 2004
Posts: 18
Location: USA

PostPosted: Tue Oct 26, 2004 3:30 am   
 
darmir wrote:
Take look at the finished scripts section. You may have a script written there that will work for you or you can modify one of those scripts.
If you go to the search and search on the word identify in the finished scripts you will get nine results. Below is the link to get to the search functionality.
http://forums.zuggsoft.com/phpbb/search.php

Good Luck! Smile


Quote:
Vijilante
PostPosted: 25 Oct 2004 16:18 Post subject:
You might also want to take a look at my post from about 3 weeks ago titled "What do you think of this help page?" It still needs some polish before it goes into the help file but it is the basis for a section on advanced database scripting. It contains pretty much all the script you would need to get the database going. Of course there is always some tweaking.

If you have any comments on the structure of it as a help page please post in that topic. All other questions should go here.


If I listened to both of you actually I did that before posting.....I didn't understand how I would implement your code Vijilante since I was reading that for an hour every time I IDed something it wouldn't post to a db(which I did read it " Storing it in the DB (StoreID)". So I gave up and asked. I have a quasi understanding on doing DBs.

Damir well I wouldn't be asking if I didn't read since I and that is where I pulled that chunk of code from and as above I did read Vijilante's info by doing the search prior to posting my first post.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Tue Oct 26, 2004 11:48 am   
 
Ok this is one of those cases then where it is nice to know what is NOT working

so do this

item=""
Id an object
Id ouput
#ShOWDB @item

send us the output from all that and we might be able to help you, also from what I see here are some suggestions

#TRIGGER {$} {
#if (%find( @item.name) = "") {#new "" @item}
#t- identify
}

First the Database window HAS to be open (it can be hidden but must be open).
Since your examples show blank lines in your IDs this pattern should be change to match on a little bit of your prompt I have no idea what your prompt look likes so change accordingly. Your class name needs to match you #t- statement. Also you should make sure your DB is loaded (assuming a DB named item).

#TR {HP:%d MA:%m} {
#DBLOAD it
#if (%find( @item.name) = "") {#new "" @item} {#SAY Item Exists}
#t- ID
}

And then after the #CLASS 0 we need a way to tell zmud to TURN on the ID triggers and clear the variable

#ALIAS ID {
#T+ ID
item=""
Cast ID %1
}

Make thouse changes and post the output I asked for from above and someone will be able to help you further remember being super general, only using PARTS of your mud output etc Make it harder for people to figure out the problem. Also readin repeatadly the helpfiles for any commands and functions you use will also help you understand your script. in the command line type
#HELP commandname
_________________
Zmud Support Library
Zmud Knowledge Base
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