Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- str = "la<2>lal<4>ala<8>l<E>al<16>ala<32>lala"
- pos = 1
- term.setTextColor(colors.white)
- abbruch = false
- 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
- term.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
- term.setTextColor(tonumber(col))
- elseif col == "E" then
- print("")
- end
- if stelleE then
- pos = stelleE+1
- end
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement