Code: Select all
Program Inscription;
const
container = $400FF7C7; // Конт с регами.
container2 = $4033FFCA; // Конт для скроллов
bscrollstype = $0E34;
scrollstype = $1F38;
regscount = 100;
type tregs = record
regtype: word;
need: boolean;
end;
var
q: integer;
w: integer;
i: integer;
t: tdatetime;
regs: array [1..8] of tregs;
msgs: array [1..2] of string;
procedure init;
begin
// True - рег нужен для крафта
regs[1].need := false;
regs[2].need := false;
regs[3].need := false;
regs[4].need := false;
regs[5].need := false;
regs[6].need := true;
regs[7].need := false;
regs[8].need := true;
regs[1].regtype := BP;
regs[2].regtype := BM;
regs[3].regtype := GA;
regs[4].regtype := GS;
regs[5].regtype := MR;
regs[6].regtype := NS;
regs[7].regtype := SA;
regs[8].regtype := SS;
msgs[1] := 'You put the ';
msgs[2] := 'You fail to inscribe the scroll, and the scroll is ruined.';
automenu('Spell Circle 2', 'Harm'); // Какой закл в меню.
automenu('Spell Circles', 'Second Circle'); // Какой круг в меню.
end;
procedure checksave;
begin
if injournalbetweentimes('World is saving now...', now-(1.0/(24*60*2)), now) > -1 then
repeat wait(500); until injournalbetweentimes('World data saved in ', now-(1.0/(24*60*2)), now) > 1;
checklag(5000);
end;
begin
init;
useobject(backpack);
checksave;
wait(500);
while NOT dead do begin
if findtype(bscrollstype, backpack) = 0 then begin
useobject(container);
checksave;
wait(500);
useobject(container2);
checksave;
wait(500);
useobject(backpack);
checksave;
wait(500);
for i := 1 to high(regs) do
if regs[i].need then begin
moveitem(findtype(regs[i].regtype, container), regscount, backpack, 0, 0, 0);
checksave;
wait(500);
end;
moveitem(findtype(bscrollstype, container), regscount, backpack, 0, 0, 0);
checksave;
wait(500);
while findtype(scrollstype, backpack) > 0 do begin
moveitem(finditem, 0, container2, 0, 0, 0);
checksave;
wait(500);
end;
end;
t := now;
usetype(bscrollstype, $0000);
while (injournalbetweentimes(msgs[1]+'|'+msgs[2], t, now) = -1) AND (t+(1.0/(24*60*6)) > now) do begin
checksave;
wait(500);
end;
if injournalbetweentimes(msgs[1], t, now) > -1 then begin q := q+1; addtosystemjournal('Удачных скролов: ' + inttostr(q)); end;
if injournalbetweentimes(msgs[2], t, now) > -1 then begin w := w+1; addtosystemjournal('Физлов: ' + inttostr(w)); end;
end;
end.