神武新章加工天工完整版脚本
unit 加工天工;
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 OnHear (aStr : String);
var
duanshu : Integer = 9;
rCount : Integer = 8;
ts : Integer = 5;
sdcgl : String = '0级9500_1级8400_2级7300_3级6200_4级5000_5级3600_6级1600_7级880_';
sdcgl1 : String = '8级500';
jcgl : String = '血石:400/宝石碎片:600/五彩神石:1200';
jcglsm : Integer = 2;
implementation
procedure OnLeftClick (aStr : String);
begin
print ('sendsenderchatmessage 命令:加工+空格+装备名+空格+级数+辅助品 2');
print ('sendsenderchatmessage 没有辅助品可以不填,每次限1个辅助品 2');
print ('sendsenderchatmessage 如:加工_男子黄龙弓服_0级五彩神石 2');
exit;
end;
procedure OnHear (aStr : String);
var
Str, Name, shumu, zbmz, rdStr, xStr, yStr, jishu : String;
fuzhu : String = 'a';
iCount, iKind, cgl : Integer;
i : Integer = 0;
begin
Str := callfunc ('getsenderrace');
if Str <> '1' then exit;
Name := callfunc ('getsendername');
sdcgl := sdcgl + sdcgl1;
rdStr := GetToken (aStr, xStr, '_');
if xStr = '加工' then begin
xStr := GetToken (rdStr, zbmz, '_');
yStr := GetToken (xStr, jishu, '级');
Str := GetToken (rdStr, xStr, jishu);
Str := GetToken (Str, xStr, yStr);
if yStr <> '' then begin
fuzhu := yStr;
i := 1;
end;
if xStr <> '级' then begin
print ('say 格式错误!如:加工_男子黄龙弓服_0级');
exit;
end;
iCount := StrtoInt(jishu);
xStr := jishu + '级';
rdStr := GetToken (sdcgl, yStr, xStr);
if rdStr = '' then begin
print ('say 输入的级数不正确');
exit;
end;
yStr := GetToken (rdStr, xStr, '_');
cgl := StrtoInt(xStr);
if i = 1 then begin
yStr := fuzhu + ':';
rdStr := GetToken (jcgl, xStr, yStr);
if rdStr = '' then begin
print ('say 没有此种辅助物品');
exit;
end;
yStr := GetToken (rdStr, xStr, '/');
iKind := StrtoInt(xStr);
cgl := cgl + iKind;
end;
iCount := iCount + 1;
xStr := IntToStr(iCount);
iKind := iCount * rCount;
shumu := IntToStr(iKind);
Str := 'getsenderitemexistence ' + zbmz;
Str := Str + jishu;
Str := Str + '级:1';
Str := callfunc (Str);
if Str = 'false' then begin
Str := 'say 你没有' + zbmz;
Str := Str + '可以升';
print (Str);
exit;
end;
Str := 'getsenderitemexistence 火龙石:' + shumu;
Str := callfunc (Str);
if Str = 'false' then begin
Str := 'say 需要';
Str := Str + shumu;
Str := Str + '个火龙石,我才能帮你升';
print (Str);
exit;
end;
Str := callfunc ('getsenderitemexistence 金元:1');
if Str = 'false' then begin
print ('say 每次升级需要1个金元的手续费');
exit;
end;
Str := 'getsenderitem ' + zbmz;
Str := Str + jishu;
Str := Str + '级:1';
print (Str);
Str := 'getsenderitem 火龙石:' + shumu;
print (Str);
print ('getsenderitem 金元:1');
if fuzhu <> '' then begin
Str := 'getsenderitem ' + fuzhu;
Str := Str + ':1';
print (Str);
end;
iKind := Random (10000);
if iKind > cgl then begin
print ('sendsenderchatmessage 加工失败了_请不要气馁 2');
if iCount > ts then begin
Str := 'sendsendertopmsg ' + name;
Str := Str + ',加工【';
Str := Str + zbmz;
Str := Str + '】第';
Str := Str + jishu;
Str := Str + '级失败';
print (Str);
end;
exit;
end;
if iCount > ts then begin
Str := 'sendsendertopmsg ' + name;
Str := Str + ',加工【';
Str := Str + zbmz;
Str := Str + '】第';
Str := Str + jishu;
Str := Str + '级成功';
print (Str);
end;
Str := 'putsendermagicitem ' + zbmz;
Str := Str + xStr;
Str := Str + '级:1 @加工天工 4';
print (Str);
print ('sendsenderchatmessage 恭喜你加工成功 2');
exit;
end;
end;
procedure OnTimer (aStr : String);
var
Str, xStr, yStr : String;
t, i : Integer;
begin
t := t + 1;
if t= 15 then begin
print ('say 输入加工+空格+装备级数前的名字+空格+级数+辅助品 50');
print ('say 可以加工装备,如:加工_黄龙斧_8级宝石碎片 200');
exit;
end;
if t= 30 then begin
Str := InttoStr(duanshu);
Str := 'say 目前所有装备的最高级为' + Str;
Str := Str + '级';
print (Str);
exit;
end;
if t= 45 then begin
Str := 'say 辅助品有';
yStr := GetToken (jcgl, xStr, ':');
Str := Str + xStr;
Str := Str + ',';
for i:=1 to jcglsm do
begin
yStr := GetToken (yStr, xStr, '/');
yStr := GetToken (yStr, xStr, ':');
Str := Str + xStr;
Str := Str + ',';
end;
print (Str);
t := 0;
exit;
end;
end;
end.
商业版发布站程序下载:发布站程序下载: