summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-04-01 22:26:57 +0100
committerubq323 <ubq323@ubq323.website>2024-04-01 22:26:57 +0100
commitf02d1049745bdca4a58cad3b512e3fb502f138c0 (patch)
tree740f06b8d32e55da5ce45ae1b1af3ce8140b2609
parent140e2428a5dea93042abbcf4e79a414e46ddb5d8 (diff)
launch echest
-rw-r--r--echest.lua33
-rw-r--r--strutil.lua7
2 files changed, 40 insertions, 0 deletions
diff --git a/echest.lua b/echest.lua
new file mode 100644
index 0000000..4468c8c
--- /dev/null
+++ b/echest.lua
@@ -0,0 +1,33 @@
+local p = assert((peripheral.find"ender_storage"))
+
+-- local function clamp(x, min, max)
+-- if x < min then return min
+-- else if x > max then return max
+-- else return x
+-- end
+-- end
+
+-- local function setnums()
+-- local fp = fs.open("/efreq.dat")
+
+
+
+-- local function getnums()
+-- local fp = fs.open("/efreq.dat")
+-- if not fp then
+-- setnums(0,0,0)
+-- return 0,0,0
+-- else
+-- local s = fp.readAll()
+-- fp.close()
+-- return unpack(strutil.splitw(s))
+-- end
+-- end
+
+for x=1,16 do for y=1,16 do for z=1,16 do
+ p.setFrequency(2^x, 2^y, 2^z)
+ local name = p.getName()
+ if name ~= nil then
+ print(x,y,z,name)
+ end
+end end end
diff --git a/strutil.lua b/strutil.lua
new file mode 100644
index 0000000..47ddb06
--- /dev/null
+++ b/strutil.lua
@@ -0,0 +1,7 @@
+local function splitw(str)
+ local res = {}
+ for s in str:gmatch("%S+") do
+ table.insert(res,s)
+ end
+ return res
+end