diff --git a/examples/crosshair_codes/index.js b/examples/crosshair_codes/index.js new file mode 100644 index 00000000..5b334a20 --- /dev/null +++ b/examples/crosshair_codes/index.js @@ -0,0 +1,9 @@ +var {parseEvent, parseTicks} = require('@laihoe/demoparser2'); + + +const pathToDemo = "path/to/demo.dem"; + +let gameEndTick = Math.max(...parseEvent(pathToDemo, "round_end").map(x => x.tick)) +let players = parseTicks(pathToDemo, ["crosshair_code"], [gameEndTick]) + +console.log(players) diff --git a/examples/crosshair_codes/main.py b/examples/crosshair_codes/main.py new file mode 100644 index 00000000..88882551 --- /dev/null +++ b/examples/crosshair_codes/main.py @@ -0,0 +1,9 @@ +from demoparser2 import DemoParser +import glob + + +parser = DemoParser("path/to/demo.dem") + +last_tick = parser.parse_event("round_end")["tick"].to_list()[-1] +df = parser.parse_ticks(["crosshair_code"],ticks=[last_tick]) +print(df) \ No newline at end of file