AnotherTekkituser

Computercraft event writer

May 29th, 2014
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. --[[
  2.  
  3. a simple Event writer
  4.  
  5. written from scratch by CreeperGoBoom
  6.  
  7. for users of Computercraft
  8.  
  9. this program will write to screen the vars passed by any event from os.pullEvent
  10.  
  11. which will read like:
  12.  
  13. event_name is var 1
  14. something is var 2
  15. etc
  16.  
  17. ]]
  18.  
  19.  
  20. while true do
  21.   event={os.pullEvent()}
  22.   for i = 1,6 do -- most event have 3 to 5 vars, remembering the first var is always the name
  23.     if event[i]~=nil then
  24.       print(event[i].." is var "..tostring(i))
  25.     end
  26.   end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment