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
Gandorf
Novice


Joined: 28 Oct 2000
Posts: 38
Location: Sweden

PostPosted: Tue Jun 04, 2002 9:17 pm   

DB problem
 
I trying to create a database for playerkills and playerdeaths on the mud I play. What I'm haveing trouble with is to add 1 to the number of kills or deaths when that happen. So far this is what my trigger looks like.
Pattern: ## (%w) was just DEFEATED in battle by (%w)!!

Value: #VARIABLE newRec %null
#VARIABLE Killer %2
#VARIABLE Victim %1
#IF (@KILLER!=YOU) {
#ADDKEY newRec Name @Killer
#DBLOAD pk
#Query ((&Name=@newRec.Name)) All 1
#IF %null( %rec) {
#ADDKEY newRec Kills 1
#NEW All @newRec
} {
#VARIABLE tempdb {%find( @killer, All)}
#var tempdb {%replace( @tempdb, pk, "")}
#ADD @tempdb.Kills 1
#show @tempdb
}
#DBRESET
} {#ADDKEY newRec Name %char}
#IF (@Victim!=You) {#ADDKEY newRec Name @Victim} {#ADDKEY newRec Name %char}

I might have missed something or is doing it in the wrong way but for what I have gotten out of the help files this way should work.
Any suggestion would be more then welcomed

Thanks

Gandorf
-------------------------
Out in the night they laugh about me and my knowledge
Reply with quote
Gandorf
Novice


Joined: 28 Oct 2000
Posts: 38
Location: Sweden

PostPosted: Wed Jun 05, 2002 8:48 pm   
 
I have made this working.
I had to put <> around the tempdb variable to expend it. Doh should have thought of this yesterday but I was a bit tired while trying to make it

Gandorf
-------------------------
Out in the night they laugh about me and my knowledge
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