Code: Select all
program forge;
const
containerOreID = $4018D2CE; // Контейнер для руды.
containerIngotID = $403FADD4; // Контейнер для ингов.
moveCount = 0; // Колво для перетаскивания. 0 - автоопределение максимального веса.
type toreinfo = record
name: string;
oreColor: word;
ingotColor: word;
ingotType: word;
forge: integer;
end;
var
oreInfo: array of toreinfo;
oreType: array of word;
i, q, c, mc, count: integer;
begin
setlength(oreInfo, 30);
oreInfo[0].forge := 1; // Iron
oreInfo[1].forge := 0; // Rusty
oreInfo[2].forge := 0; // Old Copper
oreInfo[3].forge := 0; // Dull Copper
oreInfo[4].forge := 0; // Copper
oreInfo[5].forge := 0; // Bronze
oreInfo[6].forge := 0; // Silver
oreInfo[7].forge := 0; // Gold
oreInfo[8].forge := 0; // Shadow
oreInfo[9].forge := 0; // Rose
oreInfo[10].forge := 0; // Agapite
oreInfo[11].forge := 0; // Blood rock
oreInfo[12].forge := 0; // Verite
oreInfo[13].forge := 0; // Valorite
oreInfo[14].forge := 0; // Mitheril
oreInfo[15].forge := 0; // Black Rock
oreInfo[16].forge := 0; // Obsidian
oreInfo[17].forge := 0; // Plutonium
////////////
oreInfo[18].forge := 0; // Dragon
oreInfo[19].forge := 0; // Crystaline
oreInfo[20].forge := 0; // Krynite
oreInfo[21].forge := 0; // Vulcan
oreInfo[22].forge := 0; // Sand Rock
oreInfo[23].forge := 0; // Blood Crest
oreInfo[24].forge := 0; // Steel
oreInfo[25].forge := 0; // Elvin
oreInfo[26].forge := 0; // Gorgan
oreInfo[27].forge := 0; // Acid
oreInfo[28].forge := 0; // Aqua
oreInfo[29].forge := 0; // Eldar
if moveCount = 0 then
mc := str*4+30-weight-1
else if moveCount+weight >= str*4+30 then begin
addtosystemjournal('Я не подниму такое количество :\');
exit;
end else
mc := moveCount;
oreInfo[0].name := 'Iron';
oreInfo[0].oreColor := $0000;
oreInfo[0].ingotColor := $0000;
oreInfo[0].ingotType := $1BEF;
////////////
oreInfo[1].name := 'Rusty';
oreInfo[1].oreColor := $0750;
oreInfo[1].ingotColor := $0750;
oreInfo[1].ingotType := $1BEF;
////////////
oreInfo[2].name := 'Old Copper';
oreInfo[2].oreColor := $0590;
oreInfo[2].ingotColor := $0590;
oreInfo[2].ingotType := $1BEF;
////////////
oreInfo[3].name := 'Dull Copper';
oreInfo[3].oreColor := $060A;
oreInfo[3].ingotColor := $060A;
oreInfo[3].ingotType := $1BEF;
////////////
oreInfo[4].name := 'Copper';
oreInfo[4].oreColor := $0088;
oreInfo[4].ingotColor := $0000;
oreInfo[4].ingotType := $1BE3;
////////////
oreInfo[5].name := 'Bronze';
oreInfo[5].oreColor := $0488;
oreInfo[5].ingotColor := $0488;
oreInfo[5].ingotType := $1BEF;
////////////
oreInfo[6].name := 'Silver';
oreInfo[6].oreColor := $0482;
oreInfo[6].ingotColor := $0000;
oreInfo[6].ingotType := $1BF5;
////////////
oreInfo[7].name := 'Gold';
oreInfo[7].oreColor := $0032;
oreInfo[7].ingotColor := $0000;
oreInfo[7].ingotType := $1BE9;
////////////
oreInfo[8].name := 'Shadow';
oreInfo[8].oreColor := $096B;
oreInfo[8].ingotColor := $096B;
oreInfo[8].ingotType := $1BEF;
////////////
oreInfo[9].name := 'Rose';
oreInfo[9].oreColor := $0014;
oreInfo[9].ingotColor := $0014;
oreInfo[9].ingotType := $1BEF;
////////////
oreInfo[10].name := 'Agapite';
oreInfo[10].oreColor := $0193;
oreInfo[10].ingotColor := $0193;
oreInfo[10].ingotType := $1BEF;
////////////
oreInfo[11].name := 'Blood rock';
oreInfo[11].oreColor := $04C2;
oreInfo[11].ingotColor := $04C2;
oreInfo[11].ingotType := $1BEF;
////////////
oreInfo[12].name := 'Verite';
oreInfo[12].oreColor := $07D5;
oreInfo[12].ingotColor := $07D5;
oreInfo[12].ingotType := $1BEF;
////////////
oreInfo[13].name := 'Valorite';
oreInfo[13].oreColor := $00CE;
oreInfo[13].ingotColor := $00CE;
oreInfo[13].ingotType := $1BEF;
////////////
oreInfo[14].name := 'Mitheril';
oreInfo[14].oreColor := $052D;
oreInfo[14].ingotColor := $052D;
oreInfo[14].ingotType := $1BEF;
////////////
oreInfo[15].name := 'Black Rock';
oreInfo[15].oreColor := $0455;
oreInfo[15].ingotColor := $0455;
oreInfo[15].ingotType := $1BEF;
////////////
oreInfo[16].name := 'Obsidian';
oreInfo[16].oreColor := $0028;
oreInfo[16].ingotColor := $0028;
oreInfo[16].ingotType := $1BEF;
////////////
oreInfo[17].name := 'Plutonium';
oreInfo[17].oreColor := $08AF;
oreInfo[17].ingotColor := $08AF;
oreInfo[17].ingotType := $1BEF;
////////////
oreInfo[18].name := 'Dragon';
oreInfo[18].oreColor := $0085;
oreInfo[18].ingotColor := $0085;
oreInfo[18].ingotType := $1BEF;
////////////
oreInfo[19].name := 'Crystaline';
oreInfo[19].oreColor := $09A4;
oreInfo[19].ingotColor := $09A4;
oreInfo[19].ingotType := $1BEF;
////////////
oreInfo[20].name := 'Krynite';
oreInfo[20].oreColor := $010F;
oreInfo[20].ingotColor := $010F;
oreInfo[20].ingotType := $1BEF;
////////////
oreInfo[21].name := 'Vulcan';
oreInfo[21].oreColor := $09DA;
oreInfo[21].ingotColor := $09DA;
oreInfo[21].ingotType := $1BEF;
////////////
oreInfo[22].name := 'Sand Rock';
oreInfo[22].oreColor := $008F;
oreInfo[22].ingotColor := $008F;
oreInfo[22].ingotType := $1BEF;
////////////
oreInfo[23].name := 'Blood Crest';
oreInfo[23].oreColor := $09EC;
oreInfo[23].ingotColor := $09EC;
oreInfo[23].ingotType := $1BEF;
////////////
oreInfo[24].name := 'Steel';
oreInfo[24].oreColor := $09D3;
oreInfo[24].ingotColor := $09D3;
oreInfo[24].ingotType := $1BEF;
////////////
oreInfo[25].name := 'Elvin';
oreInfo[25].oreColor := $09E6;
oreInfo[25].ingotColor := $09E6;
oreInfo[25].ingotType := $1BEF;
////////////
oreInfo[26].name := 'Gorgan';
oreInfo[26].oreColor := $09F0;
oreInfo[26].ingotColor := $09F0;
oreInfo[26].ingotType := $1BEF;
////////////
oreInfo[27].name := 'Acid';
oreInfo[27].oreColor := $09B9;
oreInfo[27].ingotColor := $09B9;
oreInfo[27].ingotType := $1BEF;
////////////
oreInfo[28].name := 'Aqua';
oreInfo[28].oreColor := $0060;
oreInfo[28].ingotColor := $0060;
oreInfo[28].ingotType := $1BEF;
////////////
oreInfo[29].name := 'Eldar';
oreInfo[29].oreColor := $0BA7;
oreInfo[29].ingotColor := $0BA7;
oreInfo[29].ingotType := $1BEF;
setlength(oreType, 4);
oreType[0] := $19B7; //Руда 1шт.
oreType[1] := $19BA; //Руда 2шт.
oreType[2] := $19B8; //Руда 3шт.
oreType[3] := $19B9; //Руда 4шт.
useobject(containerOreID);
checklag(10000);
wait(300);
useobject(containerIngotID);
checklag(10000);
wait(300);
useobject(backpack);
checklag(10000);
wait(300);
for i := 0 to high(oreInfo) do begin
if oreInfo[i].forge = 0 then
continue;
count := 0;
for q := 0 to high(oreType) do begin
while findtypeex(oreType[q], oreInfo[i].oreColor, containerOreID, false) > 0 do begin
moveitem(finditem, mc, backpack, 0, 0, 0);
checklag(10000);
wait(500);
while findtypeex(oreType[q], oreInfo[i].oreColor, backpack, false) > 0 do begin
useobject(finditem);
checklag(10000);
wait(300);
end;
c := 0;
while findtypeex(oreInfo[i].ingotType, oreInfo[i].ingotColor, backpack, false) > 0 do begin
moveitem(finditem, 0, containerIngotID, 0, 0, 0);
checklag(10000);
wait(500);
c := findquantity;
end;
count := count + c;
end;
end;
if count > 0 then
addtosystemjournal('Переплавил ' + inttostr(count) + ' ' + oreInfo[i].name + '.');
end;
end.