DoAfterSpecial

Posted by Solaras on Mon 13 Jun 2005 03:25 PM — 2 posts, 14,263 views.

#0
Hi,

I am new to Mushclient and so having some issues with a few things. One of which is utilising DoAfterSpecial effectively.

In Perl, I am attempting to set a variable = 1, then after 1 second set it = 0. What I can't figure out is how to do this in DoAfterSpecial. Currently I am using timers and setting them true or false and I find this to be cludgy.

Example:

$world->SetVariable("eatingyarrow", "1");
$world->EnableTimer("eatingyarrow", true);
$world->ResetTimer("eatingyarrow");

This is what I tried with DoAfterSpecial and failed miserably at:

$world->SetVariable("eatingyarrow", "1");
$world->DoAfterSpecial (1, '$world->SetVariable("eatingYarrow", "0");', 12);

USA #1
Works for me.
This is the alias I used to test it.

<aliases>
  <alias
   match="asdf"
   enabled="y"
   echo_alias="y"
   send_to="12"
   ignore_case="y"
   sequence="100"
  >
  <send>$world-&gt;SetVariable("eatingyarrow", 1);
$world-&gt;DoAfterSpecial (1, '$world-&gt;SetVariable("eatingYarrow", 0);', 12);
</send>
  </alias>
</aliases>


I did make 0 and 1 into numbers (instead of strings) but also tested as strings, and it worked just as well.