|
undergod Wanderer
Joined: 27 Jun 2001 Posts: 82
|
Posted: Tue Dec 04, 2001 6:16 am
Autokill logger? |
Okay, I'm getting pretty good at scripting, but never tried any DB stuff. I was wondering if it would be possible to create a database that would record whatever I killed and how many I have killed to date? Something like:
A castle Soldier: 1
A mean Dwarf: 1
A Valley Elf: 1
and etc. It would need to introduce a new name if that mob was not named there. The text i get when i kill a mob is:
You have killed A valley Elf!
You receive 20,000 Exp! |
|
|
|
cingulli Wanderer
Joined: 30 Aug 2001 Posts: 53 Location: Finland
|
Posted: Tue Dec 04, 2001 11:24 am |
how about logging everything and just using 'grep' or something similar ,)
|
|
|
|
Acaila Apprentice
Joined: 30 Aug 2001 Posts: 187 Location: Netherlands
|
Posted: Tue Dec 04, 2001 2:51 pm |
If you have a variable called @KillList, then the trigger is as follows:
#TRIGGER {^You have killed (*)} {#IF (%ismember("%1", @KillList)) {#LOOPDB @KillList {#IF ("%key" = "%1") {%val = %eval(%val + 1)}}} {#ADDKEY @KillList "%1" 1}}
To see what's in it, you can do something like:
#LOOPDB @KillList {#SAY %key: %val}
Acaila |
|
|
|
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: Tue Dec 04, 2001 8:09 pm |
A faster method would be:
#TR {You have killed (*)!} {
#IF %iskey(@KillList, "%1") {
#ADDKEY KillList "%1" %eval(%db(@KillList, "%1")+1)
} {
#ADDKEY KillList "%1" 1
}
}
Troubadour |
|
|
|
undergod Wanderer
Joined: 27 Jun 2001 Posts: 82
|
Posted: Thu Dec 06, 2001 7:15 am |
Okay, and how do I view all this newfound information? =) The trigger captures all the information...
|
|
|
|
Acaila Apprentice
Joined: 30 Aug 2001 Posts: 187 Location: Netherlands
|
Posted: Thu Dec 06, 2001 7:39 am |
For both Troubadour's trigger and my own that would be:
#LOOPDB @KillList {#SAY %key: %val}
Acaila |
|
|
|
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: Thu Dec 06, 2001 10:06 am |
A nifty speed menu item to check your kills of one particular mob is:
#MENU {Kill Count} {
#IF %null(%selected) {
#SAY Please highlight the full name of the mob.
} {
#IF %iskey(@KillList, %selected) {
#SAY You have %db(@KillList, %selected) kills of %selected~.
} {
#SAY You have no kills of %selected~.
}
}
}
Highlight the name of the mob anywhere in the MUD output, then right-click. Select "Kill Count" in the pop-up menu.
Troubadour |
|
|
|
undergod Wanderer
Joined: 27 Jun 2001 Posts: 82
|
Posted: Sat Dec 08, 2001 2:49 am |
Okay, I have no idea how to do this... *sigh* sometimes my MUD sends a > character. Here's a quick example of what I mean.
> smile
You smile
>
So, after it responds to the command, it sends a > character. In theory to line up your commands. But, if you type a command just before the mob dies, you get:
> punch mob
You punch a mob!
> mob dies
In this case, the above mentioned kill logger will register "> mob" as a kill. Is there anyway to get rid of this? |
|
|
|
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: Sat Dec 08, 2001 6:44 am |
quote:
> punch mob
You punch a mob!
> mob dies
In this case, the above mentioned kill logger will register "> mob" as a kill. Is there anyway to get rid of this?
Use the %replace function to strip out the offending characters:
#ADDKEY KillList %replace("%1", "> ", "") %eval(%db(@KillList, %replace("%1", "> ", ""))+1)
#ADDKEY KillList %replace("%1", "> ", "") 1
Troubadour |
|
|
|
undergod Wanderer
Joined: 27 Jun 2001 Posts: 82
|
Posted: Sat Dec 08, 2001 7:13 am |
quote:
Use the %replace function to strip out the offending characters:
#ADDKEY KillList %replace("%1", "> ", "") %eval(%db(@KillList, %replace("%1", "> ", ""))+1)
#ADDKEY KillList %replace("%1", "> ", "") 1
Troubadour
So it would look like this in it's complete form?
#TR {You have killed (*)!} {#IF %iskey(@KillList, "%1")
{#ADDKEY KillList %replace("%1", "> ", "") %eval(%db(@KillList, %replace("%1", "> ", ""))+1)}
{#ADDKEY KillList %replace("%1", "> ", "") 1}} |
|
|
|
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: Sat Dec 08, 2001 8:46 am |
Yep.
Troubadour |
|
|
|
|
|