DeepFriedBabeez

DoubleGraph Test

Apr 28th, 2013
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. os.loadAPI("ocs/apis/graph")
  2. os.loadAPI("ocs/apis/sensor")
  3.  
  4. mon = peripheral.wrap("right")
  5.  
  6. values = {}
  7. values[0] = 100
  8. values[1] = 0
  9.  
  10. function update1()
  11.     values[0] = values[0] - 5
  12.     return values[0]
  13. end
  14.  
  15. function update2()
  16.     values[1] = values[1] + 5
  17.     return values[1]
  18. end
  19.  
  20. updates = {update1, update2}
  21.  
  22. graphInstance = graph.new(mon, updates, "Graph", nil, 0, 100)
  23.  
  24. while true do
  25.     graphInstance:draw()
  26.     sleep(1)
  27. end
Advertisement
Add Comment
Please, Sign In to add comment