Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUDs ➜ General ➜ Moving to a different area after a certain amount of time

Moving to a different area after a certain amount of time

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Xandler   (52 posts)  Bio
Date Fri 25 Jun 2021 01:47 PM (UTC)
Message
I basically want to use the clearer variable (and trigger set-up) to move from a certain zone after a set amount of time (it respawns too fast for me to kill it all and affects my levels per hour by a lot)

The clearer trigger set-up I have is as follows:

<triggers>
  <trigger
   enabled="y"
   expand_variables="y"
   group="solo"
   keep_evaluating="y"
   match="That mob does not exist, cannot be sensed, or there is no path to them."
   name="lycan"
   send_to="12"
   sequence="100"
  >
  <send>clearer = tonumber (GetVariable ("clearer")) or 0
clearer = clearer + 1
SetVariable ("clearer", clearer)
if @clearer == 1 then
SetVariable ("target", "lycan")
Send 'sense lycan'
else
if @clearer == 2 then
SetVariable ("target", "fiera")
Send 'sense fiera'
else
if @clearer == 3 then
SetVariable ("target", "cyclopian")
Send 'sense cyclopian'
else
if @clearer == 4 then
SetVariable ("target", "secluded")
Send 'sense secluded'
else
if @clearer == 5 then
SetVariable ("target", "camouflaged")
Send 'sense camouflaged'
else
SetVariable ("clearer", "1")
SetVariable ("target", "lycan")
Send 'sense lycan'
end
end
end
end
end</send>
  </trigger>
</triggers>


I want it to move on from the "cyclopian" area after say, 30 minutes. I've tried throwing in a
 
if GetVariable ("clearer") == 3 
then DoAfterSpecial (30, "sense self", sendto.world)
end

after that particular section, but I just can't get this to fire (I know DoAfterSpecial uses seconds (used 30 for testing)). Do I need to use an entirely different trigger to set this up?
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #1 on Fri 25 Jun 2021 05:50 PM (UTC)

Amended on Fri 25 Jun 2021 05:57 PM (UTC) by Fiendish

Message
First, There's no good reason to use the @ client variable expansion "@clearer" like that. Just look at the local numeric variable for clearer that you've already created there.

Second, all of those "end"s are weird. Lua has "elseif" https://www.lua.org/pil/4.3.1.html.

Third, GetVariable returns a string, not a number. Just like you shouldn't use @clearer there, you also shouldn't use GetVariable("clearer") there when you've already read it into a numeric local variable.

Try

clearer = tonumber (GetVariable ("clearer")) or 0
clearer = clearer + 1
SetVariable("clearer", clearer)

if clearer == 1 then
   SetVariable ("target", "lycan")
   Send 'sense lycan'
elseif clearer == 2 then
   SetVariable ("target", "fiera")
   Send 'sense fiera'
elseif clearer == 3 then
   SetVariable ("target", "cyclopian")
   Send 'sense cyclopian'
   DoAfterSpecial (30, "sense self", sendto.world)
elseif clearer == 4 then
   SetVariable ("target", "secluded")
   Send 'sense secluded'
elseif clearer == 5 then
   SetVariable ("target", "camouflaged")
   Send 'sense camouflaged'
else
   SetVariable ("clearer", 1)
   SetVariable ("target", "lycan")
   Send 'sense lycan'
end

https://github.com/fiendish/aardwolfclientpackage
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


7,182 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.