Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local words_to_mox = {
- ["A"] = "a4H",
- ["B"] = "bB",
- ["C"] = "cc",
- ["D"] = "dd",
- ["E"] = "3eE",
- ["F"] = "ff",
- ["G"] = "J",
- ["H"] = "H",
- ["I"] = "ii",
- ["J"] = "g",
- ["K"] = "Q",
- ["L"] = "Lll",
- ["M"] = "mMm",
- ["N"] = "Ñ",
- ["Ñ"] = "N",
- ["O"] = "o0O",
- ["P"] = "9",
- ["Q"] = "K",
- ["R"] = "rrR",
- ["S"] = "zS",
- ["T"] = "7T",
- ["U"] = "uU",
- ["V"] = "V",
- ["W"] = "ww",
- ["X"] = "xxX",
- ["Y"] = "iIii",
- ["Z"] = "sSS"
- }
- local words_to_flai = {
- ["A"] = "áá",
- ["B"] = "v",
- ["C"] = "C",
- ["D"] = "D",
- ["E"] = "è",
- ["F"] = "F",
- ["G"] = "G",
- ["H"] = "",
- ["I"] = "ííí",
- ["J"] = "J",
- ["K"] = "K",
- ["L"] = "L",
- ["M"] = "M",
- ["N"] = "N",
- ["Ñ"] = "Ñ",
- ["O"] = "ó",
- ["P"] = "P",
- ["Q"] = "Q",
- ["R"] = "r",
- ["S"] = "z",
- ["T"] = "T",
- ["U"] = "úú",
- ["V"] = "b",
- ["W"] = "W",
- ["X"] = "X",
- ["Y"] = "Y",
- ["Z"] = "Z"
- }
- function show_ui(name)
- ui.addTextArea(0, "<p align='center'><a href='event:mox_trad'><b>Traductor M0X0</b></a></p>", name, 5, 370, 70, 30, 0x4c6570, 0x3e545e, 0.6, true)
- ui.addTextArea(1, "<p align='center'><a href='event:flai_trad'><b>Traductor Flaite</b></a></p>", name, 689, 370, 70, 30, 0x4c6570, 0x3e545e, 0.6, true)
- end
- function eventTextAreaCallback(id, name, callback)
- if id >= 0 and id <= 1 then
- ui.addPopup(id, 2, "Texto a traducir", name, 40, 120, 250)
- ui.addTextArea(2, "", name, 400, 120, 250, 80, 0x4c6570, 0x3e545e, 0.6, true)
- ui.addTextArea(3, "<p align='center'><b>Traducción<b></p>", name, 400, 95, 250, 15, 0x4c6570, 0x3e545e, 0.6, true)
- end
- end
- function eventPopupAnswer(id, name, answer)
- if id == 0 then
- answer = answer:upper()
- out = answer:gsub("(.)",
- function(c)
- if words_to_mox[c] then return words_to_mox[c] else return c end
- end
- )
- print('Texto de '..name..': '..out)
- ui.updateTextArea(2, out, name)
- elseif id == 1 then
- answer = answer:upper()
- out = answer:gsub("(.)",
- function(c)
- if words_to_flai[c] then return words_to_flai[c] else return c end
- end
- )
- out = out:gsub("óLáá", "WèNáá")
- print('Texto de '..name..': '..out)
- ui.updateTextArea(2, out, name)
- end
- end
- show_ui(nil)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement