Posted 25 August 2014 - 07:20 PM
ComputerCraft-EventLoop Version 1.5
This API allows you to register Event Listeners and fire custom events in a way that is very similar to JavaScript and Node.js.
Installation
To install this program via pastebin, run
or go to http://pastebin.com/RWaMMZVM
Alternatively, the code is available on gitHub:
https://github.com/F...Craft-EventLoop
This API is available on LNETeam's CCAPT Package Manager under the name EventLoop
Usage
A program using ComputerCraft-EventLoop may look like this:
Example output:
API Documentation
A full API Documentation of ComputerCraft-EventLoop can be found on gitHub:
https://github.com/F...Craft-EventLoop
Version History
Version 1.5: GitHub Changelog
Version 1.4.1: GitHub Changelog
Version 1.4: GitHub Changelog
Version 1.3.1: GitHub Changelog
Version 1.3: GitHub Changelog
Version 1.2: GitHub Changelog
Version 1.1: GitHub Changelog
Version 1.0: GitHub Changelog
A full Version history (all commits and branches) can be found on gitHub:
https://github.com/F...Craft-EventLoop
This API allows you to register Event Listeners and fire custom events in a way that is very similar to JavaScript and Node.js.
Installation
To install this program via pastebin, run
pastebin get RWaMMZVM eventloop
or go to http://pastebin.com/RWaMMZVM
Alternatively, the code is available on gitHub:
https://github.com/F...Craft-EventLoop
This API is available on LNETeam's CCAPT Package Manager under the name EventLoop
Usage
A program using ComputerCraft-EventLoop may look like this:
os.loadAPI('eventloop') --load the ComputerCraft-EventLoop API
local loop = eventloop.create() --get an EventLoop instance
loop:run(function () --run a function in the event loop
print('I\'m in an event loop!')
loop:timeout(2, function ()
print('This will happen 2 seconds later.')
end)
loop:interval(1, function ()
print('This will happen every second!')
end)
loop:on('char', 's', function ()
print('You pressed s!')
end)
loop:timeout(6, function ()
print('Goodbye')
loop:terminate() --stop the loop after 6 seconds
end)
end)
Example output:
API Documentation
A full API Documentation of ComputerCraft-EventLoop can be found on gitHub:
https://github.com/F...Craft-EventLoop
Version History
Spoiler
Version 1.5: GitHub Changelog
Version 1.4.1: GitHub Changelog
Version 1.4: GitHub Changelog
Version 1.3.1: GitHub Changelog
Version 1.3: GitHub Changelog
Version 1.2: GitHub Changelog
Version 1.1: GitHub Changelog
Version 1.0: GitHub Changelog
A full Version history (all commits and branches) can be found on gitHub:
https://github.com/F...Craft-EventLoop
Edited on 29 August 2014 - 03:51 PM