1 posts
Posted 25 June 2015 - 01:51 PM
local eventHandler = { }
eventHandler["redstone"] = function (side)
print("Redstone event on side: " .. side)
end
evtType,p1 = os.pullEvent()
eventHandler[evtType](p1)
--[[ On redstone event, outputs:
Redstone event on side <side>
]]
Why doesn't the above code work in this Luademo here
http://www.lua.org/cgi-bin/demo
Edited on 25 June 2015 - 03:51 PM
8543 posts
Posted 25 June 2015 - 05:53 PM
I've split this in to a new topic.
121 posts
Posted 25 June 2015 - 06:22 PM
os.pullEvent is a computercraft api… Why not try it on a actual computer in-game?
2427 posts
Location
UK
Posted 25 June 2015 - 06:30 PM
os.pullEvent is a computercraft api… Why not try it on a actual computer in-game?
or use one of the emulators on the forums,
mimic is apparently a good online one
1852 posts
Location
Sweden
Posted 25 June 2015 - 06:43 PM
or use one of the emulators on the forums,
mimic is apparently a good online one
I'd recommend
CCEmuRedux instead, as Mimic seems to have some bugs, atleast from what I've heard.
2427 posts
Location
UK
Posted 25 June 2015 - 09:53 PM
I would recommend CCEmuRedux too as i have had problems with my few encounters with Mimic, but OP said they were using the online demo so I thought they may prefer a web based emulator over one they have to download.