1. Paste this code in questlib.lua
Code:
--**
--** Functions colored says
--** by BlackYuko
--**
function say_color(color, text)
local rgb = rawget(colors_data, color)
say(color256(rgb[1],rgb[2],rgb[3])..text..color256(colors_data.default[1], colors_data.default[2], colors_data.default[3]))
end
function set_text_color(color)
local rgb = rawget(colors_data, color)
raw_script(color256(rgb[1],rgb[2],rgb[3]))
end
colors_data = {
['green'] = {0,190,0},
['light green'] = {0,255,0},
['dark green'] = {0,110,0},
['semi light green'] = {144,238,144},
['teal'] = {102,205,170},
['red'] = {240,0,0},
['semi light red'] = {255,69,51},
['rose'] = {255,64,160},
['dark rose'] = {255,0,128},
['light rose'] = {255,182,193},
['light orange'] = {255,127,80},
['orange'] = {255,130,0},
['dark orange'] = {255,90,0},
['semi dark violet'] = {255,0,255},
['violet'] = {224,129,255},
['dark violet'] = {148,0,148},
['light violet'] = {200,162,200},
['brown'] = {161,63,0},
['dark brown'] = {120,66,0},
['light brown'] = {200,164,115},
['yellow'] = {255,255,53},
['light yellow'] = {255,255,128},
['gold'] = {255,191,24},
['blue'] = {0,0,250},
['dark blue'] = {0,0,150},
['cyan'] = {128,255,255},
['light cyan'] = {180,255,255},
['turquoise'] = {0,255,255},
['white'] = {255,255,225},
['gray'] = {128,128,128},
['black'] = {0,0,0},
['default'] = {196,196,196}
}
Code:
say_color set_text_color
If you want to add more colors , add in the vector "colors_data" .
How to use it :
In whichever quest , when you type a colored string , use function "say_color" .
Code:
say_color("name_color" , "text")
Code:
say_color("yellow", "This string is yellow")
say_color("red", "This string is red")
say_color("blue", "This string is blue")
say_color("light yellow", "This string is light yellow")
say_color("light red", "This string is light red")
say_color("teal", "This string is teal")
say_color("default", "This string is normal")
Result :
Well , you can see that color "standard" of text is called "default"
Secondary function :
If I want type more strings with the same color without type in every string ? Simple , you can setup the color of text with the function "set_text_color" , and next all says will be the color selected .
Example :
Code:
set_text_color("red")
say("Now it will type ever red")
say("Now it will type ever red")
say("Now it will type ever red")
say("Now it will type ever red")
set_text_color("yellow")
say("Now it will type ever yellow")
say("Now it will type ever yellow")
say("Now it will type ever yellow")
say("Now it will type ever yellow")
set_text_color("cyan")
say("Now it will type ever cyan")
say("Now it will type ever cyan")
say("Now it will type ever cyan")
say("Now it will type ever cyan")
set_text_color("default")
say("Now it will type again normal")
Credits & Thanks : BlackYuko
Release & scripts translated by crusa2
----------------------------------------
Best regards ,
crusa2
----------------------------------------






)