Posted 19 January 2013 - 05:44 PM
I created a cheat code function that returns true if you enter a sequence of keystrokes. I think it would be fun to see this pop up in random programs in the future. *hint hint*
For those who don't know, the Konami Code is up, up, down, down, left, right, left, right, b, a, enter(it's actually start, but I had to make do).
Spoiler
local function checkCode()
local kCode = {200, 200, 208, 208, 203, 205, 203, 205, 48, 30, 28}
local code = false
local index = 1
while true do
local events = {os.pullEvent()}
if events[1] == "key" then
if events[2] == kCode[index] then
if index == #kCode then
code = true
break
else
code = false
index = index + 1
end
else
code = false
os.queueEvent(events[1], events[2], events[3], events[4])
index = 1
break
end
else
code = false
os.queueEvent(events[1], events[2], events[3], events[4])
break
end
end
return code
end
You can have it run secretly in the background, and if it returns false, it queues up the events, so you can't mess up a menu. All you have to do is change the kCode table to include the keycode sequence you want to check for. By default it includes the famous Konami Code.For those who don't know, the Konami Code is up, up, down, down, left, right, left, right, b, a, enter(it's actually start, but I had to make do).