• V úterý 6.8. proběhne aktualizace na verzi 2.106. Více informací najdete na herním fóru

TW2Pro

Chceli by ste, aby developing scriptu pokračoval?


  • Celkový počet hlasujících
    3
Ďalšie veci, čo tam budú:
  • okno priamo v hre zo všetkými dostupnými vecami

  • na trhu budú priehľadné nepredajné veci, lebo Innogames na to asi zabudlo



  • id predmetu, priemerný dmg

 
Naposledy upraveno:
Najaktuálnejšia databáza všetkých itemov priamo v okne v hre, dáta priamo z hry, upozornenie na nové itemy skôr ako sa o nich objavý nejaké info...
Funguje Shift+myš (item kód), z okna sa budú dať vybrať aj itemy pre skin pack.
Nemám hotové ešte filtrovanie itemov, zvýraznenie tých ktoré hráč má.





 
Keď prejdete na item myšou, popup, okienko s informáciami o predmete sa vám zobrazí až po 300 milisekundách, tak je to nastavené v hre, niekedy to ozaj spomaľuje hráča a nedá sa to nikde vypnúť...
Tento jednoduchý skript vám zruší to oneskorenie a zobrazí okno ihneď... Zatiaľ ako bookmarklet, keď dám von skripty na ktorých robím, bude to tam zahrnuté...
JavaScript:
javascript:
    MousePopup.prototype.setTimeout = function() {
        document.getElementById("popup").style.display = "block",
            this.notify("onShow");
    }, void 0
 
Upravil som klávesové skratky, pre vloženie bb kódu itemu do textu/chatu stačí prejsť na item myšou a stlačiť shift, netreba na item klikať, je to rýchlejšie... :)
Keď stačíte ctrl, pokým je kurzor myši nad itemom, zobrazí sa vám takéto okno, dá sa tam skopírovať id itemu do schránky, alebo zmeniť obrázok itemu. :) Ďalším stlačením ctrl sa okno zavrie.

 
Každá z tých funkcii bude ako samostatný skript tentoraz...
Mne to ukázalo automaticky v starom vzhľade lebo mám zapnuté TW2Pro, to mení automaticky niektoré prvky v hre, keď nepoužívaš TW2Pro uvidíš to takto:

 
V posledných dňoch som dosť čítal kód hry, pozeral som čo sa zmenilo a tak...

- otvorenie inventára, skryje veci čo sa nedajú vylepšiť
JavaScript:
javascript:void Inventory.open({id:"win_item_upgrade"})
- otvorenie inventára, skryje veci čo sa nedajú predať u obchodníka
JavaScript:
javascript:void Inventory.open({id:"new_item_shop"})
- otvorenie trhu (po spustení skriptu, v každom meste), skryje veci v inventári čo sa nedajú vylepšiť
JavaScript:
javascript:MarketWindow.open = eval(MarketWindow.open.toSource().replace("Inventory.open(MarketWindow.window", 'Inventory.open({id:"win_item_upgrade"}')), void 0
- otvorenie trhu (po spustení skriptu, v každom meste), skryje veci v inventári čo sa nedajú predať u obchodníka
JavaScript:
javascript:MarketWindow.open = eval(MarketWindow.open.toSource().replace("Inventory.open(MarketWindow.window", 'Inventory.open({id:"new_item_shop"}')), void 0
 
nový skript TW2Pro tools [beta]

download

bookmarklet
JavaScript:
javascript:void $.getScript("//greasyfork.org/scripts/392332-tw2pro-tools/code/TW2Pro%20tools.user.js")
funkcie
  • na trhu sú skryté všetky veci čo nie sú dražiteľné
  • popup s informáciami o predmete sa vám zobrazí okamžite, nie po 300 milisekundách, ako to je v hre nastavené
  • priemerný dmg, id predmetu (v inventáti to funguje všade, inde to nemusí id ukazovať, opravím keď pridám databázu itemov)
  • prejdenie kurzorom na item (nie klikať) + CTRL, zobrazí sa okno odkiaľ sa dá skopírovať id itemu, časom pridám ďalšie možnosti
také malé demo zatiaľ, kiež by som mal na to viac času teraz... postupne budem pridávať nové veci, nechcel som sem dávať veci čo nemám úplne hotové...

