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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Perlscript
. . -> [Subject]  DoAfterSpecial

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

DoAfterSpecial

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Solaras   (4 posts)  [Biography] bio
Date Mon 13 Jun 2005 03:25 PM (UTC)  quote  ]
Message
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);

[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #1 on Mon 13 Jun 2005 05:47 PM (UTC)  quote  ]
Message
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.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[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.


1,439 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]