Author Topic: [debug] Statistics  (Read 3920 times)

0 Members and 1 Guest are viewing this topic.

Offline camotbikTopic starter

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
[debug] Statistics
« on: December 09, 2017, 01:40:53 AM »
0
Hello to everyone.

I'm having a problem with creating statistics. I just cannot figure out and implement proper way to get PER HOUR stats. Check the stuf I got, maybe you can think of something.

Code: [Select]
Procedure Statistics_Global_innit;
begin
  Ore_Iron :=        0;
  Ore_OldCopper :=   0;
  Ore_Copper :=      0;
  Ore_Bronze :=      0;
  Ore_Rose :=        0;
  Ore_Shadow :=      0;
  Ore_Silver :=      0;
  Ore_Golden :=      0;
  Ore_Verite :=      0;
  Ore_Valorite :=    0;
  Ore_Marble :=      0;
  Ore_Ice :=         0;
  Ore_BloodRock :=   0;
  Ore_Mytheril :=    0;
  Ore_Amethyst :=    0;
  Ore_Dwarven :=     0;
  Ore_Steel :=       0;
  Ore_SunStone :=    0;
  Ore_BlackRock :=   0;
  Ore_Fire :=        0;
  Ore_Wizzard :=     0;
  Ore_DaemonSteel := 0;
  Ore_Crusader :=    0;
  Ore_Reactive :=    0;
  Ore_Sapphire :=    0;
  Ore_MoonRock :=    0;
end;


Procedure Statistics_Global_Update;
begin
  if GetColor(finditem) = $0000 then Ore_Iron := (Ore_Iron + GetQuantity(finditem));
  if GetColor(finditem) = $0487 then Ore_OldCopper := (Ore_OldCopper + GetQuantity(finditem));
  if GetColor(finditem) = $096D then Ore_Copper := (Ore_Copper + GetQuantity(finditem));
  if GetColor(finditem) = $0972 then Ore_Bronze := (Ore_Bronze + GetQuantity(finditem));
  if GetColor(finditem) = $0B84 then Ore_Rose := (Ore_Rose + GetQuantity(finditem));
  if GetColor(finditem) = $0496 then Ore_Shadow := (Ore_Shadow + GetQuantity(finditem));
  if GetColor(finditem) = $0497 then Ore_Silver := (Ore_Silver + GetQuantity(finditem));
  if GetColor(finditem) = $0494 then Ore_Golden := (Ore_Golden + GetQuantity(finditem));
  if GetColor(finditem) = $089F then Ore_Verite := (Ore_Verite + GetQuantity(finditem));
  if GetColor(finditem) = $08AB then Ore_Valorite := (Ore_Valorite + GetQuantity(finditem));
  if GetColor(finditem) = $0B91 then Ore_Marble := (Ore_Marble + GetQuantity(finditem));
  if GetColor(finditem) = $047F then Ore_Ice := (Ore_Ice + GetQuantity(finditem));
  if GetColor(finditem) = $04C2 then Ore_BloodRock := (Ore_BloodRock + GetQuantity(finditem));
  if GetColor(finditem) = $052D then Ore_Mytheril := (Ore_Mytheril + GetQuantity(finditem));
  if GetColor(finditem) = $0705 then Ore_Amethyst := (Ore_Amethyst + GetQuantity(finditem));
  if GetColor(finditem) = $0794 then Ore_Dwarven := (Ore_Dwarven + GetQuantity(finditem));
  if GetColor(finditem) = $07A1 then Ore_Steel := (Ore_Steel + GetQuantity(finditem));
  if GetColor(finditem) = $0A0A then Ore_SunStone := (Ore_SunStone + GetQuantity(finditem));
  if GetColor(finditem) = $047E then Ore_BlackRock := (Ore_BlackRock + GetQuantity(finditem));
  if GetColor(finditem) = $09EF then Ore_Fire := (Ore_Fire + GetQuantity(finditem));
  if GetColor(finditem) = $09AD then Ore_Wizzard := (Ore_Wizzard + GetQuantity(finditem));
  if GetColor(finditem) = $0493 then Ore_DaemonSteel := (Ore_DaemonSteel + GetQuantity(finditem));
  if GetColor(finditem) = $0A2E then Ore_Crusader := (Ore_Crusader + GetQuantity(finditem));
  if GetColor(finditem) = $07A5 then Ore_Reactive := (Ore_Reactive + GetQuantity(finditem));
  if GetColor(finditem) = $07AB then Ore_Sapphire := (Ore_Sapphire + GetQuantity(finditem));
  if GetColor(finditem) = $0B80 then Ore_MoonRock := (Ore_MoonRock + GetQuantity(finditem));
end;

Procedure Statistics_Global_Write;
begin
  If Ore_Iron <> 0 then AddToSystemJournal('Iron ' + IntToStr(Ore_Iron) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Iron * 360)));
  If Ore_OldCopper <> 0 then  AddToSystemJournal('Old Copper ' + IntToStr(Ore_OldCopper) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_OldCopper * 3600)));
  If Ore_Copper <> 0 then  AddToSystemJournal('Copper ' + IntToStr(Ore_Copper) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Copper * 360)));
  If Ore_Bronze <> 0 then  AddToSystemJournal('Bronze ' + IntToStr(Ore_Bronze) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Bronze * 360)));
  If Ore_Rose <> 0 then  AddToSystemJournal('Rose ' + IntToStr(Ore_Rose) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Rose * 360)));
  If Ore_Shadow <> 0 then  AddToSystemJournal('Shadow ' + IntToStr(Ore_Shadow) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Shadow * 360)));
  If Ore_Silver <> 0 then  AddToSystemJournal('Silver ' + IntToStr(Ore_Silver) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Silver * 360)));
  If Ore_Golden <> 0 then  AddToSystemJournal('Golden ' + IntToStr(Ore_Golden) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Golden * 360)));
  If Ore_Verite <> 0 then  AddToSystemJournal('Verite ' + IntToStr(Ore_Verite) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Verite * 360)));
  If Ore_Valorite <> 0 then  AddToSystemJournal('Valorite ' + IntToStr(Ore_Valorite) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Valorite * 360)));
  If Ore_Marble <> 0 then  AddToSystemJournal('Marble ' + IntToStr(Ore_Marble) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Marble * 360)));
  If Ore_Ice <> 0 then  AddToSystemJournal('Ice ' + IntToStr(Ore_Ice) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Ice * 360)));
  If Ore_BloodRock <> 0 then  AddToSystemJournal('Blood Rock ' + IntToStr(Ore_BloodRock) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_BloodRock * 360)));
  If Ore_Mytheril <> 0 then  AddToSystemJournal('Mytheril ' + IntToStr(Ore_Mytheril) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Mytheril * 360)));
  If Ore_Amethyst <> 0 then  AddToSystemJournal('Amethyst ' + IntToStr(Ore_Amethyst) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Amethyst * 360)));
  If Ore_Dwarven <> 0 then  AddToSystemJournal('Dwarven ' + IntToStr(Ore_Dwarven) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Dwarven * 360)));
  If Ore_Steel <> 0 then  AddToSystemJournal('Steel ' + IntToStr(Ore_Steel) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Steel * 360)));
  If Ore_SunStone <> 0 then  AddToSystemJournal('Sun Stone ' + IntToStr(Ore_SunStone) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_SunStone * 360)));
  If Ore_BlackRock <> 0 then  AddToSystemJournal('Black Rock ' + IntToStr(Ore_BlackRock) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_BlackRock * 360)));
  If Ore_Fire <> 0 then  AddToSystemJournal('Fire ' + IntToStr(Ore_Fire) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Fire * 360)));
  If Ore_Wizzard <> 0 then  AddToSystemJournal('Wizzard ' + IntToStr(Ore_Wizzard) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Wizzard * 360)));
  If Ore_DaemonSteel <> 0 then  AddToSystemJournal('Daemon Steel ' + IntToStr(Ore_DaemonSteel) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_DaemonSteel * 360)));
  If Ore_Crusader <> 0 then  AddToSystemJournal('Crusader ' + IntToStr(Ore_Crusader) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Crusader * 360)));
  If Ore_Reactive <> 0 then  AddToSystemJournal('Reactive ' + IntToStr(Ore_Reactive) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Reactive * 360)));
  If Ore_Sapphire <> 0 then  AddToSystemJournal('Sapphire ' + IntToStr(Ore_Sapphire) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_Sapphire * 360)));
  If Ore_MoonRock <> 0 then  AddToSystemJournal('MoonRock ' + IntToStr(Ore_MoonRock) + ' // Per Hour ' + IntToStr((((timer - t))) / (Ore_MoonRock * 360)));
  AddToSystemJournal('-----------------------------------------');
end;

The stats I get are totally wrong and insane.
Code: [Select]
12:39:25:074 [-]: Iron 118 // Per Hour 9502
12:39:25:078 [-]: Old Copper 8 // Per Hour 14015
12:39:25:083 [-]: Copper 7 // Per Hour 160179
12:39:25:087 [-]: Bronze 7 // Per Hour 160179
12:39:25:091 [-]: Rose 12 // Per Hour 93438
12:39:25:095 [-]: Shadow 14 // Per Hour 80089
12:39:25:099 [-]: Silver 56 // Per Hour 20022
12:39:25:102 [-]: Valorite 17 // Per Hour 65956
12:39:25:107 [-]: Marble 3 // Per Hour 373752
12:39:25:110 [-]: Ice 7 // Per Hour 160179
12:39:25:113 [-]: Blood Rock 10 // Per Hour 112125
12:39:25:117 [-]: Amethyst 6 // Per Hour 186876
12:39:25:120 [-]: Steel 4 // Per Hour 280314
12:39:25:123 [-]: Sun Stone 6 // Per Hour 186876
12:39:25:127 [-]: Black Rock 4 // Per Hour 280314
12:39:25:129 [-]: Daemon Steel 2 // Per Hour 560628
12:39:25:132 [-]: Crusader 4 // Per Hour 280314
12:39:25:136 [-]: Reactive 1 // Per Hour 1121257
12:39:25:141 [-]: MoonRock 2 // Per Hour 560628
12:39:25:144 [-]: -----------------------------------------
What you witness -- is whatver..
uogamers hybrid.

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: [debug] Statistics
« Reply #1 on: December 09, 2017, 03:58:25 AM »
0
On top my head I know two script that use stat

First :  FaF from TM .  It tel you how lot of stat per Hr, Sea serpent, Net, pearls. 
Second is MWinc, have a lumber and Miner script.  Both give you a average /per and also tell you % ratio.   

Have a look at those two, maybe you can see where you went wrong.

Offline camotbikTopic starter

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: [debug] Statistics
« Reply #2 on: December 09, 2017, 04:11:29 AM »
0
I got my own mining script on EUO, that uses statistics - http://www.scriptuo.com/index.php?topic=8651.msg74785#msg74785
the part that would interest me is
Code: [Select]
  set %currenttime #scnt
  set %time %currenttime - %starttime
  set %hh %time / 3600
  set %rest1 %time % 3600
  set %minutes %rest1 / 60
  if %minutes < 10
    set %mm 0 , %minutes
  else
    set %mm %minutes
  set %seconds %rest1 % 60
  if %seconds < 10
    set %ss 0 , %seconds
  else
    set %ss %seconds
  set %runtime %hh , h , : , %mm , m , : , %ss , s
  menu set runtime %runtime
  set %oph ( %counter_ore * 3600 ) / %time

I was trying to achieve the same in pascal, but the lack of knowledge got me stuck.
What you witness -- is whatver..
uogamers hybrid.

Offline Crome969

  • Moderator
  • *
  • *****
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: [debug] Statistics
« Reply #3 on: December 09, 2017, 10:32:55 PM »
0
Hey my friend! If you have skype, hit me up later on.. i dont use icq lately. I can help you figure out a a way.

As startup to think about it is you need a start time and a current time.
Then you should figure out, if there are functions that gives you a timespan or not.
Idea 1 :

Pseudo function 1
Code: [Select]
TimeA : TDatetime;
begin
TimeA := Now;

while((Now - TimeA) < 1) do  <----------- Here we get a timespan in form of a date and need to parse
begin

end;
end;


Idea 2 :

Code: [Select]
Hour_1 : Cardinal;

TimeA : Cardinal;

Hour_1 := 3600 * 1000; //Reflects a hour

TimeA := GetTicks() + Hour_1;

if(TimeA > GetTicks()) then
begin
    // 1 hour has passed..
end;

I guess you get it. All pseudo.. had not runned stealth for a while..



Offline camotbikTopic starter

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: [debug] Statistics
« Reply #4 on: December 20, 2017, 01:23:33 PM »
0
Oh man who uses skype, it's almost 2018. Buddy hit me up on discord CAMOTbIK#8517 !!!
What you witness -- is whatver..
uogamers hybrid.

Tags: