Basic Rescue Trigger for Newbie

Share your scripts and packages with other Mudlet users.
Post Reply
gylippus
Posts: 7
Joined: Mon Jul 06, 2015 11:21 am

Basic Rescue Trigger for Newbie

Post by gylippus »

So, I have a rescue trigger that works. It looks like this:

TN: (\w+) perl regex

target = matches[2]
if target ~= "Honeythorn" then
send("stand")
send("rescue " .. target)
end

__________
TN stands for tank in the prompt during battle

My question is this:

I now have two tanks in a group. If my first tank dies I want my second tank to then rescue whoever is hit next and take over tanking duties. The first tanks name is 'Brasidas'. Can anyone steer me in the right direction?

Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Re: Basic Rescue Trigger for Newbie

Post by Jor'Mox »

The key question is what would you see when this happens? It seems to me that there are a few potential cases.
  • 1st tank alive and tanking -- do nothing
  • 1st tank alive, some other group member tanking -- have 1st tank rescue
  • 1st tank dead, 2nd tank alive and tanking -- do nothing
  • 1st tank dead, 2nd tank alive, some other group member tanking -- have 2nd tank rescue
  • 1st and 2nd tanks dead -- do nothing
In two of those cases, you actually have to do something, so you need to be able to detect when one of them occurs, and differentiate between them. So, you need some way to tell which tanks are alive, and some way to tell who is currently acting as the tank. Then it should be a fairly simple logic problem to figure out what to do. So, if you can provide us with some example text and point out what pieces you use to tell what is going on and what needs to happen, I'm sure we can figure it out.

Post Reply