Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --rainbow text in computercraft 1.7
- screen = "" --the screen you want to print the reainbowtext on use peripheral.warp("side") to use a monitor
- pos{} --the place where you start yo write
- pos[1] = ""
- pos[2] = ""
- text = "" -- whatever you want to write
- function ClearScreen(screen, pos[1], pos[2])
- screen.clear()
- screen.setCursorPos(pos[1], pos[2])
- end
- function rainbowText(text, screen, pos[1], pos[2])
- for i = 1, 8 do
- if i == 1 then
- color = "red"
- elseif i == 2 then
- color = "orange"
- elseif i == 3 then
- color = "yellow"
- elseif i == 4 then
- color = "green"
- elseif i == 5 then
- color = "blue"
- elseif i == 6 then
- color = "purple"
- elseif i == 7 then
- color = "magenta"
- end
- screen.setTextColor(colors[color])
- clearScreen(screen, pos[1], pos[2])
- screen.write(text)
- end
- end
- while true do
- rainbowText("hi",term,1,1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement