Sometimes when use non english letters like: ö ä å, sometimes the chat changes like:
[New] playername: miss ä sä sit oot töissä but it suppose to show: [New] playername: missä sä sit oot töissä, only appers happens when use once the letter in same word.
The chat modifer uses SayFilter
Syntax: Select all
@SayFilter
def say_filter(command, index, teamonly):
userid = None
if index:
try:
userid = rpglib.useridFromIndex(index)
except ValueError:
userid = None
if userid and command:
text = command[0].replace('!', '', 1).replace('/', '', 1).lower()
args = command.arg_string
name = rpglib.get_name(userid)
return ratinghandler.modified_chat(name, rpglib.getTeam(userid), stattrack.get_player_rating(userid), command[0] + ' ' + args, text)
Ratinghandler code:
Syntax: Select all
import rpglib
# ========================================
# COLORS
# ========================================
if rpglib.gamename() == 'csgo':
team_colors = {
2: '\x0F',
3: '\x0B'
}
else:
team_colors = {
2: '\x07FF3D3D',
3: '\x079BCDFF'
}
title_colors = {
0: 'pale_green',
10: 'green',
255: 'grey',
1115: 'yellow',
3365: 'light_blue',
6785: 'red',
13055: 'orange',
21750: 'white',
40000: 'purple'
}
# ========================================
# RATING TITLES
# ========================================
titles = {
0: 'new',
10: 'trainee',
255: 'silver',
1115: 'gold',
3365: 'diamond',
6785: 'master',
13055: 'insane',
21750: 'heroic',
40000: 'olympic'
}
# ========================================
# METHODS
# ========================================
"""
Chat modifier
"""
def modified_chat(name, team, rating, text, text_command):
chat_string = '{}[{}] {}{}:\x01 {}'.format(get_title_color(rating), get_title(rating), get_team_color(team), name, text)
for i in rpglib.getUseridList():
rpglib.tell(i, chat_string, False, True)
return False
"""
Returns team color
"""
def get_team_color(team):
if team in team_colors:
return team_colors[team]
if rpglib.gamename() == 'csgo':
return '\x08'
else:
return '\x07CDCDCD'
"""
Returns title from given rating
"""
def get_title(rating):
title = 'new'
for i in sorted(titles):
if rating >= i:
title = titles[i]
return title.capitalize()
"""
Returns title color from given rating
"""
def get_title_color(rating):
if rpglib.gamename() == 'csgo':
_color = '\x08'
else:
_color = '\x07CDCDCD'
for i in sorted(title_colors):
if rating >= i:
_color = title_colors[i]
return rpglib.get_chat_color(_color)
Do you have any clue why it splits sometimes a letter when use those certain letters?