someone help! I dunno how to script

Posted by Excalibur on Sun 02 Mar 2003 10:03 PM — 4 posts, 18,775 views.

#0
I'm looking for a way to eaisly tally backstabs, trips, throws, and steals on the mud I play (Darklord). I basically just want the total # of stabs, trips, throws, and steals i hit/miss. Since I have no clue how to script, and assuming none of you play darklord, I'll be as basic as I can and help as much as possible, and hopefully someone can help me out?

Here is some MUD output for backstab (we have multiple messages):

message #1:
A Citizen of the Republic shudders as you bury Stealth up to the hilt in his back.

message #2:
The Pleb makes a strange gurgling noise as you stab him in the back.

message #3:
The Pleb screams in pain as you stab him in the back.

message #4:
You try to stab the Pleb, but nearly cut your own finger.


Here is some MUD output for trip (not many of these):

message #1:
You manage to trip your victim!

message #2:
Damn! You clumsily fail your trip and fall down yourself.

Here is some MUD output for throw:

message #1:
You miss by a yard!

message #2:
Three-prong dagger hits a Citizen of the Republic right in the abdomen.

(but it can hit multiple places, such as right arm, left arm, right thigh, left thigh, right food, left foot, right leg, left leg, nose, face)

Here is some MUD output for steal:

message #1:
You failed to get any gold... (meaning they had no gold)

message #2:
You have been noticed!

message #3
Bingo! You stole XXXXX gold coins.


Well, If you need anything else to work with, just ask. Some one please help me set some decent counters! THANKS!!!


Australia Forum Administrator #1
I would make some triggers that match the messages, replacing the variable bits with an asterisk, eg.

* shudders as you bury * up to the hilt in * back.
* makes a strange gurgling noise as you stab * in the back.
* screams in pain as you stab * in the back.

(and so on)

Each of these could call the same script, for instance in VBscript:


sub onbackstab (name, line, wildcards)
dim count
  count = CInt (world.GetVariable ("stabs"))
  count = count + 1
  world.SetVariable "stabs", count
  world.SetStatus count & " backstabs"
end sub
#2
Sorry to be such a burden but, I really have no idea what im doing what so ever. You lost me after "each of these could call up a VBscript" *Cry*
USA #3

Save the following text in the MUSHclient script file. (control-shift-H) will usually bring it up. Just paste this at the bottom and save (control-S)

sub onbackstab (name, line, wildcards)
dim count
  count = CInt (world.GetVariable ("stabs"))
  count = count + 1
  world.SetVariable "stabs", count
  world.SetStatus count & " backstabs"
end sub


Now go make triggers for each of the following patterns, but in the "Script:" box, type onbackstab. You don't need to put anything in the "Send:" box

* shudders as you bury * up to the hilt in * back.
* makes a strange gurgling noise as you stab * in the back.
* screams in pain as you stab * in the back.


Each time a trigger matching one of the above patterns is called, it'll run the subroutine you pasted into the MUSHclient scriptfile. It'll update the count of backstabs and print the total in the status bar as "15 backstabs"