Foro de elhacker.net

Programación => Desarrollo Web => Mensaje iniciado por: streaming77 en 4 Octubre 2017, 20:52 pm



Título: Necesitaria una ayuda, Me dice, Villageinfodata not defined [javascript]
Publicado por: streaming77 en 4 Octubre 2017, 20:52 pm
Hola buenas, estoy intentando diseñar un calculador de tiempo para estos juegos que hay online.


Lo tenia creado y me funcionaba, pero han actualizado el juego y ahora me falla una pequeña parte que debo encontrar pero no la localizo, si alguien puede ayudarme, los que mas saben les será sencillo seguro que es una tontería de 5minutos pero yo como no entiendo tanto...


· Los títulos de los temas deben ser descriptivos
· Los temas deben ir en su respectivo subforo
>aquí las reglas del foro (http://foro.elhacker.net/reglas.htm)
-Engel Lex


Título: Re: Necesitaria una ayuda - javascript
Publicado por: **Aincrad** en 4 Octubre 2017, 21:55 pm
amigo, si quieres ayuda . por lo menos publica el ese javascript que te da error .   :silbar:


Título: Re: Necesitaria una ayuda - javascript
Publicado por: streaming77 en 4 Octubre 2017, 22:08 pm
amigo, si quieres ayuda . por lo menos publica el ese javascript que te da error .   :silbar:

Código
  1. // ==UserScript==
  2. // @author streaming77
  3. // @name Planer
  4. // @version        1.0
  5. // @description    streaming77.
  6. // @include **es45.guerrastribales.es/game.php?*screen=info_village*
  7. // ==/UserScript==
  8. javascript: (function() {
  9.  
  10.    var Store = function(a) {
  11.        var c = {};
  12.        if (typeof(Storage) !== "undefined") {
  13.            if (localStorage[a] && localStorage[a] !== 'null' && localStorage[a] !== '') {
  14.                c = JSON.parse(localStorage[a]);
  15.            }
  16.        } else alert('Browserul dumneavoastra nu este compatibil cu "localStorage"');
  17.        if (!(this instanceof Store)) return {
  18.            c: c,
  19.            e: a,
  20.            Set: function(a, b) {
  21.                if (!b) delete this.c[a];
  22.                else this.c[a] = b;
  23.                localStorage[this.e] = JSON.stringify(this.c);
  24.                return this;
  25.            },
  26.            Get: function(a) {
  27.                if (!a) return this.c;
  28.                else return this.c[a];
  29.            }
  30.        }
  31.    };
  32.    jQuery.fn.center = function(parent) {
  33.        if (parent) parent = this.parent();
  34.        else parent = window;
  35.        var pos = ((Store('Loader').Get('SupremeComander') || {}).eclipW || {
  36.            top: ((($(parent).height() - this.outerHeight()) / 2) + $(parent).scrollTop()),
  37.            left: ((($(parent).width() - this.outerWidth()) / 2) + $(parent).scrollLeft())
  38.        });
  39.        this.css({
  40.            "position": "fixed",
  41.            "top": (pos.top + "px"),
  42.            "left": (pos.left + "px")
  43.        });
  44.        return this;
  45.    };
  46.  
  47.    function getSettings() {
  48.            var store = Store('Loader').Get('SupremeComander') || {
  49.                settings: {}
  50.            };
  51.            var nou = {
  52.                "units": {
  53.                    "spear": 0,
  54.                    "sword": 0,
  55.                    "axe": 0,
  56.                    "archer": 0,
  57.                    "spy": 0,
  58.                    "light": 0,
  59.                    "marcher": 0,
  60.                    "heavy": 0,
  61.                    "ram": 0,
  62.                    "catapult": 0
  63.                },
  64.                "settings_active": true,
  65.                "building": ['wall'],
  66.                "autoselect": false,
  67.                "force_type": null,
  68.                "reserve": true,
  69.                "random_ms": 0,
  70.                "type": null,
  71.                "ms": 0
  72.            };
  73.            var types = ['noble', 'fakes', 'nukes', 'support', 'other', 'reserve'];
  74.            for (var i = 0; i < types.length; i++) {
  75.                if (!store.settings[types[i]]) store.settings[types[i]] = nou;
  76.                else {
  77.                    types = null;
  78.                    break;
  79.                }
  80.            }
  81.            if (types) {
  82.                Store('Loader').Set('SupremeComander', store);
  83.                return getSettings();
  84.            } else return store.settings;
  85.        }
  86.        /*if (!Store('Loader')['Get']('Autorizatie')['valida']) {return;}*/
  87.    var obj = Store('Loader').Get('SVPlaner') || {},
  88.        autostart = false,
  89.        openin;
  90.  
  91.    function fnAjaxRequest(url, sendMethod, params, type) {
  92.        var error = null,
  93.            payload = null;
  94.        $.ajax({
  95.            "async": false,
  96.            "url": url,
  97.            "data": params,
  98.            "dataType": type,
  99.            "type": String(sendMethod || "GET").toUpperCase(),
  100.            "error": function(req, status, err) {
  101.                error = "ajax: " + status
  102.            },
  103.            "success": function(data, status, req) {
  104.                payload = data
  105.            }
  106.        });
  107.        if (error) {
  108.            throw (error)
  109.        }
  110.        return payload
  111.    }
  112.  
  113.    function fnCreateConfig(name) {
  114.        return $(fnAjaxRequest("/interface.php", "GET", {
  115.            "func": name
  116.        }, "xml")).find("config")
  117.    }
  118.  
  119.    function fnCreateUnitConfig() {
  120.        return fnCreateConfig("get_unit_info")
  121.    }
  122.  
  123.    function addzero(i) {
  124.        if (i < 10) {
  125.            i = "0" + i;
  126.        }
  127.        return i;
  128.    }
  129.  
  130.    function fnTime(date, time) {
  131.        return new Date(date[0] * 1, (date[1] - 1), date[2] * 1, time[0] * 1, time[1] * 1, time[2] * 1);
  132.    }
  133.  
  134.    function fnFormatMs(s) {
  135.        function addZ(n) {
  136.            return (n < 10 ? '0' : '') + n;
  137.        }
  138.        var ms = s % 1000;
  139.        s = (s - ms) / 1000;
  140.        var secs = s % 60;
  141.        s = (s - secs) / 60;
  142.        var mins = s % 60;
  143.        var hrs = (s - mins) / 60;
  144.        return hrs + ':' + addZ(mins) + ':' + addZ(secs);
  145.    }
  146.  
  147.    function fnCalculateLaunchTime(xa, xb, ya, yb, unit, landingTime) {
  148.        var unitTime = fnCalculateTimeDistance(xa, xb, ya, yb, unit);
  149.        var launchTime = new Date();
  150.        launchTime.setTime(landingTime.getTime() - unitTime);
  151.        return launchTime;
  152.    }
  153.  
  154.    function fnServerTime() {
  155.        var servertime = $("#serverTime").html().match(/\d+/g);
  156.        var serverDate = $("#serverDate").html().match(/\d+/g);
  157.        return new Date(serverDate[1] + "/" + serverDate[0] + "/" + serverDate[2] + " " + servertime.join(":")) * 1;
  158.    }
  159.  
  160.    function fnCalculateTimeDistance(xa, xb, ya, yb, unit) {
  161.        var distance = fnCalculateDistance(xa, xb, ya, yb);
  162.        var unitTime = (distance * unit);
  163.        var hor = Math.floor(unitTime / 60);
  164.        var min = Math.floor(unitTime) - (hor * 60);
  165.        var seg = Math.round((unitTime - (hor * 60) - min) * 60);
  166.        var seg = seg + (min * 60) + (hor * 3600);
  167.        var msecsDuration = seg * 1000;
  168.        return msecsDuration;
  169.    }
  170.  
  171.    function fnCalculateDistance(xa, xb, ya, yb) {
  172.        var fields = Math.sqrt(Math.pow(xa - xb, 2) + Math.pow(ya - yb, 2));
  173.        return fields;
  174.    }
  175.  
  176.    function refil() {
  177.        var a = {};
  178.        if (obj.defaults) {
  179.            a = obj.defaults
  180.        } else {
  181.            var da = document.getElementById('arrivalDate');
  182.            var now = new Date(new Date() + (server_utc_diff * 1000));
  183.            a['date'] = now.getFullYear() + '-' + addzero(now.getMonth() + 1) + '-' + addzero(now.getDate() + 1);
  184.        }
  185.        return a;
  186.    }
  187.  
  188.    function getPlan() {
  189.        if (autostart) clearTimeout(autostart);
  190.        /*detalii coordinate*/
  191.       [b] var ca = VillageInfoData.coord;
  192.        var cb = game_data.village.coord;
  193.        var xa = VillageInfoData.x;
  194.        var ya = VillageInfoData.y;
  195.        var xb = game_data.village.x;
  196.        var yb = game_data.village.y;[/b]
  197.        /*unitatea selectata*/
  198.        var se = document.getElementById('units');
  199.        var us = se.options[se.selectedIndex].value * 1;
  200.        var nm = se.options[se.selectedIndex].text.toUpperCase();
  201.        var outplan = document.getElementById('outplan');
  202.  
  203.        var da = document.getElementById('arrivalDate').value.match(/\d+/g);
  204.        var or = document.getElementById('arrivalTime').value.match(/\d+/g);
  205.        if (!da || !or) return;
  206.        var lansare = fnTime(da, or);
  207.  
  208.        var durata = fnCalculateTimeDistance(xa, xb, ya, yb, us);
  209.        var deschide = ((lansare * 1 - durata) - 20000) - fnServerTime();
  210.        openin = (lansare * 1 - durata) - 20000;
  211.        document.getElementById('durata').value = fnFormatMs(durata);
  212.        document.getElementById('launchin').value = deschide > 0 ? fnFormatMs(deschide) : 'Depasit';
  213.        obj['defaults'] = {
  214.            date: da.join('-'),
  215.            time: or.join(':'),
  216.            ms: document.getElementById('arrivalMs').value,
  217.            unit: se.options[se.selectedIndex].id
  218.        };
  219.        Store('Loader').Set('SVPlaner', obj);
  220.        var lansare = fnCalculateLaunchTime(xa, xb, ya, yb, us, lansare);
  221.  
  222.        var a = lansare.getFullYear();
  223.        var l = lansare.getMonth() + 1;
  224.        var z = lansare.getDate();
  225.        var o = lansare.getHours();
  226.        var m = lansare.getMinutes();
  227.        var s = lansare.getSeconds();
  228.        l = addzero(l);
  229.        z = addzero(z);
  230.        o = addzero(o);
  231.        m = addzero(m);
  232.        s = addzero(s);
  233.  
  234.        outplan.value = a + '.' + l + '.' + z + ' [b]' + o + ':' + m + ':' + s + '[/b] ' + nm + ' ' + cb + '  ->  ' + ca;
  235.        var auto = document.getElementById('autostart');
  236.        var tip = document.getElementById('type');
  237.        auto.dataset['unit'] = nm;
  238.        auto.dataset['sent'] = o + ':' + m + ':' + s;
  239.        auto.dataset['type'] = tip.options[tip.selectedIndex].id;
  240.        auto.dataset['link'] = VillageContext._urls.place.replace('__village__', VillageInfoData.id);
  241.        auto.dataset['ms'] = obj['defaults'].ms;
  242.        autostart = false;
  243.    }
  244.  
  245.    function append(el, str) {
  246.        var div = document.createElement('div');
  247.        div.innerHTML = str;
  248.        while (div.children.length > 0) {
  249.            if (el['appendChild']) {
  250.                el.appendChild(div.children[0])
  251.            } else {
  252.                setTimeout(function() {
  253.                    el.appendChild(div.children[0])
  254.                }, 500)
  255.            }
  256.        }
  257.    };
  258.    var speed = {};
  259.    var option = '';
  260.    var traducere = {
  261.        "Lancier": "spear",
  262.        "Spada": "sword",
  263.        "Topoare": "axe",
  264.        "Arcas": "archer",
  265.        "Spion": "spy",
  266.        "C.Usoara": "light",
  267.        "C.Arcas": "marcher",
  268.        "C.Grea": "heavy",
  269.        "Berbec": "ram",
  270.        "Catapulta": "catapult",
  271.        "Paladin": "knight",
  272.        "Nobil": "snob"
  273.    };
  274.  
  275.    if (!obj.speed) {
  276.        var unitConfig = fnCreateUnitConfig();
  277.        $(unitConfig).children().each(function(i, e) {
  278.            speed[e.nodeName] = $(e).find("speed").text()
  279.        });
  280.        obj['speed'] = speed;
  281.        Store('Loader').Set('SVPlaner', obj);
  282.    } else speed = obj['speed'];
  283.    $.each(traducere, function(key, value) {
  284.        var selected = '';
  285.        if (refil().unit && refil().unit == value) {
  286.            selected = 'selected';
  287.        } else if (value == 'ram' && selected != '') {
  288.            selected = 'selected';
  289.        }
  290.        option += '<option value="' + speed[value] + '" id="' + value + '" ' + selected + '>' + key + '</option>';
  291.    });
  292.    var mainframe = '<div style="padding-top: 10px; clear:both">';
  293.    mainframe += '    <table class="vis" style="width:100%">';
  294.    mainframe += '        <tbody>';
  295.    mainframe += '            <tr>';
  296.    mainframe += '                <th>Sosire</th>';
  297.    mainframe += '                <th>Unitate</th>';
  298.    mainframe += '                <th>Durata</th>';
  299.    mainframe += '                <th>Deschide</th>';
  300.    mainframe += '            </tr>';
  301.    mainframe += '            <tr>';
  302.    mainframe += '                <td>';
  303.    mainframe += '                    <input type="date" id="arrivalDate" style="width: 120px;"  value="' + refil().date + '">';
  304.    mainframe += '                    <input type="text" id="arrivalTime" placeholder="00:00:00" value="' + (refil().time ? refil().time : '00:00:00') + '" style="width:45px;">';
  305.    mainframe += '                    <input type="text" id="arrivalMs" placeholder="000" value="' + (refil().ms ? refil().ms : '000') + '" style="width:20px;">';
  306.    mainframe += '                </td>';
  307.    mainframe += '                <td>';
  308.    mainframe += '                    <select id="units"  style="width:98%;">';
  309.    mainframe += option;
  310.    mainframe += '                    </select>';
  311.    mainframe += '                </td>';
  312.    mainframe += '                <td>';
  313.    mainframe += '                    <input type="text" id="durata" placeholder="00:00:00" style="width:98%;" readonly>';
  314.    mainframe += '                </td>';
  315.    mainframe += '                <td>';
  316.    mainframe += '                    <input type="text" id="launchin" placeholder="00:00:00" style="width:98%;" readonly>';
  317.    mainframe += '                </td>';
  318.    mainframe += '            </tr>';
  319.    mainframe += '            <tr>';
  320.    mainframe += '                <td colspan="1">';
  321.    mainframe += '                    <input type="button" id="calculate" value="Calculeaza">';
  322.    mainframe += '                    <input type="button" id="autostart" value="Auto">';
  323.    mainframe += '                    <select id="type">';
  324.    mainframe += '                        <option id="other" selected>Other</option>';
  325.    mainframe += '                        <option id="noble">Noble</option>';
  326.    mainframe += '                        <option id="nukes">Nukes</option>';
  327.    mainframe += '                        <option id="fakes">Fakes</option>';
  328.    mainframe += '                        <option id="support">Support</option>';
  329.    mainframe += '                    </select>';
  330.    mainframe += '                    <input type="button" id="eclipsator" value="E.S">';
  331.    mainframe += '                </td>';
  332.    mainframe += '                <td colspan="3" style="width:60%;">';
  333.    mainframe += '                    <input type="text" id="outplan" style="width:99%;" ondblclick="this.select()">';
  334.    mainframe += '                </td>';
  335.    mainframe += '            </tr>';
  336.    mainframe += '        </tbody>';
  337.    mainframe += '    </table>';
  338.    mainframe += '</div>';
  339.    append(document.querySelector('#content_value > table > tbody > tr > td:nth-child(2)')/*.parentNode*/, mainframe);
  340.    $('#arrivalDate, #arrivalTime, #units').on('change', function() {
  341.        getPlan()
  342.    });
  343.    $('#calculate').on('click', function() {
  344.        getPlan()
  345.    });
  346.    $('#eclipsator').on('click', function() {
  347.        var tip = document.getElementById('type');
  348.        (function SettingsForThisTab(tipu) {
  349.            var type = (document.querySelector(".memo-tab-selected") || false),
  350.                tipu = tipu || (type ? (type.innerText || type.textContent).trim() : ''),
  351.                supp = new RegExp(/Spri|spri|Apo|apo|Supp|supp/).test(tipu),
  352.                nobi = new RegExp(/nobil|Nobil|nobl|Nobl/).test(tipu),
  353.                nuke = new RegExp(/Real|real|nuke|Nuke/).test(tipu),
  354.                fake = new RegExp(/Fake|fake/).test(tipu),
  355.                rese = new RegExp(/reserve/).test(tipu),
  356.                conn = (nobi ? 'noble' : (fake ? 'fakes' : (supp ? 'support' : (nuke ? 'nukes' : (rese ? 'reserve' : 'other'))))),
  357.                store = getSettings(),
  358.                src = $('<div class="vis maincontainer" style="margin-bottom:0px;width:280px;padding:0 0 4px 0;border-radius: 6px 6px 0 0;z-index:999999;background: #ECD7AC;position:fixed;left: 545px;top: -274px;"><center style="text-shadow: #F4E4BC 0 0 5px;box-shadow: inset #7D510F 0 0 10px 0;margin: -1px;border: 1px solid #7D510F;padding: 2px;color: #000;border-radius: 6px 6px 0 0;">Setarile vor fi aplicate pentru: <select id="swich"></select></center><table class="vis" width="100%"><tbody></tbody></table></div>'),
  359.                cladiri = ['<option value="main">Cladirea principala</option>'];
  360.            cladiri[1] = '<option value="barracks">Cazarma</option>';
  361.            cladiri[2] = '<option value="stable">Grajd</option>';
  362.            cladiri[3] = '<option value="garage">Atelier</option>';
  363.            cladiri[4] = '<option value="snob">Curte nobila</option>';
  364.            cladiri[5] = '<option value="smith">Fierarie</option>';
  365.            cladiri[6] = '<option value="place">Piata centrala</option>';
  366.            cladiri[7] = '<option value="statue">Statuie</option>';
  367.            cladiri[8] = '<option value="market">T&#257;rg</option>';
  368.            cladiri[9] = '<option value="wood">Taietori de lemne</option>';
  369.            cladiri[10] = '<option value="stone">Mina de argila</option>';
  370.            cladiri[11] = '<option value="iron">Mina de fier</option>';
  371.            cladiri[12] = '<option value="farm">Ferma</option>';
  372.            cladiri[13] = '<option value="storage">Magazie</option>';
  373.            cladiri[14] = '<option value="wall">Zid</option>';
  374.            var setari = '<td rowspan="10"><div>Configuratia este activa: <input type="checkbox" class="settings_active"/></div>';
  375.            setari += '<div>Auto selecteaza trupele: <input type="checkbox" class="autoselect"/></div>';
  376.            setari += '<div>Lasa rezerva: <input type="checkbox" class="reserve"/></div>';
  377.            setari += '<div>La milisecundele: <input type="number" class="ms" style="width:64px;"/></div>';
  378.            setari += '<div>Interval random ms: <input type="number" class="random_ms" style="width:44px;"/></div>';
  379.            setari += '<div>Trimite comanda: <select  class="force_type"><option id="null">Auto</option><option id="attack">Attack</option><option id="support">Support</option></select></div>';
  380.            setari += '<div>Catapulte: <select class="building" style="height:140px;" multiple>' + cladiri.join("") + '</select></div></td>';
  381.            setari = $(setari);
  382.            for (var tip in store) {
  383.                var s = '';
  384.                if (conn == tip) {
  385.                    s = 'selected';
  386.                    for (var setare in store[tip]) {
  387.                        var element = setari.find('.' + setare);
  388.                        if (conn == 'reserve') {
  389.                            element.prop('disabled', true);
  390.                            continue;
  391.                        }
  392.                        if (element.length > 0) {
  393.                            if (setare == 'force_type') element.find('option').filter(function() {
  394.                                return (this.id == store[tip][setare]);
  395.                            }).prop('selected', true);
  396.                            if (setare == 'building') element.val(store[tip][setare]);
  397.                            else if (setare.match(/ms/)) element.val(store[tip][setare]);
  398.                            else element.prop('checked', store[tip][setare]);
  399.                        }
  400.                    }
  401.                } /*de facut: asta trebuie mutat inafara lui for*/
  402.                src.find('#swich').change(function() {
  403.                    var newsetting = $(this).find("option:selected").attr("value");
  404.                    $('.maincontainer').remove();
  405.                    SettingsForThisTab(newsetting);
  406.                }).append('<option value="' + tip + '" ' + s + '>' + tip + '</option>');
  407.            }
  408.            for (var unit in store[conn].units) {
  409.                var value = store[conn].units[unit];
  410.                var style = 'style="background:' + (value < 0 ? '#0F1' : (value > 0 ? '#FFDF00' : '#F00')) + ';border:#B09A2B 1px solid;border-radius:3px"';
  411.                var tr = $('<tr></tr>'),
  412.                    img = $('<td width="18"><img src="/graphic/unit/unit_' + unit + '.png?1" ' + style + '></td>').appendTo(tr),
  413.                    input = $('<td width="52"><input style="width:48px;" type="number" min="' + (conn == 'reserve' ? 0 : -1) + '" id="' + unit + '" class="ec_u" value="' + value + '" autocomplete="off"></td>').appendTo(tr);
  414.                tr.appendTo(src.find('tbody'));
  415.            }
  416.            src.find('tr').first().append(setari);
  417.            $('<input class="btn" type="button" value="Salveaza">').on('click', function() {
  418.                var settingsfor = $('#swich').find("option:selected").attr("value"),
  419.                    units = $('.ec_u'),
  420.                    settings_active = $('.settings_active').is(':checked'),
  421.                    autoselect = $('.autoselect').is(':checked'),
  422.                    reserve = $('.reserve').is(':checked'),
  423.                    force_type = $('.force_type').find("option:selected")[0].id,
  424.                    random_ms = $('.random_ms').val(),
  425.                    building = $('.building').val(),
  426.                    ms = $('.ms').val();
  427.                for (var unit in store[settingsfor].units) {
  428.                    store[settingsfor].units[unit] = units.filter(function() {
  429.                        return this.id == unit;
  430.                    })[0].value;
  431.                }
  432.                store[settingsfor].settings_active = settings_active;
  433.                store[settingsfor].autoselect = autoselect;
  434.                store[settingsfor].reserve = reserve;
  435.                store[settingsfor].force_type = force_type;
  436.                store[settingsfor].random_ms = random_ms;
  437.                store[settingsfor].ms = ms;
  438.                store[settingsfor].building = building;
  439.                var save_store = Store('Loader').Get('SupremeComander') || {};
  440.                save_store['settings'] = store;
  441.                Store('Loader').Set('SupremeComander', save_store);
  442.            }).appendTo(src);
  443.            $('<input class="btn" onclick="$(\'.maincontainer\').remove()" type="button" value="Inchide">').appendTo(src);
  444.            src.appendTo('body').draggable({
  445.                handle: 'center',
  446.                drag: function() {
  447.                    var store = Store('Loader').Get('SupremeComander') || {};
  448.                    store['eclipW'] = $(this).position();
  449.                    Store('Loader').Set('SupremeComander', store);
  450.                }
  451.            }).center(false);
  452.            $('.ec_u').on('change', function() {
  453.                var value = $(this).val() * 1;
  454.                $(this).parent().parent().find('img').css({
  455.                    background: (value < 0 ? '#0F1' : (value > 0 ? '#FFDF00' : '#F00'))
  456.                });
  457.            });
  458.        })(tip.options[tip.selectedIndex].id);
  459.        return false;
  460.    });
  461.    $('#autostart').on('click', function() {
  462.        if (!autostart) {
  463.            if (openin && (openin - fnServerTime()) > 0) {
  464.                var that = this;
  465.                var ref = null;
  466.                var opt = 'location=yes,menubar=yes,resizable=yes,toolbar=yes,';
  467.                opt += 'scrollbars=yes,status=yes,titlebar=yes';
  468.                opt += ',width=700,height=600';
  469.  
  470.                var a = Store('Loader').Get('SupremeComander') || {};
  471.                var b = a['targets'] ? a['targets'] : {};
  472.                var default_ms = ((a.settings || {})[this.dataset.type] || {}).ms * 1 || this.dataset.ms * 1;
  473.                if ((this.dataset.ms * 1) > 0) default_ms = this.dataset.ms;
  474.                b[game_data.village.id] = {
  475.                    from: 'info',
  476.                    unit: this.dataset.unit,
  477.                    type: this.dataset.type,
  478.                    sent: this.dataset.sent,
  479.                    ms: default_ms
  480.                };
  481.                a['targets'] = b;
  482.                a['last'] = this.dataset.link;
  483.                Store('Loader').Set('SupremeComander', a);
  484.                (function Auto() {
  485.                    var durata = openin - fnServerTime();
  486.                    document.getElementById('launchin').value = fnFormatMs(durata);
  487.                    if (durata <= 0) {
  488.                        autostart = false;
  489.                        ref = window.open(that.dataset.link, '_blank', opt);
  490.                        window.setTimeout(function() {
  491.                            if (ref.closed) window.location.reload();
  492.                        }, 21000)
  493.                    } else autostart = setTimeout(Auto, 500);
  494.                })();
  495.            } else if (!openin) {
  496.                getPlan();
  497.            }
  498.        } else {
  499.            clearTimeout(autostart);
  500.            autostart = false;
  501.        }
  502.    });
  503. })()
  504.  




Me dice, Villageinfodata not defined, lo señalé en negrita, debe ser porque la pagina del juego actualizó ese comando y cambió el nombre, pero no lo encuentro, si alguno me ayuda por skype o aqui


· Los códigos deben ir en etiquetas GeSHi
>aquí las reglas del foro (http://foro.elhacker.net/reglas.htm)
-Engel Lex


Título: Re: Necesitaria una ayuda - javascript
Publicado por: **Aincrad** en 4 Octubre 2017, 22:19 pm
necesito el link del juego para probar el code.


Título: Re: Necesitaria una ayuda - javascript
Publicado por: streaming77 en 4 Octubre 2017, 22:22 pm
necesito el link del juego para probar el code.

www.guerrastribales.es


Título: Re: Necesitaria una ayuda - javascript
Publicado por: streaming77 en 4 Octubre 2017, 22:36 pm
si hay algo que no entiendas del juego o la funcion del script por skype te puedo comentar asi se agiliza y no es tan pesado venir aca


Título: Re: Necesitaria una ayuda - javascript
Publicado por: **Aincrad** en 4 Octubre 2017, 22:57 pm
no. ya entendí el juego.

es facil . nada mas ir a la barra de acceso rápido y le das a personalizar.  hay colocas
el nombre del script y el javascript  pero desafortunadamente no te puedo ayudar.

no te puedo ayudar, ya que esta opción para agregar el  javascript es solo para usuarios Premium  y a los usuarios normales no les deja esta opcion.

PD: cuando publiques algún código colocalo dentro de su respectiva etiqueta asi:

Código
  1. Pon tu code dentro de su respectiva etiqueta. como este texto


Título: Re: Necesitaria una ayuda - javascript
Publicado por: streaming77 en 4 Octubre 2017, 23:02 pm
no. ya entendí el juego.

es facil . nada mas ir a la barra de acceso rápido y le das a personalizar.  hay colocas
el nombre del script y el javascript  pero desafortunadamente no te puedo ayudar.

no te puedo ayudar, ya que esta opción para agregar el  javascript es solo para usuarios Premium  y a los usuarios normales no les deja esta opcion.

PD: cuando publiques algún código colocalo dentro de su respectiva etiqueta asi:

Código
  1. Pon tu code dentro de su respectiva etiqueta. como este texto


no es como dices, es mas complicado, y no es necesario la premiun, de ahi que te dije hablar por skype xD