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
jed
Adept


Joined: 18 Dec 2005
Posts: 246

PostPosted: Mon Apr 10, 2006 1:38 am   

Involuntary Database value changes
 
I have an equipment database running, which is a modification of the one that comes pre-setup in Zmud. I also have a number of autocapture triggers setup to autoid objects from the mud (Fox Mud). So I have a number of objects within the database, my problem is this. From time to time, a number (or sometimes all) of the records have thier name field changed to 0. It seems to be random, I can't seem to pin it down to any particular function. I have a sneeking suspicion that it is related to my autocapture triggers, however I thought I would check to see if others have this problem before I dig in for what could turn out to be a bunch of work debugging my triggers...
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Mon Apr 10, 2006 5:22 am   
 
Oooh, FoxMUD. Is that at foxmud.com:4848 the one run by Sygis? If it is post your id triggers and I'll figure out what is going wrong.
_________________
Taz :)
Reply with quote
jed
Adept


Joined: 18 Dec 2005
Posts: 246

PostPosted: Fri Apr 14, 2006 1:11 am   
 
Yes it is... Sygis is the man.
Here are my triggers, I have them tied to an identify alias that enables/disables these triggers for a 5000 count.

Here is the alias
#LO autoidbackup.txt
#class autoid 1
#var actemp ""
#var item ""
recite identify %1
#var item.whoid %char
#var item.iddate %time( mm/dd/yy)
#wa 5000
#IF (!%null( @Item)) {#NEW All @Item}
say @item
#class autoid 0
#VAR dbCompare %query( ((&Object=@dbItem.Object)&(&Craftsmanship=@dbItem.Craftsmanship)&(&Armor=@dbItem.Armor)&(&Flags=@dbItem.Flags)&(&Affect=@dbItem.Affect)), dbType)
#VAR dbDoesExist 0
#IF (!%null( @dbCompare)) {dbDoesExist=1}
#IF (@dbDoesExist) {#YESNO "This record already exists in the current Database. Are you sure you want to add it?" {#NEW All @dbItem} {No:#NOOP}} {#NEW All @dbItem}
#lo
ff @item.name


Here are the triggers...

