Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.29 KB | None | 0 0
  1. --t
  2. os.loadAPI("rAPI")
  3.  
  4. local modem = nil
  5. local channel = nil
  6. local replyChannel = nil
  7.  
  8. function init(varModem, varChannel, varReplyChannel)
  9.   modem = varModem
  10.   channel = varChannel
  11.   replyChannel = varReplyChannel
  12.   varModem.open(replyChannel)
  13. end
  14.  
  15. --returns void
  16. function setActive(bool)
  17.   rAPI.call(modem, channel, replyChannel, textutils.serialize({"setActive",bool}))
  18. end
  19.  
  20. --returns bool
  21. function getActive()
  22.   return rAPI.call(modem, channel, replyChannel, "getActive")
  23. end
  24.  
  25. --returns void
  26. function setInductorEngaged(bool)
  27.   rAPI.call(modem, channel, replyChannel, textutils.serialize({"setInductorEngaged",bool}))
  28. end
  29.  
  30. --returns bool
  31. function getInductorEngaged()
  32.   return rAPI.call(modem, channel, replyChannel, "getInductorEngaged")
  33. end
  34.  
  35. --returns num
  36. function getRotorSpeed()
  37.   return tonumber(rAPI.call(modem, channel, replyChannel, "getRotorSpeed"))
  38. end
  39.  
  40. --returns num
  41. function getEnergyProducedLastTick()
  42.   return tonumber(rAPI.call(modem, channel, replyChannel, "getEnergyProducedLastTick"))
  43. end
  44.  
  45. --returns num
  46. function getFluidFlowRate()
  47.   return tonumber(rAPI.call(modem, channel, replyChannel, "getFluidFlowRate"))
  48. end
  49.  
  50. --returns num
  51. function getFluidFlowRateMax()
  52.   return tonumber(rAPI.call(modem, channel, replyChannel, "getFluidFlowRateMax"))
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement