ComputerCraft Archive

events

computer utility cc-scripts github

Description

API: events

Installation

Copy one of these commands into your ComputerCraft terminal:

wget:wget https://raw.githubusercontent.com/cc-scripts/cc-scripts/master/apis/events.lua events
Archive:wget https://cc.shobie.xyz/cc/get/gh-cc-scripts-cc-scripts-apis-events events
Quick Install: wget https://cc.shobie.xyz/cc/get/gh-cc-scripts-cc-scripts-apis-events events

Usage

Run: events

Tags

none

Source

View Original Source

Code Preview

-- API: events
-- Source: /cc-scripts/apis/events.lua
-- Some syntactic sugar to take the pain out of `os.pullEvent`.

local events = {}
function events.listen()
  while true do
    os.pullEvent()
  end
end

function events.terminate()
  error()
  print("Terminated")
end

return events