- Klavius http://www.klavius.pun.pl/index.php - Skrypty http://www.klavius.pun.pl/viewforum.php?id=1 - Item na godzinę http://www.klavius.pun.pl/viewtopic.php?id=20 |
rafek1241 - 2008-11-21 18:07:41 |
Przydatny skrypt: Kod:const ItemName = 'Small Stones'; //The name of the item you want to count; can be anything but best put the actual item name in plural form ItemNumber = 1781; //ItemID of the item to count var seconds, min, mini, hours, count, item, AverageItem, total: integer; hourText,minText,secText: string; function CountItemAmountFromOpenBackpack(ID: integer): integer; var x: integer; y: integer; begin Result := 0; for x := 0 to Self.Containers.Count - 1 do begin if x >= Self.Containers.Count then Break; for y := 0 to Self.Containers.Container[x].Count - 1 do begin if y >= Self.Containers.Container[x].Count then Break; if Self.Containers.Container[x].Item[y].ID = ID then begin Result := Result + Self.Containers.Container[x].Item[y].Amount; end; end; end; end; begin UpdateWorld; AverageItem := 0; item := CountItemAmountFromOpenBackpack(ItemNumber); count := 0; seconds := 0; min := 0; hours := 0; while not terminated do begin sleep(1000); UpdateWorld; count := count+1; Seconds := count mod 60; if count>=60 then min := count div 60; mini := min mod 60; if min>=60 then Hours := min div 60; total := (CountItemAmountFromOpenBackpack(ItemNumber)-Item); AverageItem := total/count*60*60; HourText := IntToStr(Hours); MinsText := IntToStr(mini); SecText := IntToStr(seconds); if Length(HourText) = 1 then HourText := '0' + HourText; if Length(MinsText) = 1 then MinsText := '0' + MinsText; if Length(SecText) = 1 then SecText := '0' + SecText; self.displayText('Running for '+HourText+':'+MinsText+':'+SecText+' | '+ItemName+' collected: '+inttostr(total)+' | '+ItemName+' average/h: '+inttostr(AverageItem)+'.'); ProcessEvents; end; end; Musicie tylko ustawić jakie itemki i macie taki wynik: Kod:ItemName = 'Small Stones'; //The name of the item you want to count; can be anything but best put the actual item name in plural form ItemNumber = 1781; //ItemID of the item to count Ustawiamy NAZWA i ID itemka ;D |