Advertisement
BeefyMuscle

--Beef's Porta-Matrix Data Sender Script--

Oct 23rd, 2024
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | Gaming | 0 0
  1. --Beef's Porta-Matrix Data Sender Script--
  2.  
  3. --finding peripherals--
  4. local m = peripheral.wrap("right")
  5. local im = peripheral.find("Induction Matrix")
  6.  
  7. --opening modem channel--
  8. m.open(241)
  9.  
  10. --core program loop--
  11. while (true)
  12. do
  13.  
  14. --putting data into table--
  15. local mL = {
  16. maxPow = im.getMaxEnergy(),
  17. curPow = im.getEnergy(),
  18. curIn = im.getInput(),
  19. curOut = im.getOutput(),
  20. tfCap = im.getTransferCap()
  21. }
  22.  
  23. --serializing data (whatever that means)--
  24. local matrixPkg = textutils.serialise(mL)
  25. --transmitting table to channel 241)
  26. m.transmit(241,0,matrixPkg)
  27.  
  28. print(matrixPkg)
  29.  
  30. --wait 250 ms--
  31. sleep(.25)
  32.  
  33. end
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement