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
kicken
Newbie


Joined: 27 Jul 2003
Posts: 6
Location: Sweden

PostPosted: Sun Jul 27, 2003 5:58 pm   

add data to database twice
 
I have made a eq database that kollects data from an identify trigger. but I have a problem. If I am in a group an leader of the group identifys stuff i get informed and the data goes to my db. fine. thats whats supposed to happen. but if same object get identifyed more than once I get multiple identical entries in the db. I have no clue how to solve this. plz help me.

/Kicken
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Sun Jul 27, 2003 7:53 pm   
 
you could try useing an #if to figure out IF it is in the database or not then true= do nothing false= adds the info

example:
#TRIGGER {you identify an (*)} {#var found "";#VAR found %find("%1",all);#IF @found="" {add the info}}

wher "add the info" is your scipt for adding the info the way you have set it up.
This would go into what ever trigger you have already but at the biggining and is only an exampl not to be cut and pasted obviously.
Reply with quote
zex0s
Wanderer


Joined: 29 Jun 2003
Posts: 64

PostPosted: Sun Jul 27, 2003 9:26 pm   
 
This would probably work for my *own* needs in a another database, however, a more elegant solution would be to somehow find the record and simply put the information into the same record, so if it changes, it'll update the database with it's changes.. however, I currently have no idea how to do this... And since I am making a character database that builds itself from a who's online command, I would certainly like to keep the database updated...

(I intend to actually use the database info in other scripts so when I see the chars, I will know there level, class(es), etc..)
Reply with quote
Evangelist
Adept


Joined: 10 Oct 2000
Posts: 224
Location: USA

PostPosted: Mon Jul 28, 2003 12:13 am   
 
Ah, but that may not always be the best case. If, for some reason, you make an equipment database on a mud that has equipment that tweaks, you would not want to update the record unless the item you identified is of a higher tweak (more hr, dr, hp, etc) then the previous entry in the database.

I know a guy who has a db for tweaks with a low tweak and a high tweak, really awesome, a ton of word :)
Reply with quote
kicken
Newbie


Joined: 27 Jul 2003
Posts: 6
Location: Sweden

PostPosted: Mon Jul 28, 2003 9:06 pm   
 
thanks now I got my eq database working.
now I am going to work on replying on ask tell :)
if someone ask me ident sword might I shoul be able to awnser with all stats....
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