Equipment Database - Revisited

Scripts and support for your favorite MUD client.
Gizep
Sojourner
Posts: 150
Joined: Thu Mar 10, 2005 4:34 pm
Location: Menzoberranzan
Contact:

Equipment Database - Revisited

Postby Gizep » Mon Jun 19, 2006 9:12 am

Lost all my triggers in a tragic moving accident:
Computer got broke or something and wont power up now, so I sat down and rewrote everything.

If You didn't read the original post and need some explanation of how it all works, read this:
http://www.torilmud.org/phpBB2/viewtopic.php?t=15207

Anyways, this thing is like 300 percent faster cuz of the use of functions n stuff.

Code: Select all

#CLASS 0
#TRIGGER {^$} {#IF (@Identify = 1) {idthis}}
#ALIAS sayitem {#VARIABLE LastID {%time( "mm.dd.yyyy")};#IF (!%find( %trim( @IName), NAME)) {#SAY Adding Record;#NEW All {Name=@IName|Worn=@IWear|Keywords=@IKeywords|Type=@IType|Abilities=@IAbilities|Bits=@IBits|AC=@IAC|Weight=@IWeight|Value=@IValue|Affects=@IAffects|SEffects=@ISEffects|CCritical=@ICCritical|CEffects=@ICEffects|Dice=@IDice|LastID=@LastID}} {#SAY Already in Database}}
#ALIAS lookup {#VARIABLE TempItem {Item Not In Database};#IF (%find( %trim( %0), NAME)) {#DBGET %item( %find( %trim( %0), NAME), 1);#IF (&Name != "") {#VARIABLE TempItem {&Name}};#IF (&Worn != "") {#VARIABLE TempItem {@TempItem &Worn}};#IF (&Type != "") {#VARIABLE TempItem {@TempItem &Type}};#IF (&Abilities != "") {#VARIABLE TempItem {@TempItem &Abilities}};#IF (&Bits != "") {#VARIABLE TempItem {@TempItem &Bits}};#IF (&AC != 0) {#VARIABLE TempItem {@TempItem AC: &AC}};#IF (&Affects != "") {#VARIABLE TempItem {@TempItem &Affects}};#IF (&SEffects != "") {#VARIABLE TempItem {@TempItem &SEffects}};#IF (&CCritical != "") {#VARIABLE TempItem {@TempItem &CCritical}};#IF (&CEffects != "") {#VARIABLE TempItem {@TempItem &CEffects}};#IF (&Dice != "") {#VARIABLE TempItem {@TempItem &Dice}};#IF (&LastID != "") {#VARIABLE TempItem {@TempItem LastID: &LastID}}};#WINDOW Stats %ansi( high, white)@TempItem}
#ALIAS idthis {#T- Identify;#VARIABLE Identify 0;sayitem}
#TRIGGER {You feel informed:} {#var IName {};#var IKeywords {};#var IType {};#var IWear {};#var IAbilities {};#var IBits {};#var IWeight 0;#var IValue 0;#var IAC 0;#var IDice {};#var IAffects {};#var ICeffects1 {};#var ICeffects2 {};#var ICeffects {};#var ISEffects {};#var ICCritical {};#var OldAffects {};#var Identify 1;#T+ Identify}

#CLASS {Identify} {disable}
#TRIGGER {Name ~'&IName~'} {#var IName {%trim( @IName)}}
#TRIGGER {Keyword ~'&IKeywords~'} {#var IKeywords {%trim( @IKeywords)}}
#TRIGGER {Item type:&IType} {#var IType {%trim( @IType)}}
#TRIGGER {Item can be worn on:&IWear} {#var IWear {%trim( @IWear)}}
#TRIGGER {Item will give you following abilities:&IAbilities} {#var IAbilities {%trim( @IAbilities)}}
#TRIGGER {Item is:&IBits} {#var IBits {%trim( @IBits)}}
#TRIGGER {Weight:&IWeight~,} {#var IWeight {%trim( @IWeight)}}
#TRIGGER {Value:&IValue} {#var IValue {%trim( @IValue)}}
#TRIGGER {Damage Dice is ~'&IDice~'} {#var IDice {%trim( @IDice)}}
#TRIGGER {Affects ~:&IAffects} {#var IAffects {@OldAffects %trim( @IAffects)};#var IAffects {%trim( @IAffects)};#var OldAffects %trim( @IAffects)}
#TRIGGER {Called Effects :&ICeffects1$&ICeffects2} {#var ICeffects {%trim( @ICeffects1) %trim( @ICeffects2)}}
#TRIGGER {Special Effects :&ISEffects} {#var ISEffects {%trim( @ISEffects)}}
#TRIGGER {Combat Critical :&ICCritical} {#var ICCritical {%trim( @ICCritical)}}
#TRIGGER {AC-apply is &IAC} {#var IAC {%trim( @IAC)}}
#CLASS 0
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
Vipplin
Sojourner
Posts: 434
Joined: Thu Jun 14, 2001 5:01 am
Location: Hawaii

