|
Gandorf Novice
Joined: 28 Oct 2000 Posts: 38 Location: Sweden
|
Posted: 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 |
|
|
|
Gandorf Novice
Joined: 28 Oct 2000 Posts: 38 Location: Sweden
|
Posted: 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 |
|
|
|
|
|