Skip to content

Instantly share code, notes, and snippets.

@Kan18
Kan18 / better_pullevent.lua
Last active July 30, 2023 01:06
Random cursed ComputerCraft lua snippets
--[=[see https://discord.com/channels/477910221872824320/477911902152949771/966486623921508392 ]=]
local function checkForTerm
(_,...)_=...==_..''
and error("Terminated", 0) return ...
end
function os.pullEvent(...)
return checkForTerm("terminate", coroutine.yield(...))
end
function fromhex(str) return (str:gsub('..', function (cc) return string.char(tonumber(cc, 16)) end)) end
function tohex(str) return (str:gsub('.', function (c) return string.format('%02X', string.byte(c))end)) end
@Kan18
Kan18 / test.txt
Created December 1, 2019 17:36
e
eeeee