<globalevent type="start" name="XXXX" script="script.lua"/>
???
info
Grupo: Barão
Registrado: 13/07/15
Posts: 242
Reputação: +56
Char no Tibia: Sekk

<globalevent type="start" name="XXXX" script="script.lua"/>
???
info
Grupo: Visconde
Registrado: 28/06/11
Posts: 356
Reputação: +26
Char no Tibia: Akor Rysea

<globalevent type="start" name="XXXX" script="script.lua"/>???
Function é onThink.
Conseguir fazer mais está dando erro é no script mesmo, ajuda ai você entende de website.
Script (globalevent, type: think, interval: 60 or 60000 [tfs 0.4]):
function onThink()
if (tonumber(os.date("%d")) ~= getGlobalStorageValue(23456)) then
setGlobalStorageValue(23456, (tonumber(os.date("%d"))))
db.query("UPDATE `players` SET `onlinetime7`=`onlinetime6`, `onlinetime6`=`onlinetime5`, `onlinetime5`=`onlinetime4`, `onlinetime4`=`onlinetime3`, `onlinetime3`=`onlinetime2`, `onlinetime2`=`onlinetime1`, `onlinetime1`=`onlinetimetoday`, `onlinetimetoday`=0;")
db.query("UPDATE `players` SET `exphist7`=`exphist6`, `exphist6`=`exphist5`, `exphist5`=`exphist4`, `exphist4`=`exphist3`, `exphist3`=`exphist2`, `exphist2`=`exphist1`, `exphist1`=`experience`-`exphist_lastexp`, `exphist_lastexp`=`experience`;")
end
db.query("UPDATE `players` SET `onlinetimetoday`=`onlinetimetoday`+60, `onlinetimeall`=`onlinetimeall`+60 WHERE `online` = 1;")
end
MySQL:
ALTER TABLE `players` ADD `exphist_lastexp` BIGINT( 20 ) NOT NULL DEFAULT '0',
ADD `exphist1` BIGINT( 20 ) NOT NULL DEFAULT '0',
ADD `exphist2` BIGINT( 20 ) NOT NULL DEFAULT '0',
ADD `exphist3` BIGINT( 20 ) NOT NULL DEFAULT '0',
ADD `exphist4` BIGINT( 20 ) NOT NULL DEFAULT '0',
ADD `exphist5` BIGINT( 20 ) NOT NULL DEFAULT '0',
ADD `exphist6` BIGINT( 20 ) NOT NULL DEFAULT '0',
ADD `exphist7` BIGINT( 20 ) NOT NULL DEFAULT '0',
ADD `onlinetimetoday` BIGINT( 20 ) NOT NULL DEFAULT '0',
ADD `onlinetime1` BIGINT( 20 ) NOT NULL DEFAULT '0',
ADD `onlinetime2` BIGINT( 20 ) NOT NULL DEFAULT '0',
ADD `onlinetime3` BIGINT( 20 ) NOT NULL DEFAULT '0',
ADD `onlinetime4` BIGINT( 20 ) NOT NULL DEFAULT '0',
ADD `onlinetime5` BIGINT( 20 ) NOT NULL DEFAULT '0',
ADD `onlinetime6` BIGINT( 20 ) NOT NULL DEFAULT '0',
ADD `onlinetime7` BIGINT( 20 ) NOT NULL DEFAULT '0',
ADD `onlinetimeall` BIGINT( 20 ) NOT NULL DEFAULT '0';
info
Grupo: Diretor
Registrado: 12/05/12
Posts: 818
Reputação: +578
Gênero: Masculino
Char no Tibia: [ADM] Night

Informe o erro...
Tente assim:
function onThink()
if (tonumber(os.date("%d")) ~= getGlobalStorageValue(23456)) then
setGlobalStorageValue(23456, (tonumber(os.date("%d"))))
db.executeQuery("UPDATE `players` SET `onlinetime7`=`onlinetime6`, `onlinetime6`=`onlinetime5`, `onlinetime5`=`onlinetime4`, `onlinetime4`=`onlinetime3`, `onlinetime3`=`onlinetime2`, `onlinetime2`=`onlinetime1`, `onlinetime1`=`onlinetimetoday`, `onlinetimetoday`=0;")
db.executeQuery("UPDATE `players` SET `exphist7`=`exphist6`, `exphist6`=`exphist5`, `exphist5`=`exphist4`, `exphist4`=`exphist3`, `exphist3`=`exphist2`, `exphist2`=`exphist1`, `exphist1`=`experience`-`exphist_lastexp`, `exphist_lastexp`=`experience`;")
end
db.executeQuery("UPDATE `players` SET `onlinetimetoday`=`onlinetimetoday`+60, `onlinetimeall`=`onlinetimeall`+60 WHERE `online` = 1;")
end
info
Grupo: Visconde
Registrado: 28/06/11
Posts: 356
Reputação: +26
Char no Tibia: Akor Rysea

