|
Post by warspyking on Nov 19, 2015 3:03:40 GMT
I spammed it like a boss. Now all programs/console/ everything are spammed a tostring'd table.
How To Fix:
Exit app Double click home button Hold down on Touch Lua Remove it Reopen app
--NOTE: You will have to perform the above instructions EACH time you run one of the codes on this thread.
I'm fully aware that it's my own fault for making such h4xxy code, but it's still an issue.
|
|
|
Post by warspyking on Nov 19, 2015 3:07:59 GMT
function GC(self) print(self) sleep(500) --No matter what you set this as, it WILL eventually catch up O_O return GC(self) end
setmetatable({},{__gc = GC})
|
|
|
Post by warspyking on Nov 19, 2015 3:11:01 GMT
Note: This will also lag your app extremely in programs, editing programs, and out of programs.
Good luck running anything with removing TL from your memory of recent apps first.
|
|
|
Post by warspyking on Nov 19, 2015 12:29:30 GMT
You can even just print nothing and it can break your output for all programs:
function GC(self) print("") return GC(self) end setmetatable({},{__gc=GC})
|
|
|
Post by leon26leon26 on Nov 19, 2015 12:41:01 GMT
Do you expect everybody to try it? xD
|
|
|
Post by warspyking on Nov 19, 2015 12:48:22 GMT
Do you expect everybody to try it? xD Well it's easily reversible. Simply get out of the app, double click the home button, and remove Touch Lua from memory.
|
|
|
Post by warspyking on Nov 19, 2015 12:56:00 GMT
Here's another one, that switches you to the graphics screen and doesn't let you out:
function GC(self) print(self) return GC(self) end
draw.setscreen(1) setmetatable({},{__gc = GC})
|
|
|
Post by warspyking on Nov 19, 2015 13:05:31 GMT
My bet, is if I had the audio library, I could spam audio and make a racket.
|
|
|
Post by warspyking on Nov 19, 2015 13:11:56 GMT
Here's one with sys.alert:
function GC(self) print(self) sys.alert("tink") sys.alert("tock") sys.alert("dtfm0") sys.alert("neg") sys.alert("drop") return GC(self) end
setmetatable({},{__gc = GC})
You can leave the program. But that won't end your ear's suffering
|
|
|
Post by warspyking on Nov 19, 2015 13:51:58 GMT
Here's a version that (assuming you don't have the turtle library) will spam you saying you do need it, easy to use different libraries instead:
function GC(self) sleep(math.random(5,10)*1000)pcall(function()turtle.penwidth()end) return GC(self) end
setmetatable({},{__gc = GC})
|
|
|
Post by warspyking on Nov 19, 2015 14:03:12 GMT
A covert piece of code that you'd never guess stopped ALL your programs from running:
function GC(self) sleep(math.huge) return GC(self) end
setmetatable({},{__gc = GC})
|
|
|
Post by warspyking on Nov 19, 2015 18:31:39 GMT
This piece of code will exit the app seemingly-randomly after the code ends. Even if they end the program:
function GC(self, n) n = n or 1 if n == 10000000 then os.exit() end return GC(self, n+1) end
setmetatable({},{__gc = GC})
|
|
|
Post by warspyking on Nov 19, 2015 18:44:02 GMT
Heck, you could even use this little trick to run your own code after your program ends!
function GC(self) local x = io.read() pcall(load(x)) return GC(self) end
local t = setmetatable({},{__gc = GC})
local input print("Say break to end the program") repeat input = io.read() == "break" until input t = nil
In the end, the lesson is, don't tail call inside a __gc metamethod, as once it's garbage collected, code will continue running EVEN AFTER your program ends.
The issue would be that once it ends, it ends, this should NOT happen.
|
|
|
Post by Admin on Apr 5, 2016 11:54:52 GMT
Heck, you could even use this little trick to run your own code after your program ends! function GC(self) local x = io.read() pcall(load(x)) return GC(self) end
local t = setmetatable({},{__gc = GC})
local input print("Say break to end the program") repeat input = io.read() == "break" until input t = nil
In the end, the lesson is, don't tail call inside a __gc metamethod, as once it's garbage collected, code will continue running EVEN AFTER your program ends. The issue would be that once it ends, it ends, this should NOT happen. I checked it, Lua program failes to end preventing any other program to run. No matter how I try to end the program gracefully, it just fails! I guess it is Lua issue... What I can do is make lua error that will stop lua in certain functions, like print and sleep. This will terminate active programm.
|
|
|
Post by warspyking on Apr 6, 2016 1:21:26 GMT
Heck, you could even use this little trick to run your own code after your program ends! function GC(self) local x = io.read() pcall(load(x)) return GC(self) end
local t = setmetatable({},{__gc = GC})
local input print("Say break to end the program") repeat input = io.read() == "break" until input t = nil
In the end, the lesson is, don't tail call inside a __gc metamethod, as once it's garbage collected, code will continue running EVEN AFTER your program ends. The issue would be that once it ends, it ends, this should NOT happen. I checked it, Lua program failes to end preventing any other program to run. No matter how I try to end the program gracefully, it just fails! I guess it is Lua issue... What I can do is make lua error that will stop lua in certain functions, like print and sleep. This will terminate active programm. So you *can't* fix this problem? Good thing __gc is rarely used anyway xD
|
|