Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Werbungsprogramm gesteuert von einem Zentralrechner
- zantralid = 9773
- redside = "top"
- monside = "back"
- mon = peripheral.wrap(monside)
- function drawGUI()
- mon.clear()
- mon.setCursorPos(1,1)
- mon.setBackgroundColor(colors.white)
- x,y = mon.getSize()
- mon.setCursorPos((x-11)/2,1)
- mon.setTextColor(colors.cyan)
- mon.write("Jo")
- mon.setTextColor(colors.orange)
- mon.write("Ja")
- mon.setTextColor(colors.lightGray)
- mon.write(" Productions")
- end
- function drawText(str)
- screenPos = 3
- pos = 1
- mon.setTextColor(colors.white)
- abbruch = false
- mon.setCursorPos(1,screenPos)
- while true do
- stelleA = string.find(str,"<",pos)
- if stelleA == nil then
- substr = string.sub(str,pos)
- else
- substr = string.sub(str,pos,stelleA-1)
- end
- mon.write(substr)
- if abbruch==true then
- break
- end
- stelleE = string.find(str,">",pos)
- if stelleE then
- col = string.sub(str,stelleA+1,stelleE-1)
- else
- abbruch = true
- end
- if not string.match(col,"[a-zA-Z]+") then
- mon.setTextColor(tonumber(col))
- elseif col == "E" then
- screenPos = screenPos+1
- mon.setCursorPos(1,screenPos)
- end
- if stelleE then
- pos = stelleE+1
- end
- sleep(0.1)
- end
- end
- --mainprogram
- rednet.open(redside)
- while true do
- a, b = rednet.receive()
- if a==zentralid then
- drawGUI()
- drawText(b)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement