При запуске выдает ошибку
Code: Select all
14:01:20:896 [John Smith]: Compiler: [Error] (Gorgets_Bags.sc at 4:1): Identifier expected
Code: Select all
Program color_gorget;
{$Include 'all.inc'}
var
ColorIng,TypeIng : i_rail;
NameIng : in_rail;
i, l : Integer;
Flag1 : Boolean;
k : integer;
TimeStart : TDateTime;
gorget_bag : Cardinal;
const
rmax = 11;
Cnt=$40249D09; //Сундук с сундуками
Container=$403FB121; //Сундук с ингами
Containerb=$403FB10B; //Сундук с багами
Unload=$403FB118; //Куда все кидать
CountIng=100; // Сколько ингов брать
bag=$0E76; //Тип бага
gorget=$1413; //Тип горжетки
type
in_rail = array[1..rmax] of String;
i_rail = array[1..rmax] of Integer;
procedure Ruda_int;
begin
NameIng[1]:='Rusty ';
NameIng[2]:='Old Copper ';
NameIng[3]:='Dull Copper ';
NameIng[4]:='Copper ';
NameIng[5]:='Bronze ';
NameIng[6]:='Silver ';
NameIng[7]:='Shadow ';
NameIng[8]:='Agapite ';
NameIng[9]:='Rose ';
NameIng[10]:='Blood Rock ';
NameIng[11]:='Verite ';
ColorIng[1]:=$0750;
ColorIng[2]:=$0590;
ColorIng[3]:=$060A;
ColorIng[4]:=$FFFF;
ColorIng[5]:=$0488;
ColorIng[6]:=$0000;
ColorIng[7]:=$096B;
ColorIng[8]:=$0193;
ColorIng[9]:=$0014;
ColorIng[10]:=$04C2;
ColorIng[11]:=$07D5;
TypeIng[1]:=$1BEF;
TypeIng[2]:=$1BEF;
TypeIng[3]:=$1BEF;
TypeIng[4]:=$1BE3;
TypeIng[5]:=$1BEF;
TypeIng[6]:=$1BF5;
TypeIng[7]:=$1BEF;
TypeIng[8]:=$1BEF;
TypeIng[9]:=$1BEF;
TypeIng[10]:=$1BEF;
TypeIng[11]:=$1BEF;
AddToSystemJournal('Загружена руда');
end;
procedure Check_gorget;
begin
FindType(gorget,Backpack);
if FindCount>0 then
begin
while FindCount <> 0 do
begin
l:=l+1;
MoveItem(FindItem,1,gorget_bag,0,0,0);
wait(500);
FindType(gorget,Backpack);
end;
end;
end;
procedure Get_Bag;
begin
FindType(Bag,Backpack);
if FindCount=0 then
begin
UseObject(cnt);
wait(500);
UseObject(Containerb);
wait(1000);
FindType(Bag,Containerb);
if FindCount>0 then
begin
MoveItem(FindItem,1,Backpack,0,0,0);
wait(1000);
UseObject(FindItem);
wait(1000);
end
end
gorget_bag:=FindType(Bag,Backpack);
end;
procedure Check_Last_Bag;
begin
FindType(Bag,Backpack);
if FindCount>0 then
begin
UseObject(FindItem);
wait(500)
gorget_bag:=FindType(Bag,Backpack);
FindType(gorget,gorget_bag);
l:=FindCount;
AddToSystemJournal('В мешке '+IntToStr(l)+' gorgets.');
end
end;
procedure Out_Bag;
begin
UseObject(Cnt);
wait(500);
FindType(Bag,Backpack);
if FindCount>0 then
begin
MoveItem(FindItem,1,Unload,0,0,0);
wait(1000)
end
end;
procedure Checkrd(TypeIngs,ColorIngs: Integer; NameIngs : String);
begin
FindTypeEx(TypeIngs,ColorIngs,Backpack,False);
if (FindCount=0) OR (GetQuantity(FindItem)<10) then
begin
AddToSystemJournal('Добираем инги.')
UseObject(cnt);
wait(500);
UseObject(Container);
wait(1000);
FindTypeEx(TypeIngs,ColorIngs,Container,False);
if (FindCount>0) and (GetQuantity(FindItem)>10) then
begin
MoveItem(FindItem,CountIng,Backpack,0,0,0);
wait(1000);
AddToSystemJournal('Добрали '+IntToStr(CountIng)+' '+NameIngs+'. На данный момент имеем '+IntToStr(CountEx(TypeIngs,ColorIngs,backpack))+' штук. Осталось ещё '+IntToStr(CountEx(TypeIngs,ColorIngs,Container))+' '+NameIngs+'. l='+IntToStr(l));
exit;
end;
FindType(TypeIngs,Backpack);
if FindCount > 0 then
begin
MoveItem(FindItem,0,Container,0,0,0);
end;
AddToSystemJournal('Закончилась руда: '+NameIngs);
Flag1 := false;
exit;
end;
FindType(TypeIngs,Ground);
if FindCount>0 then
begin
MoveItem(FindItem,0,Container,0,0,0);
wait(500);
end
end;
Begin
Ruda_int;
for i:= 1 to 12 do
begin
AddToSystemJournal(IntToStr(i)+' руда '+NameIng[i]);
UseObject(cnt);
wait(1000);
UseObject(Container);
wait(1000);
FindTypeEx(TypeIng[i],ColorIng[i],Container,false);
if (FindCount > 0) AND (CountEx(TypeIng[i],ColorIng[i],Container) > 10) then
begin
CancelMenu;
begin
AutoMenu('Blacksmithing','Colored');
AutoMenu('Colored',NameIng[i]+'Armor');
AutoMenu(NameIng[i]+'Armor',NameIng[i]+'Plate Armor');
AutoMenu(NameIng[i]+'Plate Armor',NameIng[i]+'Plate Gorget');
end;
AddToSystemJournal('Делаем gorget из: '+NameIng[i]);
Flag1 := true;
repeat
Check_Last_Bag;
Get_bag;
if(CountEx(TypeIng[i],ColorIng[i],backpack)<10) then
begin
Checkrd(TypeIng[i],ColorIng[i],NameIng[i]);
end;
checksave;
TimeStart:=Now;
k:=0;
if Flag1 = true then
begin
UseObject(FindTypeEx(TypeIng[i],ColorIng[i],backpack,false));
repeat
wait(500);
k := k + 1;
checksave;
until (InJournalBetweenTimes('You put|failed', TimeStart, Now)<>-1) or (k > 50);
wait(200);
if InJournalBetweenTimes('You put', TimeStart, Now)<>-1 then
begin
Check_gorget;
end;
if l=255 then
begin
l:=0;
Out_Bag;
end;
end;
until Flag1 = false;
wait(3000);
end;
end;
End.