fork download
  1.  
  2. local motor = require("motor")
  3. local term = require("term")
  4. local event = require("event")
  5.  
  6. local function onTouch(screenX, screenY, playerName)
  7. term.write("Touch event:"+screenX+screenY+playerName)
  8. end
  9.  
  10. local function handleEvent(eventID, ...)
  11. term.write("Event: "+eventID)
  12. if eventID == "touch" then
  13. onTouch(...)
  14. end
  15. end
  16.  
  17. event.listen("touch", handleEvent)
  18.  
  19. local running = true
  20. local history = {}
  21.  
  22. while running do
  23. term.clearLine()
  24. term.write(os.date())
  25. os.sleep(0.1)
  26. end
Runtime error #stdin #stdout #stderr 0.03s 2540KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
lua: prog.lua:2: module 'motor' not found:
	no field package.preload['motor']
	no file './motor.lua'
	no file '/usr/local/share/lua/5.1/motor.lua'
	no file '/usr/local/share/lua/5.1/motor/init.lua'
	no file '/usr/local/lib/lua/5.1/motor.lua'
	no file '/usr/local/lib/lua/5.1/motor/init.lua'
	no file '/usr/share/lua/5.1/motor.lua'
	no file '/usr/share/lua/5.1/motor/init.lua'
	no file './motor.so'
	no file '/usr/local/lib/lua/5.1/motor.so'
	no file '/usr/lib/lua/5.1/motor.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
	[C]: in function 'require'
	prog.lua:2: in main chunk
	[C]: ?