Postby Vipplin » Tue Jun 20, 2006 9:34 pm

Tried it, followed dirs in your original post and then imported this above stuffs. Did not work. When defining the database, are all fields text or...? Just trying to nail down the prob.

Tells me 'adding to database' at the end but just adds a blank record. I'll probably figure it out eventually... just hoping I've missed an easy step.

*EDIT*
Nevermind, writing my own anyway since I want bells and whistles :)
Iyced / Torgu / Iysor
Gizep
Sojourner
Posts: 150
Joined: Thu Mar 10, 2005 4:34 pm
Location: Menzoberranzan
Contact:

Postby Gizep » Thu Jun 22, 2006 11:14 pm

Truthfully, thats what you really gotta do, you gotta mess with it. Hell, zoom told me how to make the lookup hella fast, that's all i'm really sharing here, gotta have a name only view just for the lookup, makes it super fast.
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
Teralyn
Sojourner
Posts: 60
Joined: Wed Nov 27, 2002 6:01 am
Contact:

Postby Teralyn » Wed Jun 28, 2006 4:43 am

ok, well since I lost most of my old trigger sets and what not, I wanted to give this one a try. I followed all of the directions on your other post. Set the preferences the way you said, and defined the database with the instructed fields. but it doesn't work. Only captures damage dice, weight, value, that's about it. Am I doing something wrong?
Gizep
Sojourner
Posts: 150
Joined: Thu Mar 10, 2005 4:34 pm
Location: Menzoberranzan
Contact:

Postby Gizep » Wed Jun 28, 2006 5:12 am

The database fields for mine are above not the ones posted in the original the db names have & begining their name the zmud variables have @, sorry for the confusion. One way to tell what should be text in the db is this:

All text fields are set to "" in the initialization and numbers are set to 0 (thats the "You feel informed" trigger.
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 » Wed Jun 28, 2006 5:14 am

One more thing, you also need a view containing Name field only, named NAME.
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
Teralyn
Sojourner
Posts: 60
Joined: Wed Nov 27, 2002 6:01 am
Contact:

Postby Teralyn » Wed Jun 28, 2006 5:23 am

One more thing, you also need a view containing Name field only, named NAME.


What do you mean? (Sorry, I'm not that good at this kinda stuff)
Teralyn
Sojourner
Posts: 60
Joined: Wed Nov 27, 2002 6:01 am
Contact:

Postby Teralyn » Wed Jun 28, 2006 7:41 am

Got it. It works fantastically! Thanks so much for your help Deabnue!!
Gizep
Sojourner
Posts: 150
Joined: Thu Mar 10, 2005 4:34 pm
Location: Menzoberranzan
Contact:

Postby Gizep » Tue Jul 25, 2006 1:47 pm

New attempt at posting the whole schebang.

Code:

Code: Select all

#CLASS {Identify} {disable}
#TRIGGER {Keyword ~'&IKeywords~'} {#var IKeywords {%trim( @IKeywords)}}
#TRIGGER {Item type:&IType} {#var IType {%trim( @IType)}}
#TRIGGER {Item can be worn on:&IWear} {#var IWear {%trim( @IWear)}}
#TRIGGER {Item will give you following abilities:&IAbilities} {#var IAbilities {%trim( @IAbilities)}}
#TRIGGER {Item is:&IBits} {#var IBits {%trim( @IBits)}}
#TRIGGER {Weight:&IWeight~,} {#var IWeight {%trim( @IWeight)}}
#TRIGGER {Value:&IValue} {#var IValue {%trim( @IValue)}}
#TRIGGER {Damage Dice is ~'&IDice~'} {#var IDice {%trim( @IDice)}}
#TRIGGER {Affects ~:&IAffects} {#var IAffects {@OldAffects %trim( @IAffects)};#var IAffects {%trim( @IAffects)};#var OldAffects %trim( @IAffects)}
#TRIGGER {Called Effects :&ICeffects1$&ICeffects2} {#var ICeffects {%trim( @ICeffects1) %trim( @ICeffects2)}}
#TRIGGER {Special Effects :&ISEffects} {#var ISEffects {%trim( @ISEffects)}}
#TRIGGER {Combat Critical :&ICCritical} {#var ICCritical {%trim( @ICCritical)}}
#TRIGGER {AC-apply is &IAC} {#var IAC {%trim( @IAC)}}
#TRIGGER {Poison affects as &spellcast at level &%dspelllevel~.} {}
#TRIGGER {Applications remaining~: &%dApp} {}
#TRIGGER {Level &%dSpellLevel spell of:$&SpellCast$} {}
#TRIGGER {Has &%dCharges charges} {}
#TRIGGER {Level &%dSpellLevel spells of:$&SpellCast$} {}
#TRIGGER {with &%dCleft charges left} {}
#TRIGGER {Name ~'&IName~'} {}
#CLASS 0
#TRIGGER {^You feel informed:$} {#VARIABLE IName {};#VARIABLE IKeywords {};#VARIABLE IType {};#VARIABLE Charges 0;#VARIABLE Cleft 0;#VARIABLE IWear {};#VARIABLE IAbilities {};#VARIABLE IBits {};#VARIABLE IWeight 0;#VARIABLE IValue 0;#VARIABLE IAC 0;#VARIABLE IDice {};#VARIABLE IAffects {};#VARIABLE ICeffects1 {};#VARIABLE ICeffects2 {};#VARIABLE App 0;#VARIABLE NotINDB = 0;#VARIABLE SpellCast {};#VARIABLE SpellLevel 0;#VARIABLE ICeffects {};#VARIABLE ISEffects {};#VARIABLE ICCritical {};#VARIABLE OldAffects {};#VARIABLE Identify 1;#T+ Identify}
#TRIGGER {^$} {#IF (@Identify = 1) {idthis}}
#ALIAS idthis {#T- Identify;#VARIABLE Identify 0;sayitem}
#ALIAS sayitem {#VARIABLE LastID {%time( "mm.dd.yyyy")};#IF (!%find( %trim( @IName), NAME)) {#SAY Adding Record;#NEW All {Name=@IName|Worn=@IWear|Keywords=@IKeywords|Type=@IType|Abilities=@IAbilities|Bits=@IBits|AC=@IAC|Weight=@IWeight|Value=@IValue|Affects=@IAffects|SEffects=@ISEffects|CCritical=@ICCritical|CEffects=@ICEffects|Dice=@IDice|SpellCast=@SpellCast|SpellLevel=@SpellLevel|Applications=@App|Charges=@Charges|Cleft=@Cleft|LastID=@LastID}} {#SAY Already in Database}}


Database Fields:
Name - Text
Worn - Text
Keywords - Text
Type - Text
Abilities - Text
Bits - Text
AC - Number
Weight - Number
Value - Number
Affects - Text
Seffects - Text
CCritical - Text
Ceffects - Text
Dice - Text
LastID - Text
SpellCast - Text
SpellLevel - Number
Applications - Number
Charges - Number
Cleft - Number


You must also have a database view set up with just the name column named NAME, for the fast lookup.
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
Dalar
Sojourner
Posts: 4905
Joined: Sun Feb 25, 2001 6:01 am

Postby Dalar » Sun Mar 02, 2008 12:54 am

How do you repeat shit to people like Kegor does.
It will be fixed in Toril 2.0.
Aremat group-says 'tanks i highly suggest investing 20 silver in training weapons from cm to cut down on the losing scales to shield'

Return to “MUD Client Help”

Who is online

Users browsing this forum: No registered users and 13 guests