JavaScript:
// ==UserScript==
// @name        TW2Pro tools
// @namespace   Blood Killer
// @author      Jaroslav Jursa
// @homepage    https://forum.the-west.sk/index.php?threads/tw2pro.22238/
// @include     http*://*.the-west.*
// @exclude     http*://forum.the-west.*
// @version     1
// @grant       none
// @run-at      document-idle
// @description javascript:void $.getScript("//greasyfork.org/scripts/392332-tw2pro-tools/code/TW2Pro%20tools.user.js")
// ==/UserScript==
/*


MIT License

Copyright (c) 2014-2019 Jaroslav Jursa

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


*/
(function() {
    if (typeof TW2Pro === "undefined") TW2Pro = {};
    TW2Pro.ui = {};
    TW2Pro.inventory = {};
    TW2Pro.mousePopup = {
        filter: function(text) {
            return /inventory_popup/.test(text) ? text.replace(/(<\/div><div>)(<img src="[^"]+divider\.png[^>]+><\/div><\/div>)/, '$1<span><b>Item ID:</b> <span class="tw2pro_item_id">?</span></span><br>$2<br>').replace(/(<[^>]+>)([\d ]+)(<\/[^>]+>)(\s*\-\s*)(<[^>]+>)([\d ]+)(<\/[^>]+>)([^(]+)(<\/[^>]+>)/, function($0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
                return $1 + $2 + $3 + $4 + $5 + $6 + $7 + " (~" + ((+$2 + (+$6)) / 2) + ")" + $8 + $9;
            }) : text;
        }
    };
    TW2Pro.ui.dialog = {
            itemInfoKeyDown: false,
            close: function(i) {
                var dialog = document.getElementsByClassName("tw2gui_dialog_framefix")[i || 0];
                if (dialog) dialog.parentNode.removeChild(dialog);
            }
        },
        TW2Pro.ui.tw2guiButton = function(title, onclick, style) {
            return '<div' + (style ? ' style="' + style + '"' : "") + ' onclick="' + onclick + '" class="tw2gui_button"><div class="tw2gui_button_right_cap"></div><div class="tw2gui_button_left_cap"></div><div class="tw2gui_button_middle_bg"></div><div class="textart_title">' + title + '</div></div>';
        };
    TW2Pro.skinPacksInfo = function() {
        new west.gui.Dialog().setTitle('Skin packs coming soon...').setText('<div>skript na skiny e\u0161te nie je hotov\u00fd, pre viac info sledujte vl\u00e1kno na f\u00f3re<br><br>&nbsp;&nbsp;<a target="_blank" href="https://forum.the-west.sk/index.php?threads/tw2pro.22238/page-2">https://forum.the-west.sk/index.php?threads/tw2pro.22238/page-2</a><br>&nbsp;&nbsp;<a target="_blank" href="https://forum.the-west.cz/index.php?threads/tw2pro.28911/page-2">https://forum.the-west.cz/index.php?threads/tw2pro.28911/page-2</a><br><br>\u010dakanie si m\u00f4\u017eete spr\u00edjemni\u0165 meme obr\u00e1zkami s t\u00e9matikou The West<br><br>&nbsp;&nbsp;<a target="_blank" href="https://forum.the-west.cz/index.php?threads/the-west-memes.31153/">https://forum.the-west.cz/index.php?threads/the-west-memes.31153/</a><br><br>alebo zauj\u00edmavou h\u00e1dankou, co m\u00e1 marcelka v kabelce<br><br>&nbsp;&nbsp;<a target="_blank" href="https://forum.the-west.cz/index.php?threads/co-m%C3%A1-marcelka-v-kabelce.31157/">https://forum.the-west.cz/index.php?threads/co-m%C3%A1-marcelka-v-kabelce.31157/</a></div>').addButton('Ok').show();
    };
    document.addEventListener("keyup", function(e) {
        if (e.keyCode === 17)
            if (TW2Pro.ui.dialog.itemInfoKeyDown) TW2Pro.ui.dialog.itemInfoKeyDown = false;
            else TW2Pro.ui.dialog.close();
    });
    document.addEventListener("keydown", function(e) {
        if (e.keyCode === 17 && !document.getElementsByClassName("tw2gui_dialog_framefix")[0] && document.getElementById("popup").style.display === "block" && !isNaN(+document.getElementsByClassName("tw2pro_item_id")[0].textContent)) {
            var width = (document.getElementsByClassName("mousepopup")[0].offsetWidth - 36) + "px";
            TW2Pro.ui.dialog.itemInfoKeyDown = true,
                new west.gui.TextInputDialog().setWidth(width).setTitle("Item info").setText(document.getElementsByClassName("popup_content")[0].innerHTML + "<br>" + TW2Pro.ui.tw2guiButton("Add to skin pack", "TW2Pro.skinPacksInfo()") + "<br><br>Item BB code.").addButton("Copy", function() {
                    input.select(),
                        document.execCommand("copy");
                }).show();
            var input = document.getElementsByClassName("tw2gui_dialog")[0].getElementsByTagName("input")[0];
            document.getElementsByClassName("tw2gui_dialog")[0].style.minWidth = width,
                document.getElementsByClassName("fbar-add-dialog")[0].style.textAlign = "left",
                input.value = "[item=" + TW2Pro.inventory.itemId + "]",
                input.readOnly = true,
                input.onclick = function() {
                    this.select();
                },
                input.select();
        };
    });
    var inventory = Inventory.open,
        setxhtml = MousePopup.prototype.setXHTML,
        updateposition = MousePopup.prototype.updatePosition;
    MousePopup.prototype.setTimeout = function() {
            document.getElementById("popup").style.display = "block",
                this.notify("onShow");
        },
        MousePopup.prototype.setXHTML = function() {
            arguments[0] = TW2Pro.mousePopup.filter(arguments[0]);
            return setxhtml.apply(this, arguments);
        },
        MousePopup.prototype.updatePosition = function() {
            var itemId = $(arguments[0].target).data("itemId");
            updateposition.apply(this, arguments);
            if (itemId && TW2Pro.inventory.itemId !== itemId) TW2Pro.inventory.itemId = itemId;
            else if (document.getElementsByClassName("tw2pro_item_id")[0]) document.getElementsByClassName("tw2pro_item_id")[0].textContent = itemId || "?";
        },
        Inventory.open = function() {
            var windowInventory = document.getElementsByClassName("tw2gui_win2 inventory")[0];
            var filter = function() {
                var focused = windowInventory.className.match(/focused_([^ ]*)/)[1];
                Array.prototype.forEach.call(document.getElementById("bag").getElementsByTagName("div"), function(item) {
                    var popup = item._mpopup.text = item._mpopup.text;
                    item.style.opacity = focused === "wear" || focused === "marketplace" && /inventory_popup_auctionable/.test(popup) || focused === "new_item_shop" && !/not_sellable/.test(item.className) || focused === "win_item_upgrade" && !/not_upgradeable/.test(item.className) ? "1" : "0.5";
                });
            };

            if (!wman.getById("inventory")) {
                var original = inventory.apply(this, arguments);
                windowInventory = document.getElementsByClassName("tw2gui_win2 inventory")[0];
                return windowInventory.getElementsByClassName("filters")[0].addEventListener("click", filter),
                    windowInventory.getElementsByClassName("bag_navigation")[0].addEventListener("click", filter),
                    filter(), original;
            } else {
                var original = inventory.apply(this, arguments);
                filter();
                return original;
            };

        };
    TheWestApi.register("TW2ProTools", "TW2Pro tools", "2.10.0", "99", "Jaroslav Jursa (Blood Killer)", "https://greasyfork.org/sk/users/383161-jaroslav-jursa").setGui("MIT License, Copyright (c) 2014-2019 Jaroslav Jursa (Blood Killer)");
})();
 
