Multiple group kill set-up

Posted by Xandler on Wed 13 Jan 2021 12:01 AM — 2 posts, 11,494 views.

#0
Unfortunately, my previous HDD has died and I'm currently unable to recover the files from it so I need to re-write this entirely from memory (which I'm not good at doing). Basically what it is. One group is a set of mobile names in a list set-up (for like names)that sends commands to kill then disables the group and repeats itself until the room is dead then tracks the next mobile with that name and repeats. What I just can't figure out currently is how to make it move rooms when the last mobile in the list has died in the room.

I will provide the trigger groups so it'll be easier to understand:

This is the list of mobiles it should kill:

<triggers>
  <trigger
   expand_variables="y"
   group="mobstokill"
   match="(A Cursed Soul is wandering around the waters here.|A Tranquil Soul is here, at peace with its existance.|A Lost Soul floats in the waters here.)"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>Send ("@single soul")
Send ("@single")
Send ("alert")
EnableTriggerGroup ("mobstokill", false)</send>
  </trigger>
  <trigger
   expand_variables="y"
   group="mobstokill"
   match="(A Peaceful Spirit plays around in the waters here.|A Spiteful Spirit is forever cursed to live on in this form.|A Vengeful Spirit looks like it is up to no good.)"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>Send ("@single spirit")
Send ("@single")
Send ("alert")
EnableTriggerGroup ("mobstokill", false)</send>
  </trigger>
</triggers>


This is the trigger set that should move me:

<triggers>
  <trigger
   expand_variables="y"
   group="mobstomove"
   match="[Fatigue\:"
   name="moveto"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>EnableTriggerGroup ("mobstokill", true)
EnableTrigger ("moveto", false)
Send 'sense @target'</send>
  </trigger>
  <trigger
   enabled="y"
   group="mobstomove"
   match="Visible Exits: "
   sequence="100"
  >
  </trigger>
  <trigger
   expand_variables="y"
   group="mobstomove"
   match="You let everyone know that you're ready."
   send_to="12"
   sequence="100"
  >
  <send>Send 'look'
EnableTriggerGroup ("mobstokill", true)
EnableTriggerGroup ("mobstomove", true)</send>
  </trigger>
  <trigger
   enabled="y"
   expand_variables="y"
   group="mobstomove"
   match="That mob does not exist, cannot be sensed, or there is no path to them."
   name="spiritlake"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>clearer = tonumber (GetVariable ("clearer")) or 0
clearer = clearer + 1
SetVariable ("clearer", clearer)
if @clearer == 1 then
SetVariable ("target", "spiteful")
Send 'look'
else
if @clearer == 2 then
SetVariable ("target", "peaceful")
Send 'look'
else
if @clearer == 3 then
SetVariable ("target", "vengeful")
Send 'look'
else
Note ("Spirit Lake is Done.")
Send 'snort'
end
end
end</send>
  </trigger>
</triggers>


I think it has something to do with the Fatigue: trigger I have, for some reason it's not matching. which should be

[Fatigue: 0%]

I honestly don't know how to set this up anymore and need some help if it's possible.
Amended on Wed 13 Jan 2021 12:31 AM by Xandler
Australia Forum Administrator #1

clearer = clearer + 1
SetVariable ("clearer", clearer)
if @clearer == 1 then
...


This is probably not going to do what you expect. The variables inside a trigger like @clearer are evaluated before it starts executing. So @clearer will not change, even if you add one to it inside the script. What would be better is:


clearer = clearer + 1
SetVariable ("clearer", clearer)
if clearer == 1 then
...


That uses the Lua variable (which will have changed) and not the earlier MUSHclient variable.