Switch to edit mode.
Name(s): qwert1: if (index(args[1], "~"))
2: return $ansi_utils:strip_codes_fast(args[1])
3: endif
4: accentbin = 0
5: text = strsub(args[1], "~", "~7E")
6: text = strsub(text, "~7E7E", "~7E")
7: if (`player.beep_type == "all" ! ANY => 0' || `player.beep_type == "me" ! ANY => 0')
8: ot = text
9: text = strsub(text, "&beep;", "~07")
10: ot == text || (accentbin = 1)
11: endif
12: if (`player.esc_type == "all" ! ANY => 0' || `player.esc_type == "me" ! ANY => 0')
13: ot = text
14: text = strsub(text, "&esc;", "~1B")
15: ot == text || (accentbin = 1)
16: endif
17: "And here, begins the ANSI hack."
18: {needbin, text} = $ansi_utils:substitute(player, text)
19: if (accentbin || needbin)
20: "text = text + \"~1B[0m~0m~0A\";"
21: return text
22: else
23: return strsub(text, "~7E", "~")
24: endif