Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local replacements = {
- ["a"] = "4", ["A"] = "4",
- ["e"] = "3", ["E"] = "3",
- ["i"] = "1", ["I"] = "1",
- ["o"] = "0", ["O"] = "0",
- ["s"] = "$", ["S"] = "$",
- ["t"] = "7", ["T"] = "7"
- }
- local function convertToLeet(str)
- local result = ""
- for i = 1, #str do
- local char = str:sub(i, i)
- result = result .. (replacements[char] or char)
- end
- return result
- end
- local function processControls(comp)
- if not comp then return end
- local success, count = pcall(function() return comp.ComponentCount end)
- if not success then return end
- for i = 0, count - 1 do
- local child = comp.Component
- if child then
- local cls = child.ClassName
- if cls ~= "TEdit" and cls ~= "TMemo" and cls ~= "TRichEdit" then
- pcall(function()
- if child.Caption and child.Caption ~= "" then
- child.Caption = convertToLeet(child.Caption)
- end
- if cls == "TComboBox" or cls == "TListBox" then
- for j = 0, child.Items.Count - 1 do
- child.Items[j] = convertToLeet(child.Items[j])
- end
- end
- end)
- end
- processControls(child)
- end
- end
- end
- local fCount = getFormCount()
- for i = 0, fCount - 1 do
- local form = getForm(i)
- if form then
- pcall(function() form.Caption = convertToLeet(form.Caption) end)
- processControls(form)
- end
- end
- collectgarbage("collect")
Advertisement
Add Comment
Please, Sign In to add comment