Bug reports
If I did something wrong, please let me know.
About myself
Playing Minecraft since 1.1. Current version: 1.5.1.
I prefer playing with modifications, such as ComputerCraft, IC2 (not out for 1.5 yet), Forestry (alpha for 1.5.1, many bugs, including critical, are present)...
I am a member and an administrator of the Russian wiki. I can be found there.
I use Opera (if that's important).
How NOT to code
ComputerCraft!
file = io.open(path, "w") file:write(str) file:close() dofile(file)
Using a file handle for dofile is incorrect, a string (file path) should be used instead.
e, key = os.pullEvent("key")
if e == keys.t then
doSomething()
elseif e == keys.y then
doSomethingElse()
end
e is the event handled by os.pullEvent. key is the parameter (key code). Therefore: if key == keys.t then...