[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUDs
. -> [Folder]  General
. . -> [Subject]  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] Refresh page


Posted by Xandler   (47 posts)  [Biography] 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?
[Go to top] top

Posted by Fiendish   USA  (2,513 posts)  [Biography] 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
[Go to top] 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.


5,861 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]