Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- InstallDir = ...
- if InstallDir == nil then InstallDir = '/' end
- term.clear()
- term.setCursorPos(1,1)
- print('Do you wish to install cht.lua? (Y/N)')
- local x = read()
- if x == 'y' or x == 'Y' then
- local NF = fs.open(InstallDir..'/cht.lua','w')
- NF.write(''
- ..'rednet.open("front")\n'
- ..'CH = peripheral.wrap("back")\n'
- ..'Token = "aa679-23b"\n'
- ..'Info = {}\n'
- ..'CH.capture("![Oo]pen")\n'
- ..'CH.capture("![Cc]lose")\n'
- ..'while true do\n'
- ..' _, Info[1], Info[3], Info[2], Info[4] = os.pullEvent("chat_capture")\n'
- ..' if Info[3] == "![Oo]pen" then\n'
- ..' rednet.send(27,{Token,Info[4],"Pos"})\n'
- ..' print("Sent")\n'
- ..' end\n'
- ..' if Info[3] == "![Cc]lose" then\n'
- ..' rednet.send(27,{Token,Info[4],"Neg"})\n'
- ..' print("Sent")\n'
- ..' end\n'
- ..' ID, MSG = rednet.receive(10)\n'
- ..' if MSG == "Yote" then\n'
- ..' CH.tell("Hyeh")\n'
- ..' end\n'
- ..' sleep(1)\n'
- ..' print(Info[3])\n'
- ..'end\n'
- )
- NF.close()
- end
- InstallDir = ...
- if InstallDir == nil then InstallDir = '/' end
- term.clear()
- term.setCursorPos(1,1)
- print('Do you wish to install pwr? (Y/N)')
- local x = read()
- if x == 'y' or x == 'Y' then
- local NF = fs.open(InstallDir..'/pwr','w')
- NF.write(''
- ..'rednet.open("front")\n'
- ..'local V = peripheral.wrap("back").canvas()\n'
- ..'local T = {}\n'
- ..'local CRF = 0\n'
- ..'local MRF = 0\n'
- ..'local RCRF = 0\n'
- ..'local RMRF = 0\n'
- ..'local ID = "NA"\n'
- ..'V.clear()\n'
- ..'local BOX = V.addRectangle(2+353,2+270,154,14,0x777777FF)\n'
- ..'local BX2 = V.addRectangle(3+353,3+270,152,12,0x00ff0055)\n'
- ..'local TXT = V.addText({5+353,5+270},"")\n'
- ..'function hecc()\n'
- ..' ID, T = rednet.receive(1)\n'
- ..' CRF = T[1]\n'
- ..' MRF = T[2]\n'
- ..' RCRF = T[3]\n'
- ..' RMRF = T[4]\n'
- ..' BX2.setSize(152*(RCRF/RMRF),12)\n'
- ..' PCT = (math.floor(RCRF/RMRF*10000)/100)\n'
- ..' if math.floor(PCT*10)/10 == PCT and math.floor(PCT) ~= PCT then\n'
- ..' PCT = PCT.."0"\n'
- ..' elseif math.floor(PCT) == PCT then\n'
- ..' PCT = PCT..".00"\n'
- ..' end\n'
- ..' TXT.setText(CRF.."/"..MRF.." "..PCT.."%")\n'
- ..' TXT.setColor(0x77ff00ff)\n'
- ..'end\n'
- ..'while true do\n'
- ..' pcall(hecc)\n'
- ..'end\n'
- )
- NF.close()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement