#nop This script is written for v1.99.7 and higher
#var record_time 0
#alias {record}
{
#if {$record_time == 0}
{
#if {"%0" == ""}
{
#showme <118>Please provide a variable name to store the record.;
}
#format record_name %0;
#format record_time %U;
#format $record_name %s;
#format record_cnt 0;
#alias {%%0}
{
#send %%0;
#format record_curr %U;
#math record_diff ($record_curr - $record_time) / 1000000.00;
#list $record_name ins -1 #delay $record_diff %%0;
#math record_cnt $record_cnt + 1;
}
{9};
#showme <118>You are now recording your MUD commands.
};
#else
{
#format record_curr %U;
#math record_diff ($record_curr - $record_time) / 1000000.00;
#list {$record_name} {ins} {1}
{
#showme <118>Playing back '$record_name' having $record_cnt commands and a duration of $record_diff seconds.;
}
#showme <118>You have recorded $record_cnt commands during $record_diff seconds to $record_name.;
#format record_time 0;
#unalias %%0;
}
}
#alias playback
{
#if {"%0" == ""}
{
#showme <118>Please provide a record variable to play back.
};
#elseif {&{%0} == 0}
{
#showme <118>There is no record for $%0.
};
#else
{
#foreach {$%0} {temp}
{
$temp
}
}
}
#alias playstop
{
#showme <118>Stopping playback.
#kill delays
}
|