• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Request]

tosse12

Panchira Project Member
Joined
Jun 10, 2007
Messages
864
Reaction score
9
Location
Sweden
Hi everyone!
This is maybe an odd request but :p
I am using Modern ACC rev131 and TFS 0.3.6 Crying Damson.

I want to be able to get data from config.lua, and link it to the webpage.
As an example what it should say in the website:
Code:
"The server current experience rating is 50.0 times normal"
"The server current world type is PvP"
And just by chaning the exp rate or worldtype in config.lua it shall change in the website.

+Rep to the one who is able to do this :D
(If this isn't able to do please tell me!)
 
Last edited:
I could hand you my lua parser.

Usage:
open up the luaparser.php and go to line 178 and change it to
$xml->load("FULL SERVERPATH");

Then you can use it in your code by:
Code:
require('PATH/luaparser.php');

// $option 1 = Only world
// $option 2 = Only Server
// $option 3 = Only Rates
// $option 4 = All

$array=load_config($option);

Just fill in the option you like, 1 will load only world config section.
2 only the server
3 only rates
and 4 all.

Then just use print_r($array); To see how to use the array :)
The luaparser.php is attached as a zip.

Rep++ me if it helped :)
 

Attachments

Got a few questions... when u told me that I shall change the serverpath, you mean like this: ?
Code:
$xml->load("C:\Tibia\panchira\config.xml");

For the other question
Shouldn't I change this too? :D
Code:
$config=makePhpArray("F:\Tibia PS RPG\8.55\config.lua");
 
Last edited:
Oh sorry It's my function to copy partially the config to another config to use it just use the line

With path to the config :)

$config=makePhpArray("F:\Tibia PS RPG\8.55\config.lua");

So don't use the load_config() or nthing just put

the line above somewhere in the code :) after u require the luaparser.php
 
Okey, now I am kind of lost o_O
Shall I still change ?
Code:
$xml->load("C:\Tibia\panchira\config.xml");

or return it to original:
$xml->load("XML/config.xml");

For the php file which require:
Code:
require('luaparser.php');
$config=makePhpArray("C:/tibia/panchira/config.lua");
print_r($config);
Also, shall I remove this from luaparser.php ?
Code:
$config=makePhpArray("C:/tibia/panchira/config.lua");
 
no need to remove any from luaparser or change any
just use

Code:
require('luaparser.php');
$config=makePhpArray("C:/tibia/panchira/config.lua");
print_r($config);
 
Back
Top