Cause I'm an asshole
Posted: Tue Jun 02, 2009 1:18 pm
So I got bored and made a lua xchat script that converts what you type into l33t before sending to the server.
Needless to say I was really bored and that avansc hated it
Code: Select all
local script_name = "l33tzorz.lua";
local script_desc = "just to fuck with people";
local script_ver = "0.1";
rep_list = { "ate", "you", "a", "o", "i", "for", "w", "e", "u", "t"}
rep_rep = { "8", "j00", "4", "0", "1", "4or", "W","E","U", "T"}
rep_alt = { "8", "u", "A", "O", "I", "f0r", "\\/\\/", "3", "u", "+"}
function replace(String)
str = String;
rep_count = 0;
if string.find(str, "!!") ~= 1 then
for i = 1, #rep_list do
str,count = string.gsub(str, rep_list[i],
math.random(2) == 2 and rep_rep[i] or rep_alt[i], string.len(String));
rep_count = rep_count + count;
end
end
return str,rep_count;
end
function me(word, word_eol)
word_eol[2],count = replace(word_eol[2]);
if count > 0 then
xchat.commandf("me %s", word_eol[2]);
return xchat.EAT_ALL;
end
return xchat.EAT_NONE;
end
function leetme(word, word_eol)
word_eol[1],count = replace(word_eol[1]);
if count > 0 then
xchat.commandf("say %s", word_eol[1]);
return xchat.EAT_ALL;
end
return xchat.EAT_NONE;
end
function xchat_register()
return script_name, script_desc, script_ver;
end
function xchat_init()
xchat.hook_command("", "leetme", xchat.PRI_NORM);
xchat.hook_command("me", "me", xchat.PRI_NORM);
end