#CLASS {AutoID}
#VAR idddcol {159}
#TRIGGER {it has a weight of (&item.weight) and a value of (&item.goldvalue) gold pieces.} {#cw @idddcol}
#TRIGGER {it can be worn on your arms.} {
#var item.wearloc arms
#cw @idddcol
}
#TRIGGER {A (&item.name) would be considered a potion case.} {
#var item.itemtype potioncase
#var item.wearloc inventory
#cw @idddcol
}
#TRIGGER {it can be worn on your neck.} {
#var item.wearloc neck
#cw @idddcol
}
#TRIGGER {it can be worn around your waist.} {
#var item.wearloc waist
#cw @idddcol
}
#TRIGGER {it can be worn on your feet.} {
#var item.wearloc feet
#cw @idddcol
}
#TRIGGER {it can be worn on your head.} {
#var item.wearloc head
#cw @idddcol
}
#TRIGGER {it can be worn on your wrist.} {
#var item.wearloc wrist
#cw @idddcol
}
#TRIGGER {it can be worn as a shield.} {
#var item.wearloc shield
#cw @idddcol
}
#TRIGGER {it can be worn on your legs.} {
#var item.wearloc legs
#cw @idddcol
}
#TRIGGER {it can be worn about your body.} {
#var item.wearloc aboutbody
#cw @idddcol
}
#TRIGGER {it can be wielded.} {
#var item.wearloc weapon
#cw @idddcol
}
#TRIGGER {it can be held in your off hand.} {
#var item.wearloc heldlow
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a key to something....} {
#var item.wearloc inventory
#var item.itemtype key
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a beverage container.} {
#var item.wearloc inventory
#var item.itemtype drinkcanister
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a bit of food.} {
#var item.wearloc inventory
#var item.itemtype food
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a blank scroll ready to be scribed..} {
#var item.wearloc inventory
#var item.itemtype blankscroll
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a container.} {
#var item.wearloc inventory
#var item.itemtype container
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a keyring.} {
#var item.wearloc keyring
#var item.itemtype keyring
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a light source.} {
#var item.wearloc light
#var item.itemtype light
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a magical scroll.} {
#var item.wearloc inventory
#var item.itemtype magicalscroll
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a magical staff.} {
#var item.itemtype magicalstaff
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a piece of armor.} {
#var item.itemtype armor
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a piece of clothing.} {
#var item.itemtype clothing
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a piece of treasure.} {
#var item.itemtype treasure
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a quaffable potion.} {
#var item.wearloc inventory
#var item.itemtype quaffablepotion
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a spell component.} {
#var item.wearloc inventory
#var item.itemtype spellcomponent
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a ticket of some kind.} {
#var item.wearloc inventory
#var item.itemtype ticket
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a unit of ammunition.} {
#var item.wearloc inventory
#var item.itemtype ammunition
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a weapon.} {
#var item.itemtype weapon
#var cccc %ansi( blue, yellow)
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered something most folks might discard.} {
#var item.wearloc inventory
#var item.itemtype discard
#cw @idddcol
}
#TRIGGER {(&item.damtype) damage is (&item.mindam) to (&item.maxdam) ~(average (&item.avedam)~)} {
say this is damage @item
#cw @idddcol
}
#TRIGGER {(*), and it can be used to backstab.} {
#var item.bsweapon yes
#cw @idddcol
}
#TRIGGER {it seems comprised significantly of (&item.composition).~)} {#cw @idddcol}
#TRIGGER {A (&item.name) would be considered a piece of furniture.} {
#var item.type furniture
#cw @idddcol
}
#TRIGGER {It hovers in midair.} {
#var item.hovers hovers
#cw @idddcol
}
#TRIGGER {No matter how hard you try, you can not seem to drop this.} {
#var item.dropable nodrop
#cw @idddcol
}
#TRIGGER {it would be considered a weapon of (&item.composition).~)} {#cw @idddcol}
#TRIGGER {It keeps fading in and out of existance every few seconds.} {
#var item.visibility invis
#cw @idddcol
}
#TRIGGER {(&item.doseqty) dose of level (&item.doselevel) spells of: (&item.dosespell)tell } {#cw @idddcol}
#TRIGGER {a dark aura surrounds it.} {
#var item.nature darkaura
#cw @idddcol
}
#TRIGGER {A faint humming sound is strangely emmiting from it.} {
#var item.nature humming
#cw @idddcol
}
#TRIGGER {a soft glow radiates from its surface.} {
#var item.nature softglow
#cw @idddcol
}
#TRIGGER {something about it makes you think it is evil.} {
#var item.nature evil
#cw @idddcol
}
#TRIGGER {it radiates a strong aura of the arcane.} {
#var item.nature magical
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered the key to a shadow gate} {
#var item.wearloc inventory
#var item.itemtype shadowkey
#cw @idddcol
}
#TRIGGER {and a value of (&item.goldvalue) gold pieces} {#cw @idddcol}
#TRIGGER {it appears completely filled with (&item.filltype).} {
#var item.fillamount full
#cw @idddcol
}
#TRIGGER {it appears just about filled with (&item.filltype).} {
#var item.fillamount justabout
#cw @idddcol
}
#TRIGGER {it appears less than full of (&item.filltype).} {
#var item.fillamount lessthanfull
#cw @idddcol
}
#TRIGGER {it appears well balanced for throwing.} {
#var item.comment throwable
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a scroll case.} {
#var item.wearloc scrollcase
#var item.itemtype scrollcase
#cw @idddcol
}
#TRIGGER {it will (*) your age by (&item.age).} {#cw @idddcol}
#TRIGGER {it will (*) your constitution by (&item.con).} {#cw @idddcol}
#TRIGGER {it will (*) your damage roll by (&item.dam).} {#cw @idddcol}
#TRIGGER {it will (*) your dexterity by (&item.dex).} {#cw @idddcol}
#TRIGGER {it will (*) your gold by (&item.goldaffect).} {#cw @idddcol}
#TRIGGER {it will (*) your hit roll by (&item.hit).} {#cw @idddcol}
#TRIGGER {it will (*) your hp by (&item.hp).} {#cw @idddcol}
#TRIGGER {it will (*) your intelligence by (&item.int).} {#cw @idddcol}
#TRIGGER {it will (*) your mana by (&item.mana).} {#cw @idddcol}
#TRIGGER {it will (*) your moves by (&item.mv).} {#cw @idddcol}
#TRIGGER {it will (*) your strength by (&item.str).} {#cw @idddcol}
#TRIGGER {it will do (&minammodam) to (&maxammodam) points of damage} {#cw @idddcol}
#TRIGGER {it will improve your save vs. breath by (&item.savevsbreath).} {#cw @idddcol}
#TRIGGER {it will improve your save vs. paralysis by (&item.savevsparalysis).} {#cw @idddcol}
#TRIGGER {it will improve your save vs. spell by (&item.savevsspell).} {#cw @idddcol}
#TRIGGER {it can light your way indefinitely.} {
#var item.wearloc light
#var item.itemtype lightsource
#var item.lightduration infinite
#cw @idddcol
}
#TRIGGER {it has a weight of (&item.weight) and} {#cw @idddcol}
#TRIGGER {it has an armor class bonus of (*)} {
#math actemp {%1 * 10}
#math item.ac {@actemp + @item.ac}
#cw @idddcol
}
#TRIGGER {its special properties will improve your armor class by (*)} {
#math actemp {%1 * 10}
say @item.ac
#math item.ac {@actemp + @item.ac}
#cw @idddcol
}
#TRIGGER {you need to be level (&item.minlevel) to} {#cw @idddcol}
#TRIGGER {this object may be stored in a bank.} {
#var item.bankable yes
#cw @idddcol
}
#TRIGGER {this object seems safe from thieves.} {
#var item.nosteal yes
#cw @idddcol
}
#TRIGGER {this object has been blessed by the gods.} {
#var item.nature blessed
#cw @idddcol
}
#TRIGGER {No truly good person should} {#var item.antialign nogood}
#TRIGGER {no truly evil person should } {
#var item.antialign noevil
#cw @idddcol
}
#TRIGGER {no neutral person should } {
#var item.antialign noneutral
#cw @idddcol
}
#TRIGGER {level (&item.scrollevel) spell of: '(&item.scrollspell)~'} {#cw @idddcol}
#TRIGGER {it seems to be a (&item.cpspellpower) component for the '(&item.cpspell)'} {#cw @idddcol}
#TRIGGER {it seems to have a small lock on it.} {
#var item.lockable yes
#cw @idddcol
}
#TRIGGER {it has (&item.chargeqty) ~(maximum (&item.chargemax)~) charges of level (&item.chargelevel) `(&item.chargespell)'} {#cw @idddcol}
#TRIGGER {it will (*) your wisdom by (&item.wis).} {#cw @idddcol}
#TRIGGER {It can be worn on your finger.} {
#var item.wearloc finger
#cw @idddcol
}
#TRIGGER {a (&item.name) would be considered a magic wand.} {
#var item.itemtype magicwand
#var item.wearloc heldlow
#cw @idddcol
}
#TRIGGER {It has 10 (maximum 10) charges of level 10 `enduring spirit'} {}
#TRIGGER {pirit'} {}
#TRIGGER {It will affect you with '(&item.affects)} {#cw @idddcol}
#TRIGGER {it can be worn around your neck.} {
#var item.wearloc neck
#cw @idddcol
}
#TRIGGER {It can be worn on your body.} {
#var item.wearloc torso
#cw @idddcol
}
#CLASS 0
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Fri Apr 14, 2006 9:42 am   
 
We generally discourage the use of #WAIT so consider turning it into a temporary #ALARM
#ALARM +5 {#class autoid 0}
can be put directly after
#class autoid 1
and you can then remove
#wa 5000
and
#class autoid 0
from the script.

The following statement is always going to evaluate to true due to you setting @item a couple of lines earlier
#IF (!%null( @Item)) {#NEW All @Item}
if you definitely always want to create a new db record then just put #NEW All @Item in on it's own otherwise you need to rethink your logic.

You may as well turn the following
#VAR dbDoesExist 0
#IF (!%null( @dbCompare)) {dbDoesExist=1}
into
#IF (!%null( @dbCompare)) {dbDoesExist=1} {dbDoesExist=0}

Where is your compare getting it's information from since @dbitem seems to be outside of what you have given me as I can't see it being set anywhere? Do you ever get asked the yes/no question? If you never get asked it even when doing an id on an item that is in there then your compare needs looking at otherwise no worries.

I would remove the following unused triggers
#TRIGGER {It has 10 (maximum 10) charges of level 10 `enduring spirit'} {}
#TRIGGER {pirit'} {}

Other than my suggestions I can't see anything that would be causing issues.
_________________
Taz :)
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