I dont know if this is right place to post so if this is wrong please move it to right place.
Thanks.
This is utility i made for myself. It puts right IP in config.lua if u got dynamic ip.
It check for right ip from 'http://www.whatismyip.com/automation/n09230945.asp'.
You need PHP support to do it (if you are using xampp its ok)
So lets begin.
First open your servers directory.
Make 'fix.php'. Put this inside:
-
Make 'start.bat'. Put this inside:
To edit path where php.exe is, change this C:/xampp/php/php.exe. For example your xampp directory is in D: so it would be D:/xampp/php/php.exe
To edit name of servers file edit this YurOTS.exe.
That would be it. I made this for 7.6 version and could work for higher versions.
If you got server restarter, simply instead of YurOTS.exe put Restarter.bat or how it is called.
-- Credits: Holix (me)
Thanks.
This is utility i made for myself. It puts right IP in config.lua if u got dynamic ip.
It check for right ip from 'http://www.whatismyip.com/automation/n09230945.asp'.
You need PHP support to do it (if you are using xampp its ok)
So lets begin.
First open your servers directory.
Make 'fix.php'. Put this inside:
Code:
<?php
$file = "config.lua";
$ip=file_get_contents("http://ip1.dynupdate.no-ip.com/");
$ir = 'ip = "'.$ip.'"';
$handle = fopen($file, 'r');
$contents = fread($handle, filesize($file));
fclose($handle);
$handle = fopen($file, 'w');
$test = preg_replace('/ip \= \"(.*?)\"/', $ir, $contents);
fwrite($handle, $test);
fclose($handle);
?>
Make 'start.bat'. Put this inside:
Code:
cls
@echo off
echo Putting right IP in config.
C:/xampp/php/php.exe fix.php
YurOTS.exe
To edit name of servers file edit this YurOTS.exe.
That would be it. I made this for 7.6 version and could work for higher versions.
If you got server restarter, simply instead of YurOTS.exe put Restarter.bat or how it is called.
-- Credits: Holix (me)
Last edited: