Page 1 of 1

Basic Rescue Trigger for Newbie

Posted: Fri Jan 26, 2018 10:01 pm
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?

Re: Basic Rescue Trigger for Newbie

Posted: Sun Jan 28, 2018 2:36 pm
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.