Switch to edit mode.
Name(s): test21: player:tell("[HTML Gradients]") 2: player:tell() 3: player:tell("What do you want your gradient to say? (use numbers and characters)") 4: string = $command_utils:read("what you want your gradient to say") 5: strlen = length(string) 6: player:tell("How many fgcolours do you want to define? (use numbers only)") 7: fgcols = $command_utils:read("the number of fgcolours") 8: fgcols = toint(fgcols) 9: player:tell("How many bgcolours do you want to define? (use numbers only)") 10: bgcols = $command_utils:read("the number of bgcolours") 11: bgcols = toint(bgcols) 12: player:tell(" [What we have so far:") 13: player:tell(" You want: ", fgcols, " foreground colour(s).") 14: player:tell(" You want: ", bgcols, " background colour(s).") 15: player:tell(" You want: \"", string, "\" as your text.") 16: player:tell(" Which is ", strlen, " characters long.") 17: if (fgcols > strlen || bgcols > strlen) 18: player:tell("Wait a second...") 19: player:tell() 20: suspend(1) 21: if (fgcols > strlen) 22: player:tell("There are more foreground colours wanted than the number of character in the string!") 23: else 24: player:tell("There are more foreground colours wanted than the number of character in the string!") 25: endif 26: return 27: else 28: player:tell("All good so far!") 29: endif 30: fglist = "" 31: for x in [1..fgcols] 32: fglist = {@fglist, $command_utils:read(tostr("input foreground colour #", x))} 33: endfor 34: fgstr = fglist + strlen 35: bglist = "" 36: for x in [1..bgcols] 37: bglist = {@bglist, $command_utils:read(tostr("input background colour #", x))} 38: endfor 39: bgstr = bglist + strlen 40: if (fgcols <= 1 || bgcols <= 1 || (fgcols <= 1 && bgcols <= 1)) 41: return 42: endif 43: fggra = $gu:literal_multi_grad(fgstr) 44: bggra = $gu:literal_multi_grad(bgstr) 45: gradient = "" 46: for x in [1..strlen] 47: gradient = gradient + "<font color=#" + fggra[x] + " bgcolor=#" + bggra[x] + ">" + string[x] + "</font>" 48: endfor 49: player:tell(gradient) 50: if ($command_utils:yes_or_no(tostr("Do you want to see the html code used? (Yes || No)"))) 51: player:tell($html_utils:literal_text(gradient)) 52: else 53: return 54: endif