Forum
Scripts
Stop @C
Stop @C
14 replies
1

if txt:sub(#txt-1,#txt) == "@C" then txt = txt:sub(1,#txt-2) end
1
text:gsub('@C', '')
Rainoth: thanks
Gaios: If a user wrote his E-mail in capital and his E-mail's hosting service name started with 'c', his E-mail wouldn't be displayed correctly. Appending the
$magic character to the pattern makes sure that the "@C" is written at the end of the string, thus preventing such cases to happen (even though they're not likely to happen, but still).
THEMUD: said. @C must only be replaced at the end of the message, because this message will be valid: "Hello@C my message"1
string.gsub(chatmessage_variable, "@C$", "@C ")
1
string.gsub(chatmessage_variable, "^\169%d%d%d%d%d%d%d%d%d", " %1")
But instead of deleting the @C or colorcode, I place a space " " in the end or in the beginning in the message, so these codes have no meaning to cs2d
Rainoth: Hey@C@C
Yates: So everyones code is sh*t XD.. unless nobody will care about e-mails, so mine
The people that usually find out these loop-holes and try to break things are idiots. Logical thinking is not one of their strong feats, so they try things like @C@C. It is within their nature.
Took them 5 minutes to figure out @C@C worked on my server after I patched it to remove the last instance like you did.
1
2
3
4
5
6
7
2
3
4
5
6
7
function escapeString(text) 	if string.sub(text, -2) == "@C" then 		text = string.sub(text, 1, string.len(text) - 2) 	end 	text = string.gsub(text, "[\166]", " ") 	return text end
Hajt: read the replies above, your code will miss "@C@C" just like
Rainoth's first answer.@
Yates: No, these people are true legends. They find the impossible. Their logic exceeded your logic and they outsmarted your system.The people who find the deepest & elegant loopholes have my respect.
Also regarding "@C@C" - when you add a space to the end of the message, it will look very weird in chat, because it must have worked!!1111
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
local txt = 'Remove Kebab@C@C@C' while txt:sub(-2) == '@C' do txt = txt:sub(1, -3) end print(txt) -- Remove Kebab
VADemon: It's not called idiot proofing for a reason
1

Offline