- Fórum
- xTibia - Notícias e Suporte
- Tutoriais para Iniciantes
- Narutibia - /save automático
VI
Narutibia - /save automático
Por ViniGnR, 08 de set. de 2013 em Tutoriais para Iniciantes
otserv
tibia
script
1
768
Por ViniGnR, 08 de set. de 2013 em Tutoriais para Iniciantes
info
Grupo: Campones
Registrado: 20/08/13
Posts: 21
Reputação: +8
Iae negada, hoje estou trazendo para o Xtibia um tutorial fácil e prático.
Então pessoal, na verdade ele é um npc.
[Não tem falas apenas faz /save a cada 1 seg.].
Testado em Narutibia 7.81.
focus = 0
talk_start = 0
target = 0
following = false
attacking = false
talk_state = 0
gstat = 0 -- guild status
grank = '' -- guild rank
gname = '' -- guild name
cname = '' -- name of player who talks to us
pname = '' -- name of some other player
maxnamelen = 30
maxranklen = 20
maxnicklen = 20
leaderlevel = 50
NONE = 0
INVITED = 1
MEMBER = 2
VICE = 3
LEADER = 4
allow_pattern = '^[a-zA-Z0-9 -]+$'
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
stime = 1 -- Tempo entre as execuções do comando (em segundos).
time = os.clock()
function onThink()
if (time + stime) < os.clock() then
time = os.clock()
selfSay("/save")
end
end
<?xml version="1.0"?>
<npc name="Save Server" script="data/npc/scripts/savesv.lua" access="5" lookdir="3">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="3" head="2" body="95" legs="60" feet="132"/>
</npc>
Bom pessoal é só isso, depois é só sumonnar o npc ou então mesmo adicioná-lo no mapa do seu ot para que não tenha que estar sumonnando toda vez que ligar o seu servidor certo?