В игре откройте любую Bulk Order Book и запустите это скрипт.
В журнал стелса будет выведено содержание текущей страницы Bulk Order Book. Конкретно -содержание бодов, маленьких и больших.
Ну и как всегда большое спасибо Vizit0r за помощь в выполнении основного скрипта.
скрипт выводит информацию типа:
Small bone arms exceptional Leather 0 / 10
Small shoes exceptional Leather 0 / 20
Small thigh boots exceptional Leather 0 / 20
--------------------------------------
Large 4
skullcap exceptional Cloth 0 / 20
doublet exceptional Cloth 0 / 20
kilt exceptional Cloth 0 / 20
shoes exceptional Leather 0 / 20
--------------------------------------
Small bone leggings exceptional Leather 0 / 10
А что можно делать с этим дальше напишу позже.
Code: Select all
Program Gump;
const LineHeightConst = 32;
//
type TBod = record
BodType : String;
DropButton_Return_Value :Integer;
Item : String;
Quality : String;
Material : String;
Amount : String;
Price : String;
end;
type TLargeBod = record
BodsCount : integer;
Bods : array of TBod;
end;
TBookElem = record
BodType : integer;
SmallBod : TBod;
LargeBod : TLargeBod;
end;
TBodBook = array of TBookElem;
var
i,k,j,m : Integer;
GI: TGumpInfo;
CurrLineY : Word;
LargeBod : TLargeBod;
Bod : TBod;
BodBook : TBodBook;
FoundElem : Boolean ;
ClilocG : String;
procedure bodliker;
begin
FoundElem:= False;
if (GetGumpsCount = 0) or (GetGumpID(GetGumpsCount-1) <> $29C) then
Exit;
GetGumpInfo(GetGumpsCount-1,GI);
if Length(GI.XmfHTMLGumpColor) > 0 then
for I := 0 to Length(GI.XmfHTMLGumpColor) - 1 do
begin
ClilocG:=GetClilocById(GI.XmfHTMLGumpColor[i].Cliloc_id);
if ClilocG = 'Drop' then //caption line
begin //title String. Incr it's Y to LineHeightConst and take 1st line
CurrLineY := GI.XmfHTMLGumpColor[i].y + LineHeightConst; //1st line
Break;
end;
end;
if CurrLineY = 0 then
Exit;
while True do
begin
Bod.DropButton_Return_Value := $FFFF;
for k := 0 to Length(GI.GumpButtons) - 1 do
for j:=0 to 35 do
if (GI.GumpButtons[k].y - 2 = CurrLineY) and (GI.GumpButtons[k].x =j ) then
begin
Bod.DropButton_Return_Value := GI.GumpButtons[k].return_value;
Break;
end;
FoundElem := False;
for k := 0 to Length(GI.XmfHTMLGumpColor) - 1 do
if GI.XmfHTMLGumpColor[k].y = CurrLineY then
begin
FoundElem := True;
case GI.XmfHTMLGumpColor[k].x of
40..65 : Bod.BodType := GetClilocByID(GI.XmfHTMLGumpColor[k].Cliloc_id);
66..105 : Bod.Item := GetClilocByID(GI.XmfHTMLGumpColor[k].Cliloc_id);
106..240: Bod.Quality := GetClilocByID(GI.XmfHTMLGumpColor[k].Cliloc_id);
241..320: Bod.Material := GetClilocByID(GI.XmfHTMLGumpColor[k].Cliloc_id);
else
FoundElem := False;
end;
if (LowerCase(GetClilocByID(GI.XmfHTMLGumpColor[k].Cliloc_id)) = 'previous page')
or (LowerCase(GetClilocByID(GI.XmfHTMLGumpColor[k].Cliloc_id)) = 'next page') then
FoundElem := False;
end;
if not FoundElem and (Bod.DropButton_Return_Value = $FFFF) then
Break; //Last Line, Exit;
for k := 0 to Length(GI.GumpText) - 1 do
if GI.GumpText[k].y = CurrLineY then
case GI.GumpText[k].x of
320..425 : Bod.Amount := GI.Text[GI.GumpText[k].text_id];
426..500 : Bod.Price := GI.Text[GI.GumpText[k].text_id];
end;
if Bod.BodType = 'Small' then
begin
if Length(LargeBod.Bods) > 0 then //Large Bod finished, adding it to Book
begin
SetLength(BodBook,Length(BodBook) +1 );
BodBook[Length(BodBook)-1].BodType := 1;
BodBook[Length(BodBook)-1].LargeBod := LargeBod;
SetLength(LargeBod.Bods,0);
LargeBod.BodsCount := 0;
end;
SetLength(BodBook,Length(BodBook) +1 );
BodBook[Length(BodBook)-1].BodType := 0;
BodBook[Length(BodBook)-1].SmallBod := Bod;
end
else
begin
if (Length(LargeBod.Bods) > 0) and (Bod.DropButton_Return_Value < $FFFF) then //Large Bod finished, adding it to Book
begin
SetLength(BodBook,Length(BodBook) +1 );
BodBook[Length(BodBook)-1].BodType := 1;
BodBook[Length(BodBook)-1].LargeBod := LargeBod;
SetLength(LargeBod.Bods,0);
LargeBod.BodsCount := 0;
end;
Inc(LargeBod.BodsCount);
SetLength(LargeBod.Bods,Length(LargeBod.Bods) +1 );
LargeBod.Bods[Length(LargeBod.Bods) - 1] := Bod;
end;
CurrLineY:=CurrLineY+ LineHeightConst;
end;
if (Length(LargeBod.Bods) > 0) then //Large Bod finished, adding it to Book
begin
SetLength(BodBook,Length(BodBook) +1 );
BodBook[Length(BodBook)-1].BodType := 1;
BodBook[Length(BodBook)-1].LargeBod := LargeBod;
end;
end;
begin
bodliker;
if Length(BodBook)>10 then m:=10 else
m:= Length(BodBook);
for j:= 0 to m-1 do
begin
if BodBook[j].BodType=0 then
AddToSystemJournal(BodBook[j].SmallBod.BodType+' '+BodBook[j].SmallBod.Item+' '+
BodBook[j].SmallBod.Quality+' '+ BodBook[j].SmallBod.Material+' '+BodBook[j].SmallBod.Amount);
if BodBook[j].BodType>0 then
begin
AddToSystemJournal('--------------------------------------');
AddToSystemJournal(BodBook[j].LargeBod.Bods[0].BodType+' '+inttostr(Length(BodBook[j].LargeBod.Bods)));
for i:=0 to Length(BodBook[j].LargeBod.Bods)-1 do
begin
AddToSystemJournal(BodBook[j].LargeBod.Bods[i].Item+' '+
BodBook[j].LargeBod.Bods[i].Quality+' '+
BodBook[j].LargeBod.Bods[i].Material+' '+
BodBook[j].LargeBod.Bods[i].Amount);
end;
AddToSystemJournal('--------------------------------------');
end;
end;
end.