Skip to content

Instantly share code, notes, and snippets.

@cheapie
Created August 21, 2021 19:40
Show Gist options
  • Save cheapie/a0e34677af3af74f074612f5c942939c to your computer and use it in GitHub Desktop.
Save cheapie/a0e34677af3af74f074612f5c942939c to your computer and use it in GitHub Desktop.
local f = io.open(arg[1],"rb")
local devsize = f:seek("end")
local actmode = 1
local actregion1 = 0
local actregion2 = 0
while true do
if actmode == 1 then
f:seek("set",math.random(0,devsize/30))
elseif actmode == 2 then
if math.random(1,25) == 1 then
f:seek("set",math.random(0,devsize/30))
else
f:seek("set",actregion1+math.random(0,devsize/150))
end
elseif actmode == 3 then
if math.random(1,10) > 4 then
f:seek("set",actregion1+math.random(0,devsize/30))
elseif math.random(1,10) > 9 then
f:seek("set",actregion2+math.random(0,devsize/30))
else
f:seek("set",math.random(0,devsize/150))
end
end
if math.random(1,100) == 1 then
actmode = math.random(1,3)
actregion1 = math.random(0,devsize*0.94)
actregion2 = math.random(0,devsize*0.94)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment