Jump to content




Sample table code won't work in online Lua demo


  • You cannot reply to this topic
5 replies to this topic

#1 skypickle

  • New Members
  • 1 posts

Posted 25 June 2015 - 12:51 PM

View PostDitto8353, on 18 October 2012 - 06:03 PM, said:

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 by Lyqyd, 25 June 2015 - 04:51 PM.


#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 25 June 2015 - 04:53 PM

I've split this in to a new topic.

#3 The_Cat

  • Members
  • 119 posts

Posted 25 June 2015 - 05:22 PM

os.pullEvent is a computercraft api... Why not try it on a actual computer in-game?

#4 Lupus590

  • Members
  • 2,028 posts
  • LocationUK

Posted 25 June 2015 - 05:30 PM

View PostThe_Cat, on 25 June 2015 - 05:22 PM, said:

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

#5 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 25 June 2015 - 05:43 PM

View PostLupus590, on 25 June 2015 - 05:30 PM, said:

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.

#6 Lupus590

  • Members
  • 2,028 posts
  • LocationUK

Posted 25 June 2015 - 08: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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users