|
楼主 |
发表于 2010-1-21 13:51:40
|
显示全部楼层
发一个练功机器人
用法:载入插件后打:/lian6::help
后面有新的,效率更高,别用这个了。
文件:lian.pl
package lian6;
#: Version: 1.0
#: Description: A multi skills practise Plugin
#: Author: Fu Huizhong
BEGIN {
$::world->requireplugin('hp1');
}
our $flag1=0;
our $skill="cuff";
our $times = 25;
our $sleepn = 0;
sub set{
if(@_!=2){
$::world->echo("Usage:/lian6::set(skill,times)\n");
return;
}
$skill = $_[0];
$times = $_[1];
$::world->echo("lian skill $skill for $times");
$::world->echo("\n");
}
sub mymotions{
$::world->send("hp","lian $skill $times");
$sleepn = 0;
}
sub mydazuo{
my $dzn = $times*10;
$::world->send("dazuo $dzn");
}
sub mysleep{
$flag1=0;
if($sleepn<3){
$::world->send("sleep");
$sleepn += 1;
}else{
mymotions;
}
}
sub recover{
if($::hp1::nl1>$times*20){
$::world->send("exert recover");
}else{
mymotions;
}
}
sub start{
my $ret=$::world->triggerenabled('lian');
if( defined($ret) ){
$::world->deltrigger('lian');
}
::hp1::start;
$::world->trigger("你.*练习.*,获得了.*进步!","/lian6::recover",{name=>"lian"});
$::world->trigger('你深深吸了几口气,脸色看起来好多了','/$world->timer({interval=>1,count =>1,temporary=>1,action=>"/lian6::mymotions"})',{name=>"lian"});
$::world->trigger('你现在气力充沛。','/$world->timer({interval=>1,count =>1,temporary=>1,action=>"/lian6::mymotions"})',{name=>"lian"});
$::world->trigger("你的内力不够练.*。","/lian6::mydazuo",{name=>"lian"});
$::world->trigger("你.*,深深吸了口气,站了起来。",'/$world->timer({interval=>1,count =>1,temporary=>1,action=>"/lian6::mymotions"})',{name=>"lian"});
$::world->trigger('你的内力不够。','/lian6::mydazuo',{name=>'lian'});
$::world->trigger("你现在的气太少了,无法产生内息运行全身经脉。",'/lian6::mysleep',{name=>"lian"});
$::world->trigger("你的体力太低了。",'/lian6::mysleep',{name=>"lian"});
$::world->trigger("你的体力不够练.*",'/lian6::mysleep',{name=>"lian"});
$::world->trigger("你的体力太差了,不能练.*。",'/lian6::mysleep',{name=>"lian"});
$::world->trigger('你一觉醒来,精神抖擞地活动了几下手脚。','eat liang;drink jiudai;/lian6::mymotions',{name=>'lian'});
$::world->trigger('你刚在三分钟内睡过一觉, 多睡对身体有害无益! ',
'/$world->timer({interval=>24,count =>1,temporary=>1,action=>"/lian6::mymotions"})',{name=>'lian'});
mymotions;
}
sub stop{
$::world->deltrigger('lian');
}
sub UNLOAD {
$::world->deltrigger('lian');
}
sub help {
$::world->echonl("Usage in fadai room:",
"1. /lian6::set(skill,times)",
"2. /lian6::start",
"3. /lian6::stop");
}
[ 本帖最后由 rockbt 于 2010-3-1 10:09 AM 编辑 ] |
|