Totoka 152 Report post Posted October 13, 2016 (edited) ** dependencies: jQuery & later.js <script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script> <script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/later/1.2.0/later.min.js'></script> source + example: * html template was done with bootstrap.css https://jsfiddle.net/Totoka/pm30r9c6/ Scroll down the javascript page, there is an small object documented here a minified version <script type="text/javascript" src="http://yourjavascript.com/321130410682/event-timer-min.js"></script> @Update 2016-10-17 03:18 + support for custom map states, based in an ordered list by duration in seconds + added default time format HH:MM:SS + Object @Settings re-structured @Update 2016-10-20 13:20 + time diff fixes Edited October 20, 2016 by Totoka @Update 2016-10-17 03:18 UTC 9 Quote Discord: andresc Share this post Link to post Share on other sites
Totoka 152 Report post Posted October 18, 2016 (edited) Some time based maps examples: { name: 'Chaos Argent', time: [ '0 14/6 * * *' ],//-- each 6 hours starting from 14h00m states: [ { upto: 30 * 60, value:'<span class="label label-success">OPEN</span>' }, { upto: 45 * 60, value:'<span class="label label-warning">ACTIVE</span>' }, { value: '<span class="label label-danger">CLOSED</span>' }, ] }, { name: 'Icicle Mirage', time: [ '0 13/6 * * *' ],//-- each 6 hours starting from 13h00m/day states: [ { upto: 4 * 60 * 60, value:'<span class="label label-success">OPEN</span>' }, { value: '<span class="label label-danger">CLOSED</span>' }, ] }, { name: 'Shaitan Mirage', time: [ '0 13/6 * * *' ],//-- each 6 hours starting from 13h00m/day states: [ { upto: 4 * 60 * 60, value:'<span class="label label-success">OPEN</span>' }, { value: '<span class="label label-danger">CLOSED</span>' }, ] }, { name: 'Thundoria Mirage', time: [ '0 13/6 * * *' ],//-- each 6 hours starting from 13h00m/day states: [ { upto: 4 * 60 * 60, value:'<span class="label label-success">OPEN</span>' }, { value: '<span class="label label-danger">CLOSED</span>' }, ] }, { name: 'Forsaken City', time: [ '0 0/3 * * *' ],//-- each 3 hours starting from 00h00m states: [ { upto: 1 * 60 * 60, value:'<span class="label label-success">OPEN</span>' }, { upto: 2 * 60 * 60, value:'<span class="label label-warning">ACTIVE</span>' }, { value: '<span class="label label-danger">CLOSED</span>' }, ] }, { name: 'Forsaken City 2', time: [ '0 0/3 * * *' ],//-- each 3 hours starting from 00h00m states: [ { upto: 1 * 40 * 60, value:'<span class="label label-success">OPEN</span>' }, { upto: 2 * 60 * 60, value:'<span class="label label-warning">ACTIVE</span>' }, { value: '<span class="label label-danger">CLOSED</span>' }, ] }, { name: 'Forsaken City 3', time: [ '0 0/3 * * *' ],//-- each 3 hours starting from 00h00m states: [ { upto: 1 * 80 * 60, value:'<span class="label label-success">OPEN</span>' }, { upto: 2 * 60 * 60, value:'<span class="label label-warning">ACTIVE</span>' }, { value: '<span class="label label-danger">CLOSED</span>' }, ] }, { name: 'Dark Swamp', time: [ '0 0/3 * * *' ],//-- each 3 hours starting from 00h00m states: [ { upto: 1 * 60 * 60, value:'<span class="label label-success">OPEN</span>' }, { upto: 2 * 60 * 60, value:'<span class="label label-warning">ACTIVE</span>' }, { value: '<span class="label label-danger">CLOSED</span>' }, ] }, { name: 'Demonic World', time: [ '0 0/3 * * *' ],//-- each 3 hours starting from 00h00m states: [ { upto: 1 * 40 * 60, value:'<span class="label label-success">OPEN</span>' }, { upto: 2 * 60 * 60, value:'<span class="label label-warning">ACTIVE</span>' }, { value: '<span class="label label-danger">CLOSED</span>' }, ] }, { name: 'Demonic World 2', time: [ '0 0/3 * * *' ],//-- each 3 hours starting from 00h00m states: [ { upto: 1 * 80 * 60, value:'<span class="label label-success">OPEN</span>' }, { upto: 2 * 60 * 60, value:'<span class="label label-warning">ACTIVE</span>' }, { value: '<span class="label label-danger">CLOSED</span>' }, ] }, { name: 'Abaddon 1', time: [ '0 21 * * *' ],//-- each 1 day starting from 21h00m states: [ { upto: 1 * 60 * 60, value:'<span class="label label-success">OPEN</span>' }, { upto: 6 * 60 * 60, value:'<span class="label label-warning">ACTIVE</span>' }, { value: '<span class="label label-danger">CLOSED</span>' }, ] }, { name: 'Abaddon 2', time: [ '30 21 * * *' ],//-- each 1 day starting from 21h30m states: [ { upto: 1 * 30 * 60, value:'<span class="label label-success">OPEN</span>' }, { upto: ((5 * 60)+30) * 60, value:'<span class="label label-warning">ACTIVE</span>' }, { value: '<span class="label label-danger">CLOSED</span>' }, ] }, { name: 'Abaddon 3', time: [ '0 22 * * *' ],//-- each 1 day starting from 22h00m states: [ { upto: 1 * 30 * 60, value:'<span class="label label-success">OPEN</span>' }, { upto: 5 * 60 * 60, value:'<span class="label label-warning">ACTIVE</span>' }, { value: '<span class="label label-danger">CLOSED</span>' }, ] }, { name: 'Abaddon 4', time: [ '0 0 * * *' ],//-- each 1 day starting from 00h00m states: [ { upto: 1 * 60 * 60, value:'<span class="label label-success">OPEN</span>' }, { upto: 3 * 60 * 60, value:'<span class="label label-warning">ACTIVE</span>' }, { value: '<span class="label label-danger">CLOSED</span>' }, ] }, { name: 'Abaddon 5', time: [ '30 0 * * *' ],//-- each 1 day starting from 00h30m states: [ { upto: 2 * 60 * 60, value:'<span class="label label-success">OPEN</span>' }, { upto: ((2 * 60)+30) * 60, value:'<span class="label label-warning">ACTIVE</span>' }, { value: '<span class="label label-danger">CLOSED</span>' }, ] }, Edited October 18, 2016 by Totoka 3 Quote Discord: andresc Share this post Link to post Share on other sites
Shako 97 Report post Posted October 18, 2016 @Totoka will test this out sometime when im free =) 1 Quote Sunny Go! Online pko.host Share this post Link to post Share on other sites
Totoka 152 Report post Posted October 20, 2016 @Update 2016-10-20 13:20 + time diff fixes Should be stable now *There will be another update soon, and probably the last one; I'm gonna try to reduce the complexity within the settings object, by adding some modifier functions. 1 Quote Discord: andresc Share this post Link to post Share on other sites
Shako 97 Report post Posted October 24, 2016 Hello @Totoka! Could you post a pack with the .HTML for the map timer? It will save a lot of time for anyone trying the script Quote Sunny Go! Online pko.host Share this post Link to post Share on other sites
Totoka 152 Report post Posted October 24, 2016 There is an html within the example Quote source + example: * html template was done with bootstrap.css https://jsfiddle.net/Totoka/pm30r9c6/ +css & HOW-TO js Quote Discord: andresc Share this post Link to post Share on other sites
Vasil 71 Report post Posted November 12, 2016 Since you're now talking about JavaScript,anybody has an idea how to run JavaScript into PHP? Me and my cousin are struggling to find it, still nothing found. Quote Share this post Link to post Share on other sites
Danny 31 Report post Posted November 12, 2016 19 minutes ago, Vasil said: Since you're now talking about JavaScript,anybody has an idea how to run JavaScript into PHP? Me and my cousin are struggling to find it, still nothing found. You can put script tags and execute the Javascript inside the tags. <script language="javascript" type="text/javascript"> alert("Hello Vasil!"); </script> Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted November 12, 2016 1 час назад, Vasil сказал: Since you're now talking about JavaScript,anybody has an idea how to run JavaScript into PHP? Me and my cousin are struggling to find it, still nothing found. echo '<script language="javascript" type="text/javascript"> alert("Hello Vasil!"); </script>'; But I think it is better to separate PHP code from HTML/CSS/JS. 1 Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
Danny 31 Report post Posted November 12, 2016 57 minutes ago, V3ct0r said: echo '<script language="javascript" type="text/javascript"> alert("Hello Vasil!"); </script>'; But I think it is better to separate PHP code from HTML/CSS/JS. Quite depends, if it's a big source of JS he should actually make a JS file for it, just the direct access would be an option if it was one or two lines JS codes. Or the echo in PHP also. Quote Share this post Link to post Share on other sites
Totoka 152 Report post Posted November 12, 2016 Hey @Vasil 3 hours ago, Vasil said: Since you're now talking about JavaScript,anybody has an idea how to run JavaScript into PHP? Me and my cousin are struggling to find it, still nothing found. There is a V8 extension for php: http://php.net/manual/en/v8js.executestring.php Btw, why you want to run JS Into PHP ? You can run a parallel nodejs server for such purpose, That way you'll have a less complex & messy code Quote Discord: andresc Share this post Link to post Share on other sites
Vasil 71 Report post Posted November 12, 2016 1 hour ago, Totoka said: Hey @Vasil There is a V8 extension for php: http://php.net/manual/en/v8js.executestring.php Btw, why you want to run JS Into PHP ? You can run a parallel nodejs server for such purpose, That way you'll have a less complex & messy code May you give me an example? I wanna run it into index.php Quote Share this post Link to post Share on other sites
Totoka 152 Report post Posted November 13, 2016 3 hours ago, Vasil said: May you give me an example? I wanna run it into index.php there are some examples: https://github.com/phpv8/v8js + a folder with some tests 4 hours ago, Totoka said: Btw, why you want to run JS Into PHP ? Quote Discord: andresc Share this post Link to post Share on other sites
Vasil 71 Report post Posted November 13, 2016 19 hours ago, Totoka said: there are some examples: https://github.com/phpv8/v8js + a folder with some tests Gonna test it.. I don't know why are we running it yet but he want that sooo hard ..he asked before..he's Aveatrex. Quote Share this post Link to post Share on other sites
StixXx 1 Report post Posted November 30, 2017 В 20.10.2016 в 16:58, Totoka сказал: @Update 2016-10-20 13:20 + time diff fixes Should be stable now *There will be another update soon, and probably the last one; I'm gonna try to reduce the complexity within the settings object, by adding some modifier functions. Hello, good job, it would be good to make the counter not ticking if the map is open is constant and does not show the time until the next open if the map is open. Quote Share this post Link to post Share on other sites