summaryrefslogtreecommitdiff
path: root/delta-wrap.lua
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2024-11-20 23:49:25 +0100
committerAki <please@ignore.pl>2024-11-20 23:49:25 +0100
commit5002bee1413a0dcb886a51619282504dd49b3aeb (patch)
tree2773c056fe489b8fa2c766ef06c455cb58c2ce1d /delta-wrap.lua
parent419e19cbc2750512a13ddfff5698f9df39f408da (diff)
downloadnoita-eyes-master.zip
noita-eyes-master.tar.gz
noita-eyes-master.tar.bz2
Calculate absolute delta in mod 83 bodyHEADmaster
Diffstat (limited to 'delta-wrap.lua')
-rwxr-xr-xdelta-wrap.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/delta-wrap.lua b/delta-wrap.lua
new file mode 100755
index 0000000..d63beeb
--- /dev/null
+++ b/delta-wrap.lua
@@ -0,0 +1,16 @@
+#!/usr/bin/env lua
+local eyes = require "eyes"
+local format = require "format"
+local reading = require "reading"
+for _, message in ipairs(eyes) do
+ local previous = 0
+ local deltas = {}
+ for _, value in reading.values(message) do
+ if value <= previous then
+ previous = previous - 83
+ end
+ table.insert(deltas, value - previous)
+ previous = value
+ end
+ print(format.csv(deltas))
+end