[Tutorial] Como editar texto em .lua com acentos ortográficos.

Lord Stryton
em Tutoriais de Scripting

Lord Stryton

Programador
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 13/04/15Posts: 73Char no Tibia: [ADM] Harlock

Fala galera, sou o [ADM]Harlock do Pokémon Underwater, e hoje vim mostrar a vocês como por acentos quando estiver editando seus scripts. Por exemplo: Você vê; Você está vendo; Está carregando, Pokémon.

1- Primeiro baixe o Notepad ++

(Clique aqui)

Escolha um Script para editar:

local pokes = {
["Charmander"] = {level = 16, go = "Vai Charmander", back = "Volte Charmander."},
["Charmeleon"] = {level = 35, go = "Vai Charmeleon", back = "Volte Demon."},
["Charizard"] = {level = 75, go = "Vai Dragon Lord", back = "Volte Dragon Lord."},
["Mewtwo"] = {level = 8, go = "Vai Mewtwo", back = "Volte Mewtwo"},
}
 
local msgunica = false
 
function onUse(cid, item, frompos, item2, topos)
   
    local maxh = tonumber(getItemAttribute(item.uid, "poke"):match("/(.+)]"))
    local health = tonumber(getItemAttribute(item.uid, "poke"):match("%[(.-)/"))
   
    if item.itemid == pokeout then
       
        if health ~= nil and health <= 0 then
            return doPlayerSendCancel(cid, "Seu pokémon está desmaiado.")
        end
 
        if #getCreatureSummons(cid) >= 1 then
            for _,z in pairs(getCreatureSummons(cid)) do
                if getItemAttribute(item.uid, "poke"):find(getCreatureName(z)) then
                    doTransformItem(item.uid, pokein)
                    if msgunica then
                        doCreatureSay(cid, "Volte, " .. getCreatureName(z), TALKTYPE_ORANGE_1)
                    else
                        doCreatureSay(cid, pokes[getCreatureName(z)].back, TALKTYPE_ORANGE_1)
                    end
                    doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")) .. " HP = ["..getCreatureHealth(z).."/"..getCreatureMaxHealth(z).."]")
                    setPlayerStorageValue(cid, 61204, 0)
                    doSendMagicEffect(getCreaturePosition(z), 10)
                    return doRemoveCreature(z)
                end
            end
        end
 
    elseif item.itemid == pokein then
 
        if not canSummon(cid) then
            return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)
        end
       
        if getPlayerStorageValue(cid, 63215) >= 1 then
            return doPlayerSendCancel(cid, "Você não pode usar seu pokémon enquanto estiver surfando.")
        end
 
        if getPlayerStorageValue(cid, 62314) >= 1 then
            return doPlayerSendCancel(cid, "Você não pode usar seu pokémon enquanto estiver voando.")
        end
 
        if getPlayerStorageValue(cid, 59987) >= 1 then
            return doPlayerSendCancel(cid, "Você não pode usar seu pokémon enquanto estiver montando.")
        end
   
        for i,x in pairs(pokes) do
            if #getCreatureSummons(cid) >= 1 then
                return doPlayerSendCancel(cid, "Você já chamou um pokémon..")
            end
           
            if i == getItemAttribute(item.uid, "poke"):sub(9, findLetter(getItemAttribute(item.uid, "poke"), "'")-1) then
                if getPlayerLevel(cid) >= x.level then
                    pk =  doSummonCreature(i, getThingPosition(cid))
                    doConvinceCreature(cid, pk)
                    setCreatureMaxHealth(pk, tonumber(getItemAttribute(item.uid, "poke"):match("/(.+)]")))
                    doCreatureAddHealth(pk, maxh)
                    doCreatureAddHealth(pk, health-maxh)
                    doTransformItem(item.uid, pokeout)
                    if msgunica then
                        doCreatureSay(cid, "Vai, " .. i, TALKTYPE_ORANGE_1)
                    else
                        doCreatureSay(cid, x.go, TALKTYPE_ORANGE_1)
                    end
                    doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")))
                    doSendMagicEffect(getCreaturePosition(pk), 10)
                    setPlayerStorageValue(cid, 61204, 1)
                    registerCreatureEvent(pk, "DiePoke")
                    registerCreatureEvent(cid, "PlayerPokeDeath")
                    registerCreatureEvent(cid, "LogoutPoke")
                    break
                else
                    doPlayerSendCancel(cid, "Você precisa ser level "..x.level.." ou maior para usar este pokémon.")
                end
            end
        end
    end
return TRUE
end

2- Agora na parte superior do seu Notepad.

"Formatar" e Escolha Codificação em ANSI

Print:

 


ZQWHIrQ.png

E pronto, edite com acentos Ortográficos e salve!
[ADM] Harlock


14WgQWE.png

Venha curti o Pokémon underwater:
https://www.facebook.com/PokemonUnderwater/

Luga03

Gabriel Lucena :D
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/04/15Posts: 956Gênero: Masculino

Eu juro q n sabia disto !! kkkk eu abria o arquivo .lua com o bloco de notas e clicava em Salvar Como... e colocava decodificação ANSI kkk agora vai facilitar minha vida auehaueh vlw ae

Hello! How are you? It's fine? 

 

Okay, so you like my helps? if yes, then do you can like my post, give-me a reputation, you can't?

 

Good morning for everyone! And have a good day!

Sertthoon

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 03/12/09Posts: 37Char no Tibia: varios

Parabens cara, muito bom

Lordbaxx

Imperium Project
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 01/07/13Posts: 521

É algo bem simples e que eu particularmente já sabia á bastante tempo, mas é bom mostrar os conhecimentos para quem ainda não sabe. Bom conteúdo!

 

Atenciosamente, Douglas!

LOGO OFICIAL.png