Code: Select all
function bpwleft:integer;
var tt : integer;
begin
  checklag(1000);
  itt := GetToolTipRec(BackPack);
  tt:=StrToInt(itt.items[2].params[3])-StrToInt(itt.items[2].params[2]);
  if debug then AddToSystemJournal('есть '+itt.items[2].params[2]+' всего '+itt.items[2].params[3]+' доступно '+IntToStr(StrToInt(itt.items[2].params[3])-StrToInt(itt.items[2].params[2]))+' round '+inttostr(round(tt/5))+' trunc '+inttostr(trunc(tt/5)));
  Result := tt;
end;но вот в процессе работы получаю ошибку
Exec: [Error] (D:\Games\UO\Stealth\Scripts\PFUO_Client2.sc at 181:3): Out Of Range
в этот момент на бекпаке нет ToolTip т.е. 0 строк.
обойти этот косяк не проблема, уже сделал таким костылем
Code: Select all
  itt := GetToolTipRec(BackPack);
  while (itt.Count=0) do
  begin
    checklag(1000);
    itt := GetToolTipRec(BackPack);
  end;Вызывается обновлением веса в паке, т.е. запустил while true do bpwleft; и таскай в пак/из пака что-то.
Stealth 8.7.8 & UO 7.0.64.3