Informe o erro...
Tente assim:
function onThink() if (tonumber(os.date("%d")) ~= getGlobalStorageValue(23456)) then setGlobalStorageValue(23456, (tonumber(os.date("%d")))) db.executeQuery("UPDATE `players` SET `onlinetime7`=`onlinetime6`, `onlinetime6`=`onlinetime5`, `onlinetime5`=`onlinetime4`, `onlinetime4`=`onlinetime3`, `onlinetime3`=`onlinetime2`, `onlinetime2`=`onlinetime1`, `onlinetime1`=`onlinetimetoday`, `onlinetimetoday`=0;") db.executeQuery("UPDATE `players` SET `exphist7`=`exphist6`, `exphist6`=`exphist5`, `exphist5`=`exphist4`, `exphist4`=`exphist3`, `exphist3`=`exphist2`, `exphist2`=`exphist1`, `exphist1`=`experience`-`exphist_lastexp`, `exphist_lastexp`=`experience`;") end db.executeQuery("UPDATE `players` SET `onlinetimetoday`=`onlinetimetoday`+60, `onlinetimeall`=`onlinetimeall`+60 WHERE `online` = 1;") end
aqui o erro:
info
Grupo: Herói
Registrado: 25/02/07
Posts: 859
Reputação: +331
Gênero: Masculino

Coluna online não existe ali.
info
Grupo: Visconde
Registrado: 28/06/11
Posts: 356
Reputação: +26
Char no Tibia: Akor Rysea

Coluna online não existe ali.
Manda a coluna pra mim adicionar ai mano ![]()
info
Grupo: Herói
Registrado: 25/02/07
Posts: 859
Reputação: +331
Gênero: Masculino

Manda a coluna pra mim adicionar ai mano
Abre seu banco de dados e ve se em players tem uma coluna chamada "online"
info
Grupo: Visconde
Registrado: 28/06/11
Posts: 356
Reputação: +26
Char no Tibia: Akor Rysea

Tem não.Abre seu banco de dados e ve se em players tem uma coluna chamada "online"
info
Grupo: Herói
Registrado: 25/02/07
Posts: 859
Reputação: +331
Gênero: Masculino

Tem não.
O erro ta ai, então. rs mas não sei arrumar isso não, pq mesmo que você crie uma coluna online tem que mandar o servidor atualizar ela quando o player estiver online e quando ele deixar de estar.
Editado Fevereiro 10 por Skulls
info
Grupo: Herói
Registrado: 14/02/14
Posts: 341
Reputação: +285
Gênero: Masculino
Char no Tibia: Night Wolf

a tag é assim
<globalevent name="xxxx" interval="60" event="script" value="yyyyyy.lua"/>
info
Grupo: Visconde
Registrado: 28/06/11
Posts: 356
Reputação: +26
Char no Tibia: Akor Rysea
Alguém poderia criar uma tag para este script:
function onThink() if (tonumber(os.date("%d")) ~= getGlobalStorageValue(23456)) then setGlobalStorageValue(23456, (tonumber(os.date("%d")))) db.executeQuery("UPDATE `players` SET `onlinetime7`=`onlinetime6`, `onlinetime6`=`onlinetime5`, `onlinetime5`=`onlinetime4`, `onlinetime4`=`onlinetime3`, `onlinetime3`=`onlinetime2`, `onlinetime2`=`onlinetime1`, `onlinetime1`=`onlinetimetoday`, `onlinetimetoday`=0;") db.executeQuery("UPDATE `players` SET `exphist7`=`exphist6`, `exphist6`=`exphist5`, `exphist5`=`exphist4`, `exphist4`=`exphist3`, `exphist3`=`exphist2`, `exphist2`=`exphist1`, `exphist1`=`experience`-`exphist_lastexp`, `exphist_lastexp`=`experience`;") end db.executeQuery("UPDATE `players` SET `onlinetimetoday`=`onlinetimetoday`+60, `onlinetimeall`=`onlinetimeall`+60 WHERE `online` = 1;") endJá tentei varias vezes e ainda não funcionou.