Advertisement
KidBrine

Untitled

Feb 25th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. InstallDir = ...
  2. if InstallDir == nil then InstallDir = '/' end
  3. term.clear()
  4. term.setCursorPos(1,1)
  5. print('Do you wish to install cht.lua? (Y/N)')
  6. local x = read()
  7.  
  8. if x == 'y' or x == 'Y' then
  9. local NF = fs.open(InstallDir..'/cht.lua','w')
  10. NF.write(''
  11. ..'rednet.open("front")\n'
  12. ..'CH = peripheral.wrap("back")\n'
  13. ..'Token = "aa679-23b"\n'
  14. ..'Info = {}\n'
  15. ..'CH.capture("![Oo]pen")\n'
  16. ..'CH.capture("![Cc]lose")\n'
  17. ..'while true do\n'
  18. ..' _, Info[1], Info[3], Info[2], Info[4] = os.pullEvent("chat_capture")\n'
  19. ..' if Info[3] == "![Oo]pen" then\n'
  20. ..' rednet.send(27,{Token,Info[4],"Pos"})\n'
  21. ..' print("Sent")\n'
  22. ..' end\n'
  23. ..' if Info[3] == "![Cc]lose" then\n'
  24. ..' rednet.send(27,{Token,Info[4],"Neg"})\n'
  25. ..' print("Sent")\n'
  26. ..' end\n'
  27. ..' ID, MSG = rednet.receive(10)\n'
  28. ..' if MSG == "Yote" then\n'
  29. ..' CH.tell("Hyeh")\n'
  30. ..' end\n'
  31. ..' sleep(1)\n'
  32. ..' print(Info[3])\n'
  33. ..'end\n'
  34. )
  35. NF.close()
  36. end
  37.  
  38.  
  39.  
  40.  
  41.  
  42. InstallDir = ...
  43. if InstallDir == nil then InstallDir = '/' end
  44. term.clear()
  45. term.setCursorPos(1,1)
  46. print('Do you wish to install pwr? (Y/N)')
  47. local x = read()
  48.  
  49. if x == 'y' or x == 'Y' then
  50. local NF = fs.open(InstallDir..'/pwr','w')
  51. NF.write(''
  52. ..'rednet.open("front")\n'
  53. ..'local V = peripheral.wrap("back").canvas()\n'
  54. ..'local T = {}\n'
  55. ..'local CRF = 0\n'
  56. ..'local MRF = 0\n'
  57. ..'local RCRF = 0\n'
  58. ..'local RMRF = 0\n'
  59. ..'local ID = "NA"\n'
  60. ..'V.clear()\n'
  61. ..'local BOX = V.addRectangle(2+353,2+270,154,14,0x777777FF)\n'
  62. ..'local BX2 = V.addRectangle(3+353,3+270,152,12,0x00ff0055)\n'
  63. ..'local TXT = V.addText({5+353,5+270},"")\n'
  64. ..'function hecc()\n'
  65. ..' ID, T = rednet.receive(1)\n'
  66. ..' CRF = T[1]\n'
  67. ..' MRF = T[2]\n'
  68. ..' RCRF = T[3]\n'
  69. ..' RMRF = T[4]\n'
  70. ..' BX2.setSize(152*(RCRF/RMRF),12)\n'
  71. ..' PCT = (math.floor(RCRF/RMRF*10000)/100)\n'
  72. ..' if math.floor(PCT*10)/10 == PCT and math.floor(PCT) ~= PCT then\n'
  73. ..' PCT = PCT.."0"\n'
  74. ..' elseif math.floor(PCT) == PCT then\n'
  75. ..' PCT = PCT..".00"\n'
  76. ..' end\n'
  77. ..' TXT.setText(CRF.."/"..MRF.." "..PCT.."%")\n'
  78. ..' TXT.setColor(0x77ff00ff)\n'
  79. ..'end\n'
  80. ..'while true do\n'
  81. ..' pcall(hecc)\n'
  82. ..'end\n'
  83. )
  84. NF.close()
  85. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement