Code: Select all
function GetBod(Shop: String; Debug: String):Integer;
var
list2 : TStringList;
UserList : TStringList;
i : integer;
x : integer;
text : String;
begin
ClearShopList;
ClearContextMenu;
FindDistance:= 3;
FindVertical:= 3;
list2 := TStringList.Create;
FindType($0190,Ground);
wait(100);
UserList := TStringList.Create;
GetFindedList(UserList);
for i:= 0 to UserList.count -1 do
begin
text := GetTooltip(StrToInt('$'+UserList[i]));
if Debug = 'True' then
begin
FillNewWindow('Chars around: ' + text+ ' $' + UserList[i]);
end;
if (pos(Shop, text)>0) and (pos('guildmaster', text)=0) then
begin
if Debug = 'True' then
begin
FillNewWindow('My Shop found at: ' + InttoStr(i));
end;
ClearContextMenu;
RequestContextMenu(StrtoInt('$'+UserList[i]));
wait(1000);
GetContextMenu(list2);
for x:= 0 to list2.count-1 do
begin
if Debug = 'True' then
begin
FillNewWindow('Shops ContextMenue: ' + list2[x]);
end;
if (pos('Bulk Order Info', list2[x])>0) then
begin
if Debug = 'True' then
begin
FillNewWindow('Shops ContextMenue entry at: ' + InttoStr(x));
end;
SetContextMenuHook(StrToInt('$'+UserList[i]), x);
wait(1000);
end;
ClearShopList;
end;
ClearContextMenu;
end;
end;
UserList.free;
list2.free;
Result := 1;
end;
can you explain me?