Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Made by Esbenmine
- term.clear()
- term.setCursorPos(1,1)
- -- ID Register List
- rednet.open("top")
- glass = peripheral.wrap("bottom")
- glass.clear()
- while true do
- boxW = 150
- boxW1 = 152
- boxY = 20
- boxH = 82
- boxH1 = 80
- text = {}
- Receive = false
- repeat
- id2, Thing = rednet.receive()
- if Thing == "@ChatBox" then
- Receive = true
- id, Username = rednet.receive() --Receive username
- id1, Message = rednet.receive() --Receive message
- else
- Receive = false
- end
- until Receive
- if id == id1 then
- for i = 1, boxH do --For loop to make the drop down box thing
- glass.addBox(23, boxY, boxW, i, 0xFFFFFF,0.8) --Adds a box
- sleep(0.1) --Wait 0.1
- glass.clear() --Clear glasses
- end --End of for loop
- glass.addBox(23, boxY, boxW, boxH, 0xFFFFFF,0.8) --Add a box
- glass.addText(52, 23, "Message received",0x000000) --Add text
- glass.addText(30, 38, Username..":".." ",0x000000) --Add text Username
- glass.addText(142, 23, "!",0xFF6A00) --Add text !
- lastY = 1
- if Message:len() > boxW/6 then --If the message is longer than the box
- for i = 1, (Message:len()/(boxW/6))+1 do --For loop
- text[i] = Message:sub(lastY,(i*(boxW/6))) --Making a line of text
- lastY = i*(boxW/6)+1 --Variable
- if i < boxH/17 then
- glass.addText(30,(((i+1)*10)+1+boxY+10),text[i], 0x000000)
- print(text[i])
- else
- glass.addText(30,(((i+1)*10)+1+boxY+10),text[i]:sub(1,(text[i]:len()-3)).."...".." ", 0x000000)
- break
- end
- end
- else
- glass.addText(30,51,Message,0x000000)
- end
- sleep(1)
- else
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement