Page 1 of 1

Anything like a Parser

Posted: Fri Nov 28, 2008 1:34 pm
by holycow1
hey Im playing Shaiya and was wondering if anyone has made like a dmg parser or exp/hr counter. We had these on FFXI and I would just like to see how fast im lvling or who's doing the most dmg in the party.

Thanks a bunch for all your help

Awesome thread btw

Re: Anything like a Parser

Posted: Wed Dec 03, 2008 12:50 am
by holycow1
so no ones heard anything about a program like this? exp/hr or damage calculator ?

Re: Anything like a Parser

Posted: Wed Dec 03, 2008 3:57 am
by Administrator
Nope, but it shouldn't be too hard to make one. Just keep track of how much experience you've gained and for how long, and do the math:

Code: Select all

local expGained = 0;
local startTime = os.time();
local lastAnnounceTime = os.time();

local lastTotalExp = 0;
while(true) do
  local newTotalExp = memoryReadInt(proc, experienceaddr, experience_offset);
  if( newTotalExp > lastTotalExp ) then
    expGained = expGained + (newTotalExp - lastTotalExp);
  end

  -- has 10 seconds elapsed? update the exp/min
  if( os.difftime(os.time(), lastAnnounce) > 10 ) then
    local timeElapsed = os.difftime(os.time(), startTime);
    local expPerMin = 0;
    if( timeElapsed == 0 ) then timeElapsed = 1; end; -- prevent division by zero

    expPerMin = expGained/(timeElapsed/60.0);
    lastAnnounce = os.time();
    printf("Exp/min: %0.1f\n" expPerMin);
  end

end

Re: Anything like a Parser

Posted: Tue Dec 09, 2008 11:50 am
by holycow1
k cool ty elverion
im a newb to .lua

Re: Anything like a Parser

Posted: Sun Jul 12, 2009 4:13 pm
by Rishijin
The exp per hour I can understand.

But what about making a DPS one?

Could you read the memory for the combat log strings? (That sort of thing never seems to work for me.)
Or perhaps you'd have to find the address where the calculation occurs?

The script itself would be easy, but how do you get the data?

Please don't say .dll injection :cry:

Re: Anything like a Parser

Posted: Sun Jul 12, 2009 4:38 pm
by Administrator
You can do it by reading memory. ZeroSignal used something like this to make sure skills were cast properly. It's up to you to find the pointers to the combat log.

Once you've got a string (which should be something like "You use [SKILL] and hit for X damage."), you can use Lua's string functions, you can pull out the damage. Then, it is as simple as taking your average damage over, say, 10 seconds.

Re: Anything like a Parser

Posted: Mon Jul 13, 2009 10:07 am
by 3cmSailorfuku
Administrator wrote:You can do it by reading memory. ZeroSignal used something like this to make sure skills were cast properly. It's up to you to find the pointers to the combat log.

Once you've got a string (which should be something like "You use [SKILL] and hit for X damage."), you can use Lua's string functions, you can pull out the damage. Then, it is as simple as taking your average damage over, say, 10 seconds.
Or if you can access the Attackspeed of the weapon, you can calculate it depending on the variable.