Jummit

Computercraft: Multitasking Windows Demo

Apr 12th, 2018
560
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. local program = require "programs"
  2.  
  3. programs = {
  4.   program.new(function()
  5.     shell.run("paint", "tes")
  6.   end, 5, 5, 20, 10),
  7.   program.new(function()
  8.     shell.run("edit", "tes")
  9.   end, 1, 2, 10, 7),
  10.   program.new(function()
  11.     shell.run("worm")
  12.   end, 30, 2, 15, 9),
  13.   program.new(function()
  14.     while true do
  15.       term.setBackgroundColor(colors.white)
  16.       term.clear()
  17.       coroutine.yield()
  18.     end
  19.   end, 28, 10, 20, 10)
  20. }
  21.  
  22. while true do
  23.   local event, var1, var2, var3 = os.pullEventRaw()
  24.   if event == "terminate" then break end
  25.  
  26.   term.setBackgroundColor(colors.black)
  27.   term.clear()
  28.   program.update(programs, event, var1, var2, var3)
  29. end
  30.  
  31. term.setBackgroundColor(colors.black)
  32. term.clear()
  33. term.setCursorPos(1, 1)
Add Comment
Please, Sign In to add comment