Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Written by epa1337
- --You can not steal this
- --Because that makes you
- --a bad person
- term.setBackgroundColor(colors.white)
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.black)
- print("USE CTRL + R TO REBOOT AT ANYTIME")
- print("")
- print("OK")
- rednet.open("back")
- local server1 = 44
- local server = 0
- rednet.broadcast("connect")
- local senderID, message, distance = rednet.receive(3)
- if message == "yes" then
- server = senderID
- end
- sleep(1)
- local signal = 0
- local speed = 45
- local version = 1
- pingTime = 1000
- untilPing = 0
- function ping()
- rednet.send(server, "connect")
- senderID, message, distance = rednet.receive(2)
- if message == "yes" then
- signal = 1
- home()
- menu()
- end
- end
- function home()
- term.setBackgroundColor(colors.white)
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.red)
- term.write("E-Phone "..version)
- term.setCursorPos(20,1)
- if signal == 1 then
- term.write("Online!")
- else
- term.setCursorPos(19,1)
- term.write("Offline!")
- end
- end
- function menu()
- term.setCursorPos(1,20)
- term.setBackgroundColor(colors.black)
- term.write("Ads")
- term.setCursorPos(23,20)
- term.write("Home")
- term.setCursorPos(6, 20)
- term.write("Chat")
- term.setCursorPos(12, 20)
- term.write("EpaNet")
- end
- function sorry()
- home()
- term.setCursorPos(1, 3)
- print("Sorry. You are connected to a repeater, you need to be near the EpaNet-building at this moment to do this. Thank you")
- sleep(4)
- home()
- menu()
- end
- function ads()
- home()
- end
- function epanet()
- home()
- menu()
- term.setCursorPos(1, 3)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.red)
- print("Send Text")
- print("Read Texts")
- print("Empty Texts")
- print("")
- print("GPS")
- print("")
- print("Maps")
- print("")
- print("Update!")
- end
- function chat()
- home()
- rednet.send(server, "chat")
- while true do
- senderID, message, distance = rednet.receive()
- if senderID == server then
- home()
- term.setCursorPos(1, 20)
- term.setBackgroundColor(colors.black)
- term.write("Write")
- term.setCursorPos(1, 2)
- term.write("Update")
- term.setCursorPos(8, 2)
- term.write("Home")
- term.setCursorPos(1, 3)
- term.setTextColor(colors.green)
- print(message)
- end
- local event, button, xPos, yPos = os.pullEvent("mouse_click")
- if (xPos > 0 and xPos < 5) and (yPos > 19 and yPos < 21) then
- term.setCursorPos(6,20)
- term.write(":")
- input = read()
- home()
- rednet.send(server, "addchatt")
- sleep(0.5)
- rednet.send(server, input)
- sleep(1)
- chat()
- end
- if (xPos > 0 and xPos < 7) and (yPos > 1 and yPos < 3) then
- chat()
- end
- if (xPos > 6 and xPos < 11) and (yPos > 1 and yPos < 3) then
- ping()
- home()
- menu()
- break
- end
- sleep(0.001)
- end
- end
- function getAds()
- rednet.send(server, "ads")
- senderID, message, distance = rednet.receive(2)
- if (senderID == server) then
- term.setCursorPos(1,3)
- print(message)
- else
- os.reboot()
- end
- end
- home()
- menu()
- ping()
- while true do
- local event, button, xPos, yPos = os.pullEvent("mouse_click")
- if event == "terminate" then
- os.reboot()
- end
- if (xPos > 0 and xPos < 11) and (yPos > 2 and yPos < 4) then
- home()
- menu()
- end
- if (xPos > 0 and xPos < 7) and (yPos > 10 and yPos < 12) then
- if server == server1 then
- rednet.send(server, "update")
- local sender,msg,dist = rednet.receive(2)
- if sender == server then
- local file = fs.open("startup", "w")
- file.write(msg)
- file.close()
- home()
- term.setCursorPos(1, 3)
- print("Updated!")
- sleep(2)
- os.reboot()
- end
- else
- sorry()
- end
- end
- if (xPos > 0 and xPos < 4) and (yPos > 19 and yPos < 21) then
- home()
- getAds()
- menu()
- end
- if (xPos > 22 and xPos < 30) and (yPos > 19 and yPos < 23) then
- ping()
- home()
- menu()
- end
- if (xPos > 5 and xPos < 11) and (yPos > 19 and yPos < 23) then
- if server == server1 then
- chat()
- else
- sorry()
- end
- end
- if (xPos > 11 and xPos < 18) and (yPos > 19 and yPos < 23) then
- epanet()
- end
- sleep(0.001)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement