【tintin++】命令过滤器,防止一次性输入过多的命令被雷劈
从mush的lua脚本移植过来的功能跟mush里面run函数差不多意思,就不过多注释了。
#fun {run} {
#unv strs;
#v strs {%0};
#v _cmd {};
#v _tb {};
#class cmdcount open;
#ticker cmdcount {cmdcount} {0.1};
#class cmdcount close;
#if {"$strs"==""} {
#if {&allcmd[]>0} {
#if {$isopen_gps_start && "$allcmd"!="halt" && !@tonumber{$isopen_kill}} {
#nop --走路间隙插入halt,减少被自动攻击的NPC拦住几率;
#nop table.insert(allcmd,"halt") ;
#list allcmd ins +1 {halt};
};
};
#else {
#return #nop all cmd is finished;
};
};
#if {"$strs"!="" && "$strs"!=" "} {
#if {&allcmd[]==0} {
#list allcmd cre {$strs};
};
#else {
#list allcmd add $strs;
};
};
#if {&{allcmd}==0 || &allcmd[]<1} {#return #nop ;};
#if {$cmd>=$cmd && &allcmd[]>0} {
#delay {0.7} {@run{ }};
#return #nop ;
};
#while {$cmd<=$cmd && &allcmd[]>0} {
#v _cmd $allcmd;
#list allcmd del +1;
#if {&{_cmd}==0 || "$_cmd"==""} {#break};
#v _t $_cmd;
#replace _t {-} {};
#if &{aliasStepNum[$_t]} {
alias_${_t};
#math cmd {$cmd+$aliasStepNum[$_t]};
};
#else {
$_cmd;
#math cmd {$cmd+1};
};
};
@run{};
#return #nop ;
};
北大侠客行MUD,中国最好的MUD chat* bud zhouyi
chat* mobai
本萌新只能敬仰,完全看不懂yct43.
页:
[1]