Advertisement
Guest User

test2.lua

a guest
Jul 16th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1.  
  2. local log = {}
  3. local _f = {}
  4. _f["swing"] = robot.swing
  5. _f["sleep"] = function() os.sleep(.4) return true end
  6.  
  7. local function run(f)
  8.     table.insert(log, os.clock().." "..f)
  9.     if _f[f] then
  10.         table.insert(log, os.clock().." "..f.." end")
  11.     else
  12.         table.insert(log, os.clock().." "..f.." end")
  13.     end
  14. end
  15.  
  16. run("swing")
  17. run("sleep")
  18.  
  19. print(textutils.serialise(log))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement