EDIT:
It work with TFS 0.2.13, but you must use version compiled with parameter -D__GLOBAL_STORAGE__
You can find TFS 0.2.13 for Tibia 8.21 compiled with this parameter in my thread in "Downloads" on forum.
If you use TFS 0.2.13 replace function "historyPage" from this thread with:
If you don't know how to install it.. DON'T ASK ME! It's script for OTSes with admins who know anything about PHP and LUA!
------------------------------------------------
You must:
- use Gesior acc. maker
- use MySQL database
- use TFS 0.3 pre-alpha in version (rev.) 900 or higher EDIT: or 0.2.13 compiled with parameter "-D__GLOBAL_STORAGE__"
1. I made this script for my OTS. How it look?
http://debestia.hopto.org/index.php?subtopic=characters&name=Maxi+Rodriguez (players graphic statistics, colors and layout configurable)
http://debestia.hopto.org/index.php?subtopic=exphist (powergamers)
http://debestia.hopto.org/index.php?subtopic=onlinetime (no lifers - max. online time)
2. How to install?
1. In MySQL execute (phpmyadmin -> 'SQL'):
and:
2. If you use unmodifed login.lua file..
open TFS file .../data/creaturescripts/scripts/login.lua
delete all from this file and put:
Open file:
.../data/global.lua
and add this line:
It will save exp of all players (every 24 hours) and online time (every minute and every 24 hours) in database.
3. In folder with acc. maker unpack file:
http://debestia.hopto.org/files/pro-stats.zip
4. Now you must only add buttons with links to new pages:
exphist - exphist.php
onlinetime - onlinetime.php
How to add new links in tibia.com layout?
http://otland.net/showpost.php?p=91979&postcount=541
Layout of graphic statistics is generated by charinfo.php(data + colors/effects) and charts.php (background color)
Other graphic layouts you can find:
http://www.maani.us/charts/index.php?menu=Gallery
It work with TFS 0.2.13, but you must use version compiled with parameter -D__GLOBAL_STORAGE__
You can find TFS 0.2.13 for Tibia 8.21 compiled with this parameter in my thread in "Downloads" on forum.
If you use TFS 0.2.13 replace function "historyPage" from this thread with:
PHP:
function historyPage(parameters)
dofile("./config.lua")
env = assert(luasql.mysql())
con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))
local historyPage = addEvent(historyPage, 60000, {})
if (tonumber(os.date("%d")) ~= getGlobalStorageValue(23456)) then
setGlobalStorageValue(23456, (tonumber(os.date("%d"))))
assert(con:execute("UPDATE `players` SET `onlinetime7`=players.onlinetime6, `onlinetime6`=players.onlinetime5, `onlinetime5`=players.onlinetime4, `onlinetime4`=players.onlinetime3, `onlinetime3`=players.onlinetime2, `onlinetime2`=players.onlinetime1, `onlinetime1`=players.onlinetimetoday, `onlinetimetoday`=0;"))
assert(con:execute("UPDATE `players` SET `exphist7`=players.exphist6, `exphist6`=players.exphist5, `exphist5`=players.exphist4, `exphist4`=players.exphist3, `exphist3`=players.exphist2, `exphist2`=players.exphist1, `exphist1`=players.experience-players.exphist_lastexp, `exphist_lastexp`=players.experience;"))
end
assert(con:execute("UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1;"))
con:close()
env:close()
end
------------------------------------------------
You must:
- use Gesior acc. maker
- use MySQL database
- use TFS 0.3 pre-alpha in version (rev.) 900 or higher EDIT: or 0.2.13 compiled with parameter "-D__GLOBAL_STORAGE__"
1. I made this script for my OTS. How it look?
http://debestia.hopto.org/index.php?subtopic=characters&name=Maxi+Rodriguez (players graphic statistics, colors and layout configurable)
http://debestia.hopto.org/index.php?subtopic=exphist (powergamers)
http://debestia.hopto.org/index.php?subtopic=onlinetime (no lifers - max. online time)
2. How to install?
1. In MySQL execute (phpmyadmin -> 'SQL'):
PHP:
ALTER TABLE `players` ADD `exphist_lastexp` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `exphist1` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `exphist2` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `exphist3` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `exphist4` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `exphist5` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `exphist6` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `exphist7` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetimetoday` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime1` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime2` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime3` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime4` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime5` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime6` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime7` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetimeall` BIGINT( 255 ) NOT NULL DEFAULT '0';
PHP:
UPDATE `players` SET `exphist_lastexp`=`players`.`experience`
open TFS file .../data/creaturescripts/scripts/login.lua
delete all from this file and put:
PHP:
function onLogin(cid)
if(InitHistory == 0) then
local historyPage = addEvent(historyPage, 60000, {})
InitHistory = historyPage
end
registerCreatureEvent(cid, "PlayerDeath")
return TRUE
end
function historyPage(parameters)
local historyPage = addEvent(historyPage, 60000, {})
if (tonumber(os.date("%d")) ~= getGlobalStorageValue(23456)) then
setGlobalStorageValue(23456, (tonumber(os.date("%d"))))
db.executeQuery("UPDATE `players` SET `onlinetime7`=players.onlinetime6, `onlinetime6`=players.onlinetime5, `onlinetime5`=players.onlinetime4, `onlinetime4`=players.onlinetime3, `onlinetime3`=players.onlinetime2, `onlinetime2`=players.onlinetime1, `onlinetime1`=players.onlinetimetoday, `onlinetimetoday`=0;")
db.executeQuery("UPDATE `players` SET `exphist7`=players.exphist6, `exphist6`=players.exphist5, `exphist5`=players.exphist4, `exphist4`=players.exphist3, `exphist3`=players.exphist2, `exphist2`=players.exphist1, `exphist1`=players.experience-players.exphist_lastexp, `exphist_lastexp`=players.experience;")
end
db.executeQuery("UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1;")
end
.../data/global.lua
and add this line:
PHP:
InitHistory = 0
3. In folder with acc. maker unpack file:
http://debestia.hopto.org/files/pro-stats.zip
4. Now you must only add buttons with links to new pages:
exphist - exphist.php
onlinetime - onlinetime.php
How to add new links in tibia.com layout?
http://otland.net/showpost.php?p=91979&postcount=541
Layout of graphic statistics is generated by charinfo.php(data + colors/effects) and charts.php (background color)
Other graphic layouts you can find:
http://www.maani.us/charts/index.php?menu=Gallery
Last edited: