Register for your free account! | Forgot your password?

You last visited: Today at 14:35

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[RELEASE]Dynamic say->color

Discussion on [RELEASE]Dynamic say->color within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2009
Posts: 103
Received Thanks: 53
Thumbs up [RELEASE]Dynamic say->color

Hello,
I've been gone for a long time.
I want to do something. This is questlib.lua for say function I'm create class.
Source code:
PHP Code:
-- poXavincS from first published to elitepvpers.com
-- 19/11/.12

SAY 
= {}
SAY.__index SAY

function SAY.color(name,rgb=nil,_or=nil)
    ::
start::
    
cssColors = {
        
"AliceBlue" = {240,248,255},
        
"AntiqueWhite" = {250,235,215},
        
"Aqua" = {0,255,255},
        
"Aquamarine" = {127,255,212},
        
"Azure" = {240,255,255},
        
"Beige" = {245,245,220},
        
"Bisque" = {255,228,196},
        
"Black" = {0,0,0},
        
"BlanchedAlmond" = {255,235,205},
        
"Blue" = {0,0,255},
        
"BlueViolet" = {138,43,226},
        
"Brown" = {165,42,42},
        
"BurlyWood" = {222,184,135},
        
"CadetBlue" = {95,158,160},
        
"Chartreuse" = {127,255,0},
        
"Chocolate" = {210,105,30},
        
"Coral" = {255,127,80},
        
"CornflowerBlue" = {100,149,237},
        
"Cornsilk" = {255,248,220},
        
"Crimson" = {220,20,60},
        
"Cyan" = {0,255,255},
        
"DarkBlue" = {0,0,139},
        
"DarkCyan" = {0,139,139},
        
"DarkGoldenRod" = {184,134,11},
        
"DarkGray" = {169,169,169},
        
"DarkGrey" = {169,169,169},
        
"DarkGreen" = {0,100,0},
        
"DarkKhaki" = {189,183,107},
        
"DarkMagenta" = {139,0,139},
        
"DarkOliveGreen" = {85,107,47},
        
"Darkorange" = {255,140,0},
        
"DarkOrchid" = {153,50,204},
        
"DarkRed" = {139,0,0},
        
"DarkSalmon" = {233,150,122},
        
"DarkSeaGreen" = {143,188,143},
        
"DarkSlateBlue" = {72,61,139},
        
"DarkSlateGray" = {47,79,79},
        
"DarkSlateGrey" = {47,79,79},
        
"DarkTurquoise" = {0,206,209},
        
"DarkViolet" = {148,0,211},
        
"DeepPink" = {255,20,147},
        
"DeepSkyBlue" = {0,191,255},
        
"DimGray" = {105,105,105},
        
"DimGrey" = {105,105,105},
        
"DodgerBlue" = {30,144,255},
        
"FireBrick" = {178,34,34},
        
"FloralWhite" = {255,250,240},
        
"ForestGreen" = {34,139,34},
        
"Fuchsia" = {255,0,255},
        
"Gainsboro" = {220,220,220},
        
"GhostWhite" = {248,248,255},
        
"Gold" = {255,215,0},
        
"GoldenRod" = {218,165,32},
        
"Gray" = {128,128,128},
        
"Grey" = {128,128,128},
        
"Green" = {0,128,0},
        
"GreenYellow" = {173,255,47},
        
"HoneyDew" = {240,255,240},
        
"HotPink" = {255,105,180},
        
"IndianRed " = {205,92,92},
        
"Indigo " = {75,0,130},
        
"Ivory" = {255,255,240},
        
"Khaki" = {240,230,140},
        
"Lavender" = {230,230,250},
        
"LavenderBlush" = {255,240,245},
        
"LawnGreen" = {124,252,0},
        
"LemonChiffon" = {255,250,205},
        
"LightBlue" = {173,216,230},
        
"LightCoral" = {240,128,128},
        
"LightCyan" = {224,255,255},
        
"LightGoldenRodYellow" = {250,250,210},
        
"LightGray" = {211,211,211},
        
"LightGrey" = {211,211,211},
        
"LightGreen" = {144,238,144},
        
"LightPink" = {255,182,193},
        
"LightSalmon" = {255,160,122},
        
"LightSeaGreen" = {32,178,170},
        
"LightSkyBlue" = {135,206,250},
        
"LightSlateGray" = {119,136,153},
        
"LightSlateGrey" = {119,136,153},
        
"LightSteelBlue" = {176,196,222},
        
"LightYellow" = {255,255,224},
        
"Lime" = {0,255,0},
        
"LimeGreen" = {50,205,50},
        
"Linen" = {250,240,230},
        
"Magenta" = {255,0,255},
        
"Maroon" = {128,0,0},
        
"MediumAquaMarine" = {102,205,170},
        
"MediumBlue" = {0,0,205},
        
"MediumOrchid" = {186,85,211},
        
"MediumPurple" = {147,112,219},
        
"MediumSeaGreen" = {60,179,113},
        
"MediumSlateBlue" = {123,104,238},
        
"MediumSpringGreen" = {0,250,154},
        
"MediumTurquoise" = {72,209,204},
        
"MediumVioletRed" = {199,21,133},
        
"MidnightBlue" = {25,25,112},
        
"MintCream" = {245,255,250},
        
"MistyRose" = {255,228,225},
        
"Moccasin" = {255,228,181},
        
"NavajoWhite" = {255,222,173},
        
"Navy" = {0,0,128},
        
"OldLace" = {253,245,230},
        
"Olive" = {128,128,0},
        
"OliveDrab" = {107,142,35},
        
"Orange" = {255,165,0},
        
"OrangeRed" = {255,69,0},
        
"Orchid" = {218,112,214},
        
"PaleGoldenRod" = {238,232,170},
        
"PaleGreen" = {152,251,152},
        
"PaleTurquoise" = {175,238,238},
        
"PaleVioletRed" = {219,112,147},
        
"PapayaWhip" = {255,239,213},
        
"PeachPuff" = {255,218,185},
        
"Peru" = {205,133,63},
        
"Pink" = {255,192,203},
        
"Plum" = {221,160,221},
        
"PowderBlue" = {176,224,230},
        
"Purple" = {128,0,128},
        
"Red" = {255,0,0},
        
"RosyBrown" = {188,143,143},
        
"RoyalBlue" = {65,105,225},
        
"SaddleBrown" = {139,69,19},
        
"Salmon" = {250,128,114},
        
"SandyBrown" = {244,164,96},
        
"SeaGreen" = {46,139,87},
        
"SeaShell" = {255,245,238},
        
"Sienna" = {160,82,45},
        
"Silver" = {192,192,192},
        
"SkyBlue" = {135,206,235},
        
"SlateBlue" = {106,90,205},
        
"SlateGray" = {112,128,144},
        
"SlateGrey" = {112,128,144},
        
"Snow" = {255,250,250},
        
"SpringGreen" = {0,255,127},
        
"SteelBlue" = {70,130,180},
        
"Tan" = {210,180,140},
        
"Teal" = {0,128,128},
        
"Thistle" = {216,191,216},
        
"Tomato" = {255,99,71},
        
"Turquoise" = {64,224,208},
        
"Violet" = {238,130,238},
        
"Wheat" = {245,222,179},
        
"White" = {255,255,255},
        
"WhiteSmoke" = {245,245,245},
        
"Yellow" = {255,255,0},
        
"YellowGreen" = {154,205,50}
    }
    if 
name then
        
if rgb and type(rgb) == "table" then
            
return say(color256(rgb)..name..color256(rgb))
        else print(
"Is RGB color type table? For example: {255,0,255}"end
        
if _or and type(_or) == "string" then
            
for k,v in pairs(cssColors) do
                if 
== _or then
                    
return say(color256(v)..name..color256(v))
                
end
            end
            
if _or == "help" or _or == "-h" or _or == "h" then
                
for k,v in pairs(cssColors) do print(k.."\n")
            
end
        
else print("Is other colors string? For example: blue")    end
        
if rgb and _or then print("Jus one chose!") else goto start end
    end
end 
The above code, paste it into the appropriate place anywhere within questlib.lua.

For example:
PHP Code:
SAY.color("Hello elitepvpers guests",rgb={255,0,0})
SAY.color("Hello elitepvpers guests",_or="Azure"
Wrong using:
PHP Code:
SAY.color("Hello elitepvpers guests",rgb={111,22,34},_or="Azure"
Thanks for this post interest..
poXavincS is offline  
Thanks
21 Users
Old 11/19/2012, 16:42   #2
 
Pаylasici's Avatar
 
elite*gold: 99
Join Date: Aug 2009
Posts: 4,295
Received Thanks: 5,091
Welcome back and good job. Keep the good work.
Pаylasici is offline  
Old 11/19/2012, 16:43   #3


 
.Marcel''s Avatar
 
elite*gold: 100
Join Date: Sep 2009
Posts: 8,143
Received Thanks: 2,763
Very nice work. thx
.Marcel' is offline  
Old 11/19/2012, 17:35   #4


 
elite*gold: 0
Join Date: Feb 2010
Posts: 7,220
Received Thanks: 6,758
It looks nice, but I got a function like this already, still thanks.
#SoNiice is offline  
Thanks
1 User
Old 11/19/2012, 18:26   #5
 
Red Firestar's Avatar
 
elite*gold: 0
The Black Market: 185/0/0
Join Date: Jul 2012
Posts: 5,520
Received Thanks: 1,350
Nice Thanks <3
Red Firestar is offline  
Old 11/19/2012, 18:28   #6
 
wzy26022's Avatar
 
elite*gold: 0
Join Date: Feb 2010
Posts: 64
Received Thanks: 14
questlib.lua:1659: `)' expected near `='
Assertion failed: (ms_singleton), function instance, file ../../common/singleton.h, line 26.
wzy26022 is offline  
Old 11/19/2012, 18:51   #7
 
elite*gold: 0
Join Date: Apr 2012
Posts: 665
Received Thanks: 214
Thx for this.It is really nice.
LotusSky is offline  
Old 11/19/2012, 19:06   #8

 
Mr. 'Avenue™'s Avatar
 
elite*gold: 222
The Black Market: 101/0/0
Join Date: Oct 2012
Posts: 2,369
Received Thanks: 3,389
Is much easier..

PHP Code:
say_blue
say_blue2
say_red
say_green
say_gold
say_black
say_white
say_yellow 
in quest_functions

PHP Code:
function say_blue(namesay(color256(00255)..name..color256(00255)) end
function say_red(namesay(color256(25500)..name..color256(25500)) end
function say_green(namesay(color256(02380)..name..color256(02380)) end
function say_gold(namesay(color256(2552150)..name..color256(2552150)) end
function say_black(namesay(color256(000)..name..color256(000)) end
function say_white(namesay(color256(255255255)..name..color256(255255255)) end
function say_yellow(namesay(color256(2552550)..name..color256(2552550)) end
function say_blue2(namesay(color256(0206209)..name..color256(0206209)) end 
in questlib.lua

otherwise, nice..
Mr. 'Avenue™ is offline  
Thanks
1 User
Old 11/19/2012, 19:19   #9


 
elite*gold: 0
Join Date: Feb 2010
Posts: 7,220
Received Thanks: 6,758
Avenue, das ist doch was ganz anderes. Das was er hier hat, kann JEDEN RGB Code nutzen.
#SoNiice is offline  
Old 11/19/2012, 19:21   #10

 
Mr. 'Avenue™'s Avatar
 
elite*gold: 222
The Black Market: 101/0/0
Join Date: Oct 2012
Posts: 2,369
Received Thanks: 3,389
Quote:
Originally Posted by SoNiice View Post
Avenue, das ist doch was ganz anderes. Das was er hier hat, kann JEDEN RGB Code nutzen.
da kann man doch die RGB-Code's adden?!..
Mr. 'Avenue™ is offline  
Old 11/19/2012, 19:35   #11
 
elite*gold: 315
Join Date: Dec 2011
Posts: 2,905
Received Thanks: 1,066
very nice
Teh Plex is offline  
Old 11/19/2012, 19:38   #12


 
elite*gold: 0
Join Date: Feb 2010
Posts: 7,220
Received Thanks: 6,758
Quote:
Originally Posted by .Avenue™ View Post
da kann man doch die RGB-Code's adden?!..
Super, du verstehst es anscheinend nicht, hier brauchst du sie nicht adden, du kannst auch einfach den Code mit deinen RGB ausführen ohne sie neu hinzuzufügen.
#SoNiice is offline  
Old 11/19/2012, 20:33   #13
 
elite*gold: 0
Join Date: Mar 2011
Posts: 83
Received Thanks: 30
Exclamation

cool:P danke!
cody95 is offline  
Old 11/19/2012, 21:06   #14

 
Mr. 'Avenue™'s Avatar
 
elite*gold: 222
The Black Market: 101/0/0
Join Date: Oct 2012
Posts: 2,369
Received Thanks: 3,389
Quote:
Originally Posted by SoNiice View Post
Super, du verstehst es anscheinend nicht, hier brauchst du sie nicht adden, du kannst auch einfach den Code mit deinen RGB ausführen ohne sie neu hinzuzufügen.
Krass oidaaa - weil sie schon geaddet sind :*
Mr. 'Avenue™ is offline  
Old 11/28/2012, 15:40   #15
 
elite*gold: 0
Join Date: Apr 2009
Posts: 103
Received Thanks: 53
I took hex codes on using regular expressions from python and convert RGB Codes. Otherwise, you would have taken a lot of time. In addition;

PHP Code:
#-*- coding: utf-8 -*-

import re

def hex2
(value):
  
value value.lstrip('#')
  
lv len(value)
  return 
tuple(int(value[i:i+lv/3], 16) for i in range(0lvlv/3))

luaTable=""

with open("x.txt") as dosya:
    
nesne dosya.readlines()
    for 
i in nesne:
        
re.search("(.*)      #(.*)",i)
        
luaTable += '"%s" = {%s,%s,%s},\n'%(x.group(1),hex2(x.group(2))[0],hex2(x.group(2))[1],hex2(x.group(2))[2])

print 
luaTable 
I copied x.txt;

Code:
AliceBlue  	#F0F8FF
AntiqueWhite  	#FAEBD7
foo.bar..
poXavincS is offline  
Reply


Similar Threads Similar Threads
[Release]Dynamic Maps(5165 Houses)
07/28/2019 - CO2 PServer Guides & Releases - 60 Replies
Alright well I found this on another forum and I got the creator's permission to post here with all credits towards him. 100% credits to pringle, you may know him. DO NOT PRESS THANKS! THIS IS NOT MY WORK! After following my guide previous guide, then proceed with the following. in DMaps.cs under: public static ArrayList MapsNeeded = new ArrayList() { 601, 700, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1018, 1020, 1021,...
[Release]Solution for c9 Behind Router / Dynamic
12/24/2011 - SRO Private Server - 10 Replies
If you read the guide on how to run a server with a Dynamic IP or behind a router then you most likely ran into the issue with the c9 from a wan connection outside your Ip. The issue seems to be the server programs and files not being able to pass your router when a connection comes in. No matter what ports you forward or what exceptions you add anywhere. Our solution was this. If your internet is set up like this Modem > Router > Computer / Wireless PC's



All times are GMT +1. The time now is 14:35.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.