skadistats / clarity-examples

Example code for clarity
BSD 3-Clause "New" or "Revised" License
115 stars 38 forks source link

Abilities info #4

Closed uside closed 9 years ago

uside commented 9 years ago

I found old abilities info parsing manual, but I don't know how parse this using clarity. Can someone help me?

spheenik commented 9 years ago

Here is a Gist

https://gist.github.com/spheenik/2271d2c9a340ee594806

that shows how to get the kills of the first player. It will give you a guideline on what you have to do to get at your info.

If you need more help, np :)

uside commented 9 years ago

Thank's!

uside commented 9 years ago

Oh. I'm try to get data from DT_DOTABaseAbility, but nothing happens. I read a lot of https://github.com/yasp-dota/yasp sources and find code, where programm gets ability upgrades from steam. Is there a way to get this information using clarity? Because I have many replays that I want to parse, but them not recorded by valve (replays from my dedicated servers) :cry:

spheenik commented 9 years ago

Well if you wanna have all existing abilities, you can do something like this:

https://gist.github.com/spheenik/caa02067dd12e25d7bd4

You will have to find out which ability belongs to which hero though.

spheenik commented 9 years ago

updated the gist to show you how to find the hero.

uside commented 9 years ago

Im noob in Java. How fix the "cannot find symbol: class Iterator" ?

spheenik commented 9 years ago

import java.util.Iterator;

uside commented 9 years ago

Predicate requires java 8?

uside commented 9 years ago

However, I changed Predicate to

Iterator<Entity> iterw = match.getEntities().getAllByDtName("DT_DOTABaseAbility");

and seems it works. Thank u