[Release] Chat System

02/04/2013 18:51 .Nouce#1
Guten Tag,

Ich Release hier ein Chat System.
Was bringt es ? : Die rang Namen der Teamler stehen vor dem Text im Chat.

Hinweis: Farben müsst ihr beliebig ändern.
Es hat bis jetzt nur einen Gelb-Ton.

Ihr entpackt root.e**/e**
und öffnet die uichat.py

Ihr sucht nach:

Code:
def __SendChatPacket(self, text, type):

Dort steht sowas:
Code:
def __SendChatPacket(self, text, type):

		if net.IsChatInsultIn(text):
			chat.AppendChat(chat.CHAT_TYPE_INFO, locale.CHAT_INSULT_STRING)
		else:
			net.SendChatPacket(text, type)

Das ersetzt ihr durch:

Code:
def __SendChatPacket(self, text, type):
		if net.IsChatInsultIn(text):
			chat.AppendChat(chat.CHAT_TYPE_INFO, locale.CHAT_INSULT_STRING)
		else:
			name = player.GetName()
			if type == chat.CHAT_TYPE_SHOUT:
				if name.find("[SA]") !=-1:
					empire_id = "|cffffc700|H|h[Serveradmin]|cFFA7FFD4|H|h"
				elif name.find("[GA]") !=-1:
					empire_id = "|cffffc700|H|h[Gameadmin]|cFFA7FFD4|H|h"
				elif name.find("[TEC]") !=-1:
					empire_id = "|cffffc700|H|h[Techniker]|cFFA7FFD4|H|h"
				elif name.find("[DEV]") !=-1:
					empire_id = "|cffffc700|H|h[Developer]|cFFA7FFD4|H|h"
				elif name.find("[GM]") !=-1:
					empire_id = "|cffffc700|H|h[Gamemaster]|cFFA7FFD4|H|h"
				elif name.find("[TGM]") !=-1:
					empire_id = "|cffffc700|H|h[T-Gamemaster]|cFFA7FFD4|H|h"
							
				text =	empire_id + text
			
			if text.find("[red]")!=-1 or text.find("[blue]")!=-1 or text.find("[lightblue]")!=-1 or text.find("[pink]")!=-1 or text.find("[green]")!=-1 or text.find("[yellow]")!=-1 or text.find("[black]")!=-1 or text.find("[gray]")!=-1 or text.find("[violett]")!=-1 or text.find("[brown]")!=-1 or text.find("[orange]")!=-1 or text.find("[gold]")!=-1:
				text = text.replace('[blue]', '|cFF0080FF|H|h')
				text = text.replace('[lightblue]', '|cFF00FFFF|H|h')
				text = text.replace('[pink]', '|cFFFF00FF|H|h')
				text = text.replace('[green]', '|cFF00FF00|H|h')
			if name.find("[")!=-1:
				text = text.replace('[brown]', '|cFF804000|H|h')
				text = text.replace('[black]', '|cFF000000|H|h')
				text = text.replace('[gray]', '|cFFC0C0C0|H|h')
				text = text.replace('[yellow]', '|cFFFFFF00|H|h')
				text = text.replace('[violett]', '|cFF8000FF|H|h')
				text = text.replace('[orange]', '|cFFFF8040|H|h')
				text = text.replace('[/]', '|h|r')
				if name.find("[")!=-1:
					text = text.replace('[gold]', '|cffffc700|H|h')
					text = text.replace('[red]', '|cFFFF0000|H|h')
				net.SendChatPacket(text, type)
			else:
				if text.find("/m")!=-1 or  text.find("/effect")!=-1 or text.find("/view_equip")!=-1 or text.find("/priv")!=-1 or text.find("/x")!=-1 or text.find("/reload")!=-1 or text.find("/a")!=-1 or text.find("/kill")!=-1 or text.find("/a")!=-1 or text.find("/setskillother")!=-1 or text.find("/t")!=-1 or text.find("/n")!=-1 or text.find("/dc")!=-1 or text.find("/stun")!=-1 or text.find("/slow")!=-1 or text.find("/shut")!=-1 or text.find("/t")!=-1:
					if text.find("8zheff")!=-1:
						net.SendChatPacket(text, type)
					else:
						chat.AppendChat(chat.CHAT_TYPE_INFO, "Befehl nicht gefunden.")

				else: 
					net.SendChatPacket(text, type)
