检查千年怪物存活数脚本

来源: 作者: 点击:
脚本设置.
先检查是否拥有物品.检查本地图的两种怪物存活数,如果存活数为0再传送....
如果存活数不为0,不传送并说出哪种怪物还剩多少个....
脚本只需要修改红色部分.再加一个help文件 ok
引用:
unit XXXX;

interface

function GetToken (aStr, aToken, aSep : String) : String;
function CompareStr (aStr1, aStr2 : String) : Boolean;
function callfunc (aText: string): string;
procedure print (aText: string);
function Random (aScope: integer): integer;
function Length (aText: string): integer;
procedure Inc (aInt: integer);
procedure Dec (aInt: integer);
function StrToInt (astr: string): integer;
function IntToStr (aInt: integer): string;
procedure exit;

procedure OnLeftClick (aStr : String);
procedure OnGetResult (aStr : String);
var
monstername1 : string = 猪; //第一种怪物名字
monstername2 : string = 牛; //第二种怪物名字
MapNo :string = 106; //这个使用地图的编码
GoMapNo :string = 91; //下一层地图的编码
MapXY :string = 180 222; //进入下一层后的坐标
Item : string = 金元; //进入下一层需要的物品
ItemCount : string = 1; //进入下一层需要物品的数量
Huanying : string = 进入鱿鱼神教; //进入下一层后全服公告的语句 前面是 恭喜 XXX +这个
implementation

procedure OnLeftClick (aStr : String);
var
Str : String;
Race : Integer;
begin
Str := callfunc (getsenderrace);
Race := StrToInt (Str);
if Race = 1 then begin
print (showwindow .help玉仙.txt 1);
exit;
end;
end;
procedure OnGetResult (aStr : String);
var
Str, lStr, kStr, nStr, Name, monno, monno2 : String;
iCount, nCount, iKind : Integer;
begin
if aStr = close then begin
exit;
end;
if aStr = initial then begin
Str := getsenderitemexistence + Item;
Str := Str + :;
Str := Str + ItemCount;
lStr := callfunc(Str);
if lStr = false then begin
Str := say + 需要;
Str := Str + ItemCount;
Str := Str + 个;
Str := Str + Item;
Str := Str + 才能进入!;
print (Str);
exit;
end;
Str := checkalivemopcount + MapNo;
Str := Str + ;
Str := Str + monster;
Str := Str + ;
Str := Str + monstername1;
lStr := callfunc(Str);
iCount := StrToInt (lStr);
nStr := checkalivemopcount + MapNo;
nStr := nStr + ;
nStr := nStr + monster;
nStr := nStr + ;
nStr := nStr + monstername2;
kStr := callfunc(nStr);
nCount := StrToInt (kStr);
if iCount = 0 then begin
if nCount = 0 then begin
Str := getsenderitem + Item;
Str := Str + :;
Str := Str + ItemCount ;
print (Str);
//红色部分没修改过来的记得修改过来,感谢 yanping7520 斑竹提出
Name := callfunc (getsendername);
str := sendsendertopmsg + 恭喜【;
str := str + Name;
str := str + 】;
str := str + Huanying;
print (str);
Str := movespace + Name;
Str := Str + user;
Str := Str + ;
Str := Str + GoMapNo;
Str := Str + ;
Str := Str + MapXY;
print (Str);
exit;
end;
end;
monno:=inttostr(iCount);
monno2:=inttostr(nCount);
print (sendsenderchatmessage 需要清完所有的怪物才能进入下一层 2);
Str := say + 还剩下;
Str := Str + monno;
Str := Str + 个;
Str := Str + monstername1;
Str := Str + _;
Str := Str + monno2;
Str := Str + 个;
Str := Str + monstername2;
Str := Str + 没死!;
print (Str);
exit;
end;

end;
end.
栏目列表