Naposledy upraveno:
Malá chyba tam bola, teraz som to opravil. :D
//edit: netreba používať TW2Pro, nový skript funguje samostatne, ešte musím doplniť niečo, aby to skrytie vecí fungovalo aj na kolečko myši... Prípadné chyby hláste sem...
 
Naposledy upraveno:
nový skript TW2Pro tools [beta]

download

bookmarklet
JavaScript:
javascript:void $.getScript("//greasyfork.org/scripts/392332-tw2pro-tools/code/TW2Pro%20tools.user.js")
funkcie
  • na trhu sú skryté všetky veci čo nie sú dražiteľné
  • popup s informáciami o predmete sa vám zobrazí okamžite, nie po 300 milisekundách, ako to je v hre nastavené
  • priemerný dmg, id predmetu (v inventáti to funguje všade, inde to nemusí id ukazovať, opravím keď pridám databázu itemov)
  • prejdenie kurzorom na item (nie klikať) + CTRL, zobrazí sa okno odkiaľ sa dá skopírovať id itemu, časom pridám ďalšie možnosti
také malé demo zatiaľ, kiež by som mal na to viac času teraz... postupne budem pridávať nové veci, nechcel som sem dávať veci čo nemám úplne hotové...

JavaScript:
// ==UserScript==
// @name        TW2Pro tools
// @namespace   Blood Killer
// @author      Jaroslav Jursa
// @homepage    https://forum.the-west.sk/index.php?threads/tw2pro.22238/
// @include     http*://*.the-west.*
// @exclude     http*://forum.the-west.*
// @version     1
// @grant       none
// @run-at      document-idle
// @description javascript:void $.getScript("//greasyfork.org/scripts/392332-tw2pro-tools/code/TW2Pro%20tools.user.js")
// ==/UserScript==
/*


MIT License

Copyright (c) 2014-2019 Jaroslav Jursa

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


*/
(function() {
    if (typeof TW2Pro === "undefined") TW2Pro = {};
    TW2Pro.ui = {};
    TW2Pro.inventory = {};
    TW2Pro.mousePopup = {
        filter: function(text) {
            return /inventory_popup/.test(text) ? text.replace(/(<\/div><div>)(<img src="[^"]+divider\.png[^>]+><\/div><\/div>)/, '$1<span><b>Item ID:</b> <span class="tw2pro_item_id">?</span></span><br>$2<br>').replace(/(<[^>]+>)([\d ]+)(<\/[^>]+>)(\s*\-\s*)(<[^>]+>)([\d ]+)(<\/[^>]+>)([^(]+)(<\/[^>]+>)/, function($0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
                return $1 + $2 + $3 + $4 + $5 + $6 + $7 + " (~" + ((+$2 + (+$6)) / 2) + ")" + $8 + $9;
            }) : text;
        }
    };
    TW2Pro.ui.dialog = {
            itemInfoKeyDown: false,
            close: function(i) {
                var dialog = document.getElementsByClassName("tw2gui_dialog_framefix")[i || 0];
                if (dialog) dialog.parentNode.removeChild(dialog);
            }
        },
        TW2Pro.ui.tw2guiButton = function(title, onclick, style) {
            return '<div' + (style ? ' style="' + style + '"' : "") + ' onclick="' + onclick + '" class="tw2gui_button"><div class="tw2gui_button_right_cap"></div><div class="tw2gui_button_left_cap"></div><div class="tw2gui_button_middle_bg"></div><div class="textart_title">' + title + '</div></div>';
        };
    TW2Pro.skinPacksInfo = function() {
        new west.gui.Dialog().setTitle('Skin packs coming soon...').setText('<div>skript na skiny e\u0161te nie je hotov\u00fd, pre viac info sledujte vl\u00e1kno na f\u00f3re<br><br>&nbsp;&nbsp;<a target="_blank" href="https://forum.the-west.sk/index.php?threads/tw2pro.22238/page-2">https://forum.the-west.sk/index.php?threads/tw2pro.22238/page-2</a><br>&nbsp;&nbsp;<a target="_blank" href="https://forum.the-west.cz/index.php?threads/tw2pro.28911/page-2">https://forum.the-west.cz/index.php?threads/tw2pro.28911/page-2</a><br><br>\u010dakanie si m\u00f4\u017eete spr\u00edjemni\u0165 meme obr\u00e1zkami s t\u00e9matikou The West<br><br>&nbsp;&nbsp;<a target="_blank" href="https://forum.the-west.cz/index.php?threads/the-west-memes.31153/">https://forum.the-west.cz/index.php?threads/the-west-memes.31153/</a><br><br>alebo zauj\u00edmavou h\u00e1dankou, co m\u00e1 marcelka v kabelce<br><br>&nbsp;&nbsp;<a target="_blank" href="https://forum.the-west.cz/index.php?threads/co-m%C3%A1-marcelka-v-kabelce.31157/">https://forum.the-west.cz/index.php?threads/co-m%C3%A1-marcelka-v-kabelce.31157/</a></div>').addButton('Ok').show();
    };
    document.addEventListener("keyup", function(e) {
        if (e.keyCode === 17)
            if (TW2Pro.ui.dialog.itemInfoKeyDown) TW2Pro.ui.dialog.itemInfoKeyDown = false;
            else TW2Pro.ui.dialog.close();
    });
    document.addEventListener("keydown", function(e) {
        if (e.keyCode === 17 && !document.getElementsByClassName("tw2gui_dialog_framefix")[0] && document.getElementById("popup").style.display === "block" && !isNaN(+document.getElementsByClassName("tw2pro_item_id")[0].textContent)) {
            var width = (document.getElementsByClassName("mousepopup")[0].offsetWidth - 36) + "px";
            TW2Pro.ui.dialog.itemInfoKeyDown = true,
                new west.gui.TextInputDialog().setWidth(width).setTitle("Item info").setText(document.getElementsByClassName("popup_content")[0].innerHTML + "<br>" + TW2Pro.ui.tw2guiButton("Add to skin pack", "TW2Pro.skinPacksInfo()") + "<br><br>Item BB code.").addButton("Copy", function() {
                    input.select(),
                        document.execCommand("copy");
                }).show();
            var input = document.getElementsByClassName("tw2gui_dialog")[0].getElementsByTagName("input")[0];
            document.getElementsByClassName("tw2gui_dialog")[0].style.minWidth = width,
                document.getElementsByClassName("fbar-add-dialog")[0].style.textAlign = "left",
                input.value = "[item=" + TW2Pro.inventory.itemId + "]",
                input.readOnly = true,
                input.onclick = function() {
                    this.select();
                },
                input.select();
        };
    });
    var inventory = Inventory.open,
        setxhtml = MousePopup.prototype.setXHTML,
        updateposition = MousePopup.prototype.updatePosition;
    MousePopup.prototype.setTimeout = function() {
            document.getElementById("popup").style.display = "block",
                this.notify("onShow");
        },
        MousePopup.prototype.setXHTML = function() {
            arguments[0] = TW2Pro.mousePopup.filter(arguments[0]);
            return setxhtml.apply(this, arguments);
        },
        MousePopup.prototype.updatePosition = function() {
            var itemId = $(arguments[0].target).data("itemId");
            updateposition.apply(this, arguments);
            if (itemId && TW2Pro.inventory.itemId !== itemId) TW2Pro.inventory.itemId = itemId;
            else if (document.getElementsByClassName("tw2pro_item_id")[0]) document.getElementsByClassName("tw2pro_item_id")[0].textContent = itemId || "?";
        },
        Inventory.open = function() {
            var windowInventory = document.getElementsByClassName("tw2gui_win2 inventory")[0];
            var filter = function() {
                var focused = windowInventory.className.match(/focused_([^ ]*)/)[1];
                Array.prototype.forEach.call(document.getElementById("bag").getElementsByTagName("div"), function(item) {
                    var popup = item._mpopup.text = item._mpopup.text;
                    item.style.opacity = focused === "wear" || focused === "marketplace" && /inventory_popup_auctionable/.test(popup) || focused === "new_item_shop" && !/not_sellable/.test(item.className) || focused === "win_item_upgrade" && !/not_upgradeable/.test(item.className) ? "1" : "0.5";
                });
            };

            if (!wman.getById("inventory")) {
                var original = inventory.apply(this, arguments);
                windowInventory = document.getElementsByClassName("tw2gui_win2 inventory")[0];
                return windowInventory.getElementsByClassName("filters")[0].addEventListener("click", filter),
                    windowInventory.getElementsByClassName("bag_navigation")[0].addEventListener("click", filter),
                    filter(), original;
            } else {
                var original = inventory.apply(this, arguments);
                filter();
                return original;
            };

        };
    TheWestApi.register("TW2ProTools", "TW2Pro tools", "2.10.0", "99", "Jaroslav Jursa (Blood Killer)", "https://greasyfork.org/sk/users/383161-jaroslav-jursa").setGui("MIT License, Copyright (c) 2014-2019 Jaroslav Jursa (Blood Killer)");
})();
Borce mam reklamaci...
1573658491671.png