// ==UserScript== // @name TheWest - Tamagotchi PG // @namespace https://greasyfork.org/scripts/35553-thewest-tamagotchi-pg // @version 0.45 // @description Power up your character with the Tamagothi menu // @author Adriano // @license LGPLv3 // @include http*://*.the-west.*/game.php // @include http*://*.the-west.*.*/game.php* // @include http*://*.tw.innogames.*/game.php* // @grant none // @downloadURL none // ==/UserScript== function appendScript(fn) { var newScript = document.createElement('script'); newScript.setAttribute("type", "application/javascript"); newScript.textContent = '(' + fn + ')();'; document.body.appendChild(newScript); document.body.removeChild(newScript); } appendScript(function() { //'use strict'; var VERSION = 0.45; var URL_INSTALL = "https://greasyfork.org/scripts/35553-thewest-tamagotchi-pg"; var URL_CODE = "https://greasyfork.org/scripts/35553-thewest-tamagotchi-pg/code/TheWest%20-%20Tamagotchi%20PG.user.js"; var scriptAuthor = "Adriano"; var scriptCredits = 'TW Friends for the base script, Adriano (Tiger54) for this script
.
'; var scriptName = "Tamagotchi PG"; var scriptObject = "TamagotchiPG"; this[scriptObject] = { options: { hide0Items : false, init: function() { var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i   " + TamagotchiPG.localeManager.getMsg('opt_hide0elements') + "
"); TamagotchiPG.script.api.setGui(desc); }, save: function() { var d = new Date(); var exdays = 365; d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+ d.toUTCString(); document.cookie = "hideitems=" + this.hide0Items.toString() + ";" + expires + ";path=/"; this.init(); }, }, toolbar: { div1: null, menuicons : [], menutitles : [], init : function() { this.menutitles.push(TamagotchiPG.localeManager.getMsg("menu_energy")); this.menuicons.push("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAGASURBVDhPY2QgADTnX+gDKkqBclHAfwaGOQQN0Jh3/tPmWAPer0DVyIAbqNN38YXPBA1QnXeuD2gXiguSAw14566/8JmBgXEOVIg4oDz39Kf57//8B9HKc04BDWZgYALLEAEUZh3v+/v3LwPXv38MIPpuilkRSJxoA/7+/5+yMMyIt2TNmc9AI+BOJ8oAqRmH+/79/8Pw7NsfBhD9KM0abDsIEAxEyRkH+hiAti8LseCNWnMCGHBIgJFxDiOueAbF8fVEgyKxaXs/rQiy5D37/icDLwsTgxovKwMvKxOYbbf08GdGjXnngPFsiBLPkDg+//lGkhGf8LQ9fYxAF0ClUMB/kAuU55zpA3oEriAlwIB3zgZgHP9nmHM3xQTuV7wAFEXys058mvvq538QDeJDpQgCRplZh4GBxJCyMcKc13/FSUQgMTLMeZJmS9gFEtP3f9r/6vv/npsf/s+8++k/iH3j06//IHGoEryAURQYSOhpHQIY57zOciEuDMgHDAwASoGne8UPddgAAAAASUVORK5CYII="); this.menutitles.push(TamagotchiPG.localeManager.getMsg("menu_live")); this.menuicons.push("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAK9SURBVDhPZVFNSFRRFD73vvv+dP5/TA2LyFoMhkGZNtgiWtYiWkm1CwkXQYuWRT/Qpto2tYySWmUQCNFCcBU5i5FwkaILLTAzdd78vnnvvnc7943NWH2Xj3ff5ZzvnO8cArtYvnLsnNnbc72jtyejGIbl1WszvFx5n777Lr8bAmvXRhJqLBy1Q876ofuztnwLBBYvHXmgxaJ34kMnoKO/H5RwCITngbO+7tqrq1Pb8wsv3XL5fOr0qQuqoad4ubrIS9aT7kcfX5OvF/uvcrv+KjGQgejgAGipFFBNA6JqIIQPvlWEytIKcMeFSOYoUHzjpTLUf/yE2s72mDLeTZ8zXe/Tk3FgGgNh18ErWcCLRfCsHfy3gZkGClIQDQeEg+QciBDg1+z9pJCNrKnhcF+orwfMrnQzmFI01xpPcBe+hxRAFSV48hwOjaL1ncyPxgqEKceNeAz0eBSYgQIKCjTHA+ij+UUIvAfiIFDABduqLJDCaOIxTuwWM/SguqKqWGWPwB4IPASP7ISjFe7wpySfjRxWQMwRQhIEKFDaTvxfQoo0BXzfq1FBR4KY/HBoglGS87kHvoNEv7L1fwVabhSGJLeHC/bDVkz+ZGeOMjLhVnH/VRc9opDMaI8gANUo6Kb6ttHVGDs7C1yaDWDWqjeZC5NmJ6rrKthcgUqNQKkCYCFLVaxFVEgY+ozHGuMyWeY1d4LIbYK3L+5Md/sslQypQ9gAVGwfbBfARzPJCIMVpkxPNezLN5ZhZzetLSAxuwn+iw33A25KOZNWszhYygWBdFSFGR/e3PvWmPhcgiKGtoz9EZCzMJFp5ME5y1tZqotitosNxjsV7dmWO5nbcHPYjLQs6SCxx/am5GMYGUMmkXGkecCgmRgD/UvF/4T/v5BbSNlBDfmXgITsRkXiFIO7FJVBWDiAHJrknr0A/AaAiiZKS6khhwAAAABJRU5ErkJggg=="); this.menutitles.push(TamagotchiPG.localeManager.getMsg("menu_work")); this.menuicons.push("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIvSURBVDhPY6AUMEJpOFi1ahUbLy+v47+/DP4MDP89GRj/Sf37/4+F8d+/M39+M/QHBAesgCoFAwwD1q5d+wFIff/D8O8X03+Gr4z/GVVMzUxY+XgFGG7fucVw9879/cwsjB5hYWG/IDoIgNmzl4nPnDHj56f3H////PHr/+kzp//PnTv3CFSagQlK4wTffnzar6GjzfbpyyeGt2/fM6goqzIwMTFaz5kzhxckzwxWhQNcWp0Weu8tRxIHlwALHz8fw6NHDxjWrV//RUdbj+3Bg/v5jo6OTBhhAANnlyV08QgIl0qrOzJMXX6UgV9MmeHFsyfPGBkZwxgYGddYWVlIHNh/+ANWLxxbENXOxiVYqqBtx/Dn8QEGR/nHDLramgz///+Xra+vP/rv71/VA/v3//z583skVAsC7Jsa1n56ec7/b7fX/H+6Mfn//ulh/w9MD3SFSsNBcXGxPIhG8cLWPr8OHiHJchNrJ4Zn5zYz3H7+lYHh3293r6Itu6BKMADcC2tbPNvZuYTKDUwcGR4cXcNw5f5bhm9fvnng0wwCYBcsrXHs5BeWKrOy82a4f3IFw62XX4AW//OIbjuwE6wKD2CcXWjTLSQhWeLo5Mdw49AShpsvvjP8/f/HPaXnGF6bYYCJX0iyxNYpgOHK3oUM5x98Yvj68bsnsZpBgOnr188MF3bOYTh//yPDz6/f3HNmnd4BlSMKML16+8r44oPP237/+GFSNO8i0TZDAAMDAHNc5AhTlzLSAAAAAElFTkSuQmCC"); this.menutitles.push(TamagotchiPG.localeManager.getMsg("menu_duel")); this.menuicons.push("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJgSURBVDhPXVNLaxNRGD1zp0maSSeJbQiNmqahIghWRBF8LO1CEURxVbClO0HoXxAUseBjpW7cGO2iW11okaIupODGLiwurIiBCsF2TNM8JplJZsb5vulNUw9kvty5nPO9zij4D5Zleh27ThGu68B1HDhuB6roQ2wgiZie3sPpHohI0Wxs89lzrT0CFAlCDWMwlUUkojGXHzIrYe2vgxfLBuZ/plFtufxOdyq4mq9g+qSK0VSU3w3vH2MRFmjUNjg7kSdeii6R4LUCYc9qQBcmnl1RcCIbRigURi4/rigyey853i8wNbaB8/mg7Pe/VBQ+11BrOtCjKl5P9yGtuRjO5KBQdrvt4PaigaffUkwuTJRw5pCOdrvDAq5jY+W3g6kFk0UujFTx8NqQX0UIgqZNA6OeCZT53OEk7i6ZyD4SOHiviQefgGMZFTOndaitLSytOb54G6ZpQvCk/R+VTv1S2ZZl4cmXfu6b8PhjBUWj2W3J9u+/l1r8X9CDViSHRaCSJRlWLYg7IHIvhNxzPNRhEg2MMHvWjztk6vlAQsWrr00+E0aHBM9AKRtFr2nWcOttHYXVKK9qflLjnqlsApFX1m1cf77JFVwa1zB3OY5EIgnhm8FXirBJiExTpmnfeRe09KfqYO7DLjkciWDmFPkghHgiFThRVrH8o47JBd/3/qQlensm8s2Ledw43oCmxQIj0QWZqWysw7ZtLvv+4iberJpMkqCyKfPREZ2zZ3NHdq1MCESKvgjt2OYdy1XRwAZiMSaSheV3QHddAYmtcsmrbhssQiDDSCL1vG8w08MB/gGLnVdrhFP3wgAAAABJRU5ErkJggg=="); this.menutitles.push(TamagotchiPG.localeManager.getMsg("menu_speed")); this.menuicons.push("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJbSURBVDhP1ZFfSJNhFMZ/3/fNf21maqUu0DaxUjNLKkskEwwCuzESoW606KKIIvAiNLGLgggjqgsvyiC6tosyoi6KNA2demNmTbZkGlua23Slc7l9vd+3VUJ01VXPy3n/cZ5znnMO/wopdv6B0xWYImHuqip1wnTIEkFJoa29m5boz18CCPLB8DJPd+zZS0lpOQS9JBjT8Hjc9L7owu32e+70kaX5KjpjBfTMy4xWVR/CsmENjjcPcNsHcY70sSoxSGllDVOucVN+elAZcvFSvtl2Qr11/WRMJKgR7hUWF7A2GcZ6HzL8IcTrMRh0wONndnqe3GdfRbkmXS9DPtfYsfMXW0DUXVtQuBWnrQu7G6wllZxtaub8xWaq647y1hEgLrKIEtMuCxviZ5cERKMIzX1EEqdsMlO8NZeBR1cZ6LxCfNhHlmULPvd74gxRf+nGtQadLskGp7+/N9/rebe0vyybuWkXn5Td5EgD+BYTGRoLYrbksDHDQPyCA5sT2l8JmtFkpHB7EbmbrNb0igPjC0HweVy6gpB/gslpyMsvovFSK9VVu0gQZLcfFpd4rikwBOYDonERDELT5oK87In1yXzxB8hIg1RpmlERgH4bn+02zZ9JL0zNoHYOc0Z7y5JItfD1m2i/Sji0RNmxU6xOgrBQkhIPRZngn4eeEegW9t1oZtuRevVya4PQIUq/0FjTkZmRetySZyUhSTBlBUkRTFkWoxJLlKKbcFbF0saEUOydmcU7O1Ov/Ztbmmpvp6UYD0e7qcfVtt9Y+YwNLBpYSxFFtrB10ev/BfgBAJbZLBlRl5gAAAAASUVORK5CYII="); this.menutitles.push(TamagotchiPG.localeManager.getMsg("menu_luck")); this.menuicons.push("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHXSURBVDhPzVK/SxxREJ55b9c9A0Gw0EaxSWWT1iAhamMhxhCxs9ErhUAQ8kOLNIk/CiHWCgeCRWyMpLUR70yKIGIhaVLYWYlR8C7u7ozf29t78f6C+G3xhplvZr6ZWfrv4Pz1WPnS1x5HdpWEhZLCq7cTu5fLO/0fRelxYHjuzVj5OKdmCPLX4yYKi0w6SYZIW6qHi9+eHBjiOYNWqaIM0WidWYdX0OisxE/h7HE+sD8YpYoy7WYk0j8oUb6rBH3qcJ1Rb9IlG7ZkTECs1CGkncSGAtsCFrcZ5hEo+VTPulMA5OM0dU2JRFMKkWBsMMPGbka2lVKJM54Dk/mZm81LXNjpe8Riu4g5QOdSZAtdqoqCMSrLuAqdI+Xq3YvyIWNRLscr2NqasCzhAMwBxAZNwu0GYQaTMRKuMtSIff76rC1LAvwVfodnU8y65kS5Lyo8oGqtemWC+CIKH3ZjgBmRJOPWJOnFM+3sfzuA0NzMut6k19iBrGKBxb/xNQ7gw03wBapHlRKeacy6JxjWzY4vZfdDAW6xKHEKc5aT1tfO59C0RIel7f4iJKw7W5WnxCY/KLYn1uJQoqX3LyuZ9Aa8gga8EiTXjvY35p9//2UDHYavqfN9AdEtwWC1pb0pEz8AAAAASUVORK5CYII="); this.menutitles.push(TamagotchiPG.localeManager.getMsg("menu_special")); this.menuicons.push("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHZSURBVDhPY2TAAXh5ec9KSkoKA5ksr1+//vX+/XsliAwqYILSKICLi8uIiYlJWFlZWR4IpJmZmfkkJCRModIoAKsBQNtTli1bJqumpsagpaXFMHnyJGEpKalqqDRRQMTKyurwgwcP/l+7evW/v7//a5AYRAoVYHUBELxhYWH5CWUzsLKy/gFSbyA8VIDLAKIBLgPEgDHAD2IAA5BBUECAFyQG4hMFREREuk6dOvULFAb379//v3PH9v+6uroLodIEAa+7u/txkOYLFy78j4tIuO1o4PlIjFf6FUgOogQBMBISGxNHpaqceqIgh+ivH6/+MVtw+qrwMAuw3P557f/hd8t6X/1+WgpVCgboBrApsGvvjZYps/kPCnck8OnfJ4Zd7xY/v/X1lAKQ+wsiihaIrEysCfZCQVoMbJgpnJuRm0Gdy0yCl0kkCyoEBsgGMIqyyEZIC6gJ/f/2HyqEAMyMzAzS7CqMouzSeUAu3AZkA6QVOLREGP9jaoYDoDZRNjlxIEsKIoBqwJMrX49duPXu/DMoHw5+AwPk/d/3DPe+X/734Pulw0ChpxAZzEBkZGJijZRglYvmYRZUZGFk5QTawfaP4e+/738/PX/96/G0b/8+g9ID1JkMDAC5gYpHMXGa0wAAAABJRU5ErkJggg=="); }, closeDefault : function() { if(typeof CharacterWindow.window != 'undefined' && CharacterWindow.window !== null) CharacterWindow.window.destroy(); return true; }, }, powerItems: { subdivs : [], riposo : [], vita : [], lavoro : [], duello : [], velocita : [], fortuna : [], createFunc : function (msg) {return function(){$.globalEval(msg);};}, createFunc2 : function (index, div) { return function() { TamagotchiPG.powerItems.showItems(index, ([ TamagotchiPG.powerItems.riposo, TamagotchiPG.powerItems.vita, TamagotchiPG.powerItems.lavoro, TamagotchiPG.powerItems.duello, TamagotchiPG.powerItems.velocita, TamagotchiPG.powerItems.fortuna ])[index], div); }; }, move : function(qty, div) { var currLeft = parseInt(div.style.left) / 61; if(currLeft - qty > 0) qty = currLeft; if(div.childNodes.length <= -(currLeft - qty)) qty = 0; if(qty !== 0) { var single = qty / Math.abs(qty); div.style.left = ((currLeft - single) * 61) + "px"; if(single != qty) setTimeout(function(){TamagotchiPG.powerItems.move(qty - single, div);}, 40); } }, showItems : function(el, arr, div) { for(var j=0;j 0) div.removeChild(div.childNodes[0]); div.style.left = "0px"; var t = new ServerDate().getTime()/1000; var hideItems = TamagotchiPG.options.hide0Items; for(j in arr) { if(!(!isNaN(parseFloat(arr[j])) && isFinite(arr[j]))) continue; var it = ItemManager.get(arr[j]); if(it === null || it.name === null || it.name =='undefined') { console.error("TW-Tamagotchi Script: Item " + arr[j] + " not found"); continue; } var bagItem = Bag.getItemByItemId(arr[j]); var itemCounts = (bagItem !== null && typeof bagItem !=='undefined' && bagItem.count != 'undefined') ? bagItem.count : 0; var divi = document.createElement("div"); divi.className = "item item_inventory not_upgradeable hasMousePopup"; var img = document.createElement("img"); img.className = "tw_item item_inventory_img dnd_draggable"; img.setAttribute("src", "https://westit.innogamescdn.com/" + it.image ); var cooldownvar = false; var span = null; if(itemCounts > 0) { var itemCooldown=Bag.itemCooldown[arr[j]],globalCooldown=bagItem.obj.has_cooldown?Character.cooldown:0,cooldown=Math.max(itemCooldown||0,globalCooldown||0); img.addEventListener("click", this.createFunc(it.action)); if(parseInt(bagItem.cooldown) > 0 || parseInt(cooldown) > 0) { cooldownvar = (parseInt(bagItem.cooldown) > 0)?bagItem.cooldown:cooldown; if(t < cooldownvar) { span = document.createElement("span"); span.className = "cooldown"; span.setAttribute("style", "display:block;"); span.appendChild(document.createTextNode((cooldownvar - t).getTime2EndShort())); } } } else if(hideItems) continue; var tt = new ItemPopup(it,{show_buffs:false,show_compare:false,show_alreadyown:false,traderCharge:false,show_setboni:true,character:this.character,show_sell_price:true,show_lifetime:false,show_cooldown:cooldownvar}); tt.bindTo(img); divi.appendChild(img); var spa = document.createElement("span"); spa.className = "count"; spa.setAttribute("style", "display:block;"); spa.appendChild(document.createTextNode(itemCounts)); divi.appendChild(spa); if(span !== null) divi.appendChild(span); div.appendChild(divi); } }, init : function() { this.riposo.push(2485000); // sacco riposo 10%R this.riposo.push(1971000); // calumet 100%R this.riposo.push(1997000); // arrosto 100%R 100%L this.riposo.push(2130000); // tè maté 100%R 20%L 20%D this.riposo.push(17028000); // barattolo spinaci 100%R 100%V 100%L 100%D this.riposo.push(50113000); // zuppa fagioli 100%R 20%V 20%L 20%D this.riposo.push(2129000); // guaranà 50%R 10%L 10%D this.riposo.push(16100000); // borsa medico 40%R 25%V this.riposo.push(2128000); // caffé 25%R 5%L 5%D this.riposo.push(1890000); // tè 20%R this.riposo.push(1969000); // whiskey invecchiato 20%R this.riposo.push(1970000); // torta di ciliegie 20%R this.riposo.push(2356000); // birra 15%R this.riposo.push(13704000); // liquore qualità 15%R this.riposo.push(2294000); // colore blu 15%R this.riposo.push(2670000); // tamales 15%R this.riposo.push(12704000); // pan pepato 15%R this.riposo.push(2525000); // inchiostro 15%R 15%V this.riposo.push(1928000); // sacco a pelo 15%R 15%L this.riposo.push(1898000); // acqua di rosa 15%R 25%V this.riposo.push(1943000); // fagioli cotti 10%R this.riposo.push(2358000); // salsiccia 10%R 10%V this.riposo.push(13706000); // arancia 10%R 10%V this.riposo.push(12706000); // marzapane 10%R 10%V this.riposo.push(2672000); // bambola 10%R 10%V this.riposo.push(2296000); // fuoco artificio 10%V 10%R this.riposo.push(185205000); // uovo pasqua 10%R 10%V this.riposo.push(255000); // insalata pomodori 10%R 10%L this.riposo.push(1892000); // liquore fruttato 10%R 15%V this.riposo.push(1985000); // liquore squisito 10%R 15%D this.riposo.push(1937000); // zaino 10%S 5%R this.vita.push(17028000); // barattolo spinaci 100%R 100%V 100%L 100%D this.vita.push(2117000); // liquido 75%V this.vita.push(1974000); // elisir 50%V this.vita.push(2116000); // linfa 25%V this.vita.push(16100000); // borsa medico 40%R 25%V this.vita.push(1898000); // acqua di rosa 15%R 25%V this.vita.push(2295000); // colore bianco 20%V this.vita.push(2357000); // crauti 20%V this.vita.push(2671000); // pan muertos 20%V this.vita.push(12705000); // tortino 20%V this.vita.push(13705000); // fagioli e pancetta 20%V this.vita.push(185204000); // uovo pasqua 20%V this.vita.push(2734000); // lanterna 300%S 20%V 20%D this.vita.push(50113000); // zuppa fagioli 100%R 20%V 20%L 20%D this.vita.push(1892000); // liquore fruttato 10%R 15%V this.vita.push(2525000); // inchiostro 15%R 15%V this.vita.push(2358000); // salsiccia 10%R 10%V this.vita.push(12706000); // marzapane 10%R 10%V this.vita.push(2296000); // fuoco artificio 10%V 10%R this.vita.push(13706000); // arancia 10%R 10%V this.vita.push(2672000); // bambola 10%R 10%V this.vita.push(185205000); // uovo pasqua 10%R 10%V this.vita.push(1883000); // medicina stomaco 10%V this.lavoro.push(2484000); // sacco motivazione 10%L 10%D this.lavoro.push(1997000); // arrosto 100%R 100%L this.lavoro.push(2391000); // zucca 100%L 100%D this.lavoro.push(17028000); // barattolo spinaci 100%R 100%V 100%L 100%D this.lavoro.push(1934000); // pomello da sella 100%S 30%L 30%D this.lavoro.push(1984000); // lozione capelli 20%L this.lavoro.push(185200000); // uovo pasqua 15%L this.lavoro.push(1891000); // tabacco 25%L this.lavoro.push(2268000); // acqua saponata 25%L 25%D this.lavoro.push(2130000); // tè maté 100%R 20%L 20%D this.lavoro.push(50113000); // zuppa fagioli 100%R 20%V 20%L 20%D this.lavoro.push(2353000); // pretzel 15%L this.lavoro.push(2667000); // mezcal 15%L this.lavoro.push(13701000); // pomodoro 15%L this.lavoro.push(12701000); // liquirizia 15%L this.lavoro.push(2291000); // fuoco artificio 15%L this.lavoro.push(1928000); // sacco a pelo 15%R 15%L this.lavoro.push(2516000); // hushpuppy 15%L 15%D this.lavoro.push(2706000); // coniglio 10%L this.lavoro.push(2707000); // coniglio 10%L this.lavoro.push(2129000); // guaranà 50%R 10%L 10%D this.lavoro.push(255000); // insalata pomodori 10%R 10%L this.lavoro.push(1939000); // sigarette con filtro 7%L 7%D this.lavoro.push(2128000); // caffé 25%R 5%L 5%D this.duello.push(2484000); // sacco motivazione 10%L 10%D this.duello.push(2391000); // zucca 100%L 100%D this.duello.push(17028000); // barattolo spinaci 100%R 100%V 100%L 100%D this.duello.push(50135000); // pigmenti 30%D this.duello.push(1934000); // pomello da sella 100%S 30%L 30%D this.duello.push(50136000); // testamento 25%D this.duello.push(2268000); // acqua saponata 25%L 25%D this.duello.push(2734000); // lanterna 300%S 20%V 20%D this.duello.push(2130000); // tè maté 100%R 20%L 20%D this.duello.push(50113000); // zuppa fagioli 100%R 20%V 20%L 20%D this.duello.push(2355000); // pan zenzero 15%D this.duello.push(185202000); // uovo pasqua 15%D this.duello.push(2294000); // colore rosso 15%D this.duello.push(2669000); // calavera 15%D this.duello.push(13703000); // sigarette 15%D this.duello.push(12703000); // petardo 15%D this.duello.push(1985000); // liquore squisito 10%R 15%D this.duello.push(2516000); // hushpuppy 15%L 15%D this.duello.push(1882000); // spazzola tubolare 10%D this.duello.push(1952000); // sacco del cibo 15%S 10%D this.duello.push(1988000); // fondina 10%D this.duello.push(2129000); // guaranà 50%R 10%L 10%D this.duello.push(1939000); // sigarette con filtro 7%L 7%D this.duello.push(2128000); // caffé 25%R 5%L 5%D this.velocita.push(2229000); // bevanda galattica 60000%S this.velocita.push(2734000); // lanterna 300%S 20%V 20%D this.velocita.push(2284000); // ferri 200%S this.velocita.push(2519000); // vettura corsa 200%S this.velocita.push(1987000); // redini 125%S this.velocita.push(1934000); // pomello da sella 100%S 30%L 30%D this.velocita.push(1927000); // briglie 50%S this.velocita.push(1968000); // tonificante 50%S this.velocita.push(13702000); // ferro cavallo 50%S this.velocita.push(185201000); // uovo pasqua 25%S this.velocita.push(1919000); // integratore 25%S this.velocita.push(2292000); // fuochi 25%S this.velocita.push(2354000); // stinco 25%S this.velocita.push(2668000); // candele 25%S this.velocita.push(12702000); // avena 25%S this.velocita.push(1926000); // sperone 20%S this.velocita.push(1918000); // zoccolo 15%S this.velocita.push(1952000); // sacco del cibo 15%S 10%D this.velocita.push(1937000); // zaino 10%S 5%R // ultimo: stinco di maiale }, }, localeManager: { localeDefault: 'en_US', localeScript: 'en_US', getMsg: function(msg) { if(undefined !== this.languages[this.localeScript][msg]) return this.languages[this.localeScript][msg]; if(undefined !== this.languages[this.localeDefault][msg]) return this.languages[this.localeDefault][msg]; return ''; }, checkLanguages: function() { var langs = Object.keys(this.languages), messages = Object.keys(this.languages[this.localeDefault]), that = this; $.each(messages, function(i, msg) { $.each(langs, function(j, lang) { if(!that.languages[lang].hasOwnProperty(msg)) console.log('Missing '+lang+'.'+msg); else if(typeof that.languages[that.localeDefault][msg] == "object") { $.each(Object.keys(that.languages[that.localeDefault][msg]), function(k, msg2) { if(!that.languages[lang][msg].hasOwnProperty(msg2)) console.log('Missing '+lang+'.'+msg+'.'+msg2); }); } }); }); $.each(langs, function(i, lang) { $.each(Object.keys(that.languages[lang]), function(j, msg) { if(!messages.includes(msg)) console.log('Obsolete message '+lang+'.'+msg); else if(typeof that.languages[lang][msg] == "object") { $.each(Object.keys(that.languages[lang][msg]), function(j, msg2) { if(!that.languages[that.localeDefault][msg].hasOwnProperty(msg2)) console.log('Obsolete message '+lang+'.'+msg+'.'+msg2); }); } }); }); }, setLocale: function(localeSelected) { this.localeScript = (undefined !== this.languages[localeSelected]) ? localeSelected : this.localeDefault; }, languages: { en_US: { description: '

The West - Tamagotchi PG

Add a Tamagothi Toolbar over your PG

You will be able to use consumables ordered by type:

Credits: '+scriptCredits+'

Options: [OPTIONS]

', version: 'version', version_checkFailed: 'Unable to check for updates', version_checkManual: 'Check manually', version_ok: 'You already have the latest version', version_upgrade: 'A new version is available. Do you want to upgrade now?', refresh: 'Refresh', opt_hide0elements: 'Hide elements that are not in inventory', menu_live : 'Live points', menu_energy : 'Energy points', menu_work : 'Work motivation', menu_duel: 'Duel motivation', menu_speed: 'Speed', menu_luck: 'Luck', menu_special: 'Special items', }, it_IT: { description: '

The West - Tamagotchi PG

Aggiungi un menu in stile Tamagotchi al tuo PG

Potrai usare in modo semplice i consumabili ordinati per:

Credits: '+scriptCredits+'

Opzioni: [OPTIONS]

', version: 'versione', version_checkFailed: 'impossibile cercare aggiornamenti', version_checkManual: 'Cerca manualmente', version_ok: 'Possiedi la versione più recente', version_upgrade: 'E\' disponibile una nuova versione, aggiornare ora?', refresh: 'Aggiorna', opt_hide0elements: 'Nascondi gli elementi non presenti in inventario', menu_live : 'Punti vita', menu_energy : 'Punti riposo', menu_work : 'Motivazione lavoro', menu_duel: 'Motivazione duello', menu_speed: 'Velocità', menu_luck: 'Fortuna', menu_special: 'Oggetti speciali', } }, }, script: { api: null, listeningSignal: 'game_config_loaded', loaded: false, init: function() { var that = this; if(this.loaded) return false; EventHandler.listen(this.listeningSignal, function() { that.init(); return EventHandler.ONE_TIME_EVENT; }); if(!!(Game && Game.loaded)) { this.loaded = true; TamagotchiPG.localeManager.setLocale(Game.locale); this.api = TheWestApi.register(scriptObject, scriptName, VERSION.toString(), Game.version.toString(), scriptAuthor, URL_INSTALL); TamagotchiPG.options.init(); TamagotchiPG.powerItems.init(); TamagotchiPG.toolbar.init(); var j; AnimatedCharacter.getElement()[0].addEventListener("click", function(e) { e.preventDefault(); if(TamagotchiPG.toolbar.div1 !== null) { for(var h1 in TamagotchiPG.toolbar.div1.childNodes) { if(e.target == TamagotchiPG.toolbar.div1.childNodes[h1]) return TamagotchiPG.toolbar.closeDefault(); for(var h2 in TamagotchiPG.toolbar.div1.childNodes[h1].childNodes) { if(e.target == TamagotchiPG.toolbar.div1.childNodes[h1].childNodes[h2]) return TamagotchiPG.toolbar.closeDefault(); for(var h3 in TamagotchiPG.toolbar.div1.childNodes[h1].childNodes[h2].childNodes) { if(e.target == TamagotchiPG.toolbar.div1.childNodes[h1].childNodes[h2].childNodes[h3]) return TamagotchiPG.toolbar.closeDefault(); } } } try { AnimatedCharacter.getElement()[0].removeChild(TamagotchiPG.toolbar.div1); TamagotchiPG.toolbar.div1 = null; TamagotchiPG.powerItems.subdivs = []; return TamagotchiPG.toolbar.closeDefault(); } catch(err){} } var div3 = document.createElement("div"); div3.setAttribute("style", "width:305px;height:60px;display:block;margin-left:5px;overflow:hidden;"); var div2 = document.createElement("div"); div2.setAttribute("style", "width:3000px;max-height:60px;padding-left:0px;left:0px;position:relative;"); div3.appendChild(div2); TamagotchiPG.toolbar.div1 = document.createElement("div"); TamagotchiPG.toolbar.div1.setAttribute("style", "width:330px;height:90px;border-radius:8px;overflow:hidden;display:block;left:" + AnimatedCharacter.getElement()[0].style.left + ";top:" + AnimatedCharacter.getElement()[0].style.top + ";transform:translate(-150px,-146px);"); TamagotchiPG.toolbar.div1.className = "work hasMousePopup"; var divbg = document.createElement("div"); divbg.setAttribute("style", "opacity:0.8;width:330px;height:90px;position:absolute;left:0px;top:0px;border-radius:8px;background:linear-gradient(0deg, rgba(0,0,0,0.6), rgba(96,64,16,0.7)), url('https://westit.innogamescdn.com/images/tw2gui/groupframe/groupframe_bg.jpg');background-color:#4B2503;background-repeat:no-repeat;background-size:330px 90px;"); TamagotchiPG.toolbar.div1.appendChild(divbg); var table = document.createElement("div"); table.setAttribute("style","cursor:pointer;display:table;margin:0 auto;text-align:center;"); for(var k=0;k<5;k++) { var td = document.createElement("div"); var imgi = document.createElement("img"); td.setAttribute("style","width:24px;height:24px;opacity:0.6;margin:2px;display:inline-block;background-size:cover;"); td.addEventListener("click", TamagotchiPG.powerItems.createFunc2(k, div2)); imgi.setAttribute("src", TamagotchiPG.toolbar.menuicons[k]); imgi.setAttribute("style", "width:16px;height:16px;margin:2px;margin-top:4px;"); imgi.className = "tw_item item_inventory_img dnd_draggable"; imgi.setAttribute("title", TamagotchiPG.toolbar.menutitles[k]); td.appendChild(imgi); td.className = "item item_inventory title hasMousePopup"; TamagotchiPG.powerItems.subdivs.push(td); table.appendChild(td); } TamagotchiPG.toolbar.div1.appendChild(table); table = document.createElement("div"); table.setAttribute("style","cursor:pointer;font-size:18px;position:absolute;display:block;margin-left:310px;width:16px;"); for(k=0;k<2;k++) { var tx = document.createElement("div"); tx.setAttribute("style","width:15px;height:22px;color:white;padding:0px;margin-"+(k===0?"top":"bottom")+":4px;padding-top:3px;display:block;background-size:cover;text-align:center;"); tx.addEventListener("click", k===0?function(){TamagotchiPG.powerItems.move(+5,div2);}:function(){TamagotchiPG.powerItems.move(-5,div2);}); tx.appendChild(document.createTextNode([">","<"][k])); tx.className = "item item_inventory title hasMousePopup"; table.appendChild(tx); } TamagotchiPG.toolbar.div1.appendChild(table); TamagotchiPG.powerItems.showItems(0, TamagotchiPG.powerItems.riposo, div2); TamagotchiPG.toolbar.div1.appendChild(div3); AnimatedCharacter.getElement()[0].appendChild(TamagotchiPG.toolbar.div1); return TamagotchiPG.toolbar.closeDefault(); }); } }, }, }; $(function() { try { TamagotchiPG.script.init(); } catch(x) { console.trace(x); } }); });