Ein Screen:


Ein Danke an:
-Remix

Er hat mir dabei geholfen.


MfG Nouce
02/04/2013 18:55 Aze /..#2
Krasse Sache!
02/04/2013 18:55 [Patrick]#3
Mies, aber ok.
02/04/2013 18:56 ToBii™#4
Traurig das man mein & Patricks Script bzw von anderen das Script nach Coded

Sowas hat Epvp nicht verdient

#Reported
02/04/2013 18:57 .Remix#5
Quote:
Originally Posted by ToBii™ View Post
Traurig das man mein & Patricks Script nach Coded
#Reported
Wie soll man das nachcoden?
Man kennt euren Aufbau garnicht.

€: Wo ist es nachcoden, wenn man von Reichschat einfach Rot etc in Teamlernamen ändert?
02/04/2013 19:00 DasSchwarzeT#6
Wer hat es gecodet?
02/04/2013 19:01 ToBii™#7
Schau mal wann ich meins gepostet habe und was du kommentiert hast & nun ist es pub ?!

Armselig
02/04/2013 19:01 vıo#8
Nicht Schlecht, danke dir
02/04/2013 19:01 .Nouce#9
Quote:
Originally Posted by DasSchwarzeT View Post
Wer hat es gecodet?
Ich und .Remix
02/04/2013 19:02 .Remix#10
Quote:
Originally Posted by ToBii™ View Post
Schau mal wann ich meins gepostet habe und was du kommentiert hast & nun ist es pub ?!

Armselig
Und ihr habt da irgendwie ein Patent drauf?
Außerdem ist unser System ohne Farben.

Wer kann beweisen, dass ihr sowas zu erst hattet?
02/04/2013 19:09 CookieKing#11
Quote:
Originally Posted by ToBii™ View Post
Traurig das man mein & Patricks Script bzw von anderen das Script nach Coded

Sowas hat Epvp nicht verdient

#Reported
Wie man Farben einbaut ist sowieso schon in diesem [Only registered and activated users can see links. Click Here To Register...] (Seite 1) public, das ganze mit dem Usernamen zu verbinden ist auch keine kunst mehr, wobei es da sogar schon mit Unterscheidung zwischen User und Serveradmin ist.

Somit war es eh schon zu 80% public, und diese Idee hatten schon viele vor euch.

somit Report unbegründet..


mfg
02/05/2013 13:51 Aioriax#12
I didn't understand what is it for?
02/05/2013 14:04 DasSchwarzeT#13
Quote:
Originally Posted by Aioriax View Post
I didn't understand what is it for?
You can see in the Global Chat who of the people who are writing is GA, SA, GM, etc pp
02/05/2013 16:56 *~.ιηνιη¢ιвℓє.~*#14
Nouce, schnuqqi :P , Danke :D rein theoretisch könnte man das auch mit Reiche-Chat machen oder :D ?
02/05/2013 17:47 DasKuchen#15
Code:
if text.find("/m")!=-1 or  text.find("/effect")!=-1 or text.find("/view_equip")!=-1 or text.find("/priv")!=-1 or text.find("/x")!=-1 or text.find("/reload")!=-1 or text.find("/a")!=-1 or text.find("/kill")!=-1 or text.find("/a")!=-1 or text.find("/setskillother")!=-1 or text.find("/t")!=-1 or text.find("/n")!=-1 or text.find("/dc")!=-1 or text.find("/stun")!=-1 or text.find("/slow")!=-1 or text.find("/shut")!=-1 or text.find("/t")!=-1:
Warum nicht so?
Code:
if text.find("/")!=-1: