Guest User

main

a guest
Oct 18th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. --Running Instructions
  2. --Start with <name>.wrapMon(side)
  3. --Next do <name>.print(text)
  4.  
  5. --Local Variables
  6.  
  7. --Local Functions
  8. local function getMonStats()
  9.   monw,monh = apimon.getSize()
  10. end
  11.  
  12. local function getMyStats()
  13.   myx,myy = apimon.getCursorPos()
  14. end
  15.  
  16. local function foobar()
  17.   --
  18. end  
  19.  
  20. --Testing Functions
  21. function test()
  22.   getMonStats()
  23.   print(monw.." : "..monh)
  24.   getMyStats()
  25.   print(myx.." : "..myy)
  26. end
  27. --Public Functions
  28. function wrapMon(side)
  29.   apimon = peripheral.wrap(side)
  30.   getMyStats()
  31.   getMonStats()
  32. end
  33.  
  34. function clear()
  35.   apimon.clear()
  36.   apimon.setCursorPos(1,1)
  37. end
  38.  
  39. function print(text)
  40.   getMyStats()
  41.   apimon.write(text)
  42.   newh = myy + 1
  43.   apimon.setCursorPos(1,newh)
  44. end
Advertisement
Add Comment
Please, Sign In to add comment