Well so I need another AH so the other script can work :/
You may be able to work around this by changing the execution order/position of this script. In TamperMonkey for example, if you move the Smart Blocker to position 1, then it should execute before the other scripts do - allowing it to change the layout of the page as intended. However, unless the other scripts are better at compensating for page changes than the Smart Blocker, then you may just be shuffling your issues around. It's going to be a gamble either way.
I'd offer to modify the Smart Blocker to work around your current issue, but if you added or took away a script in the future, it may break this one again. Unless you find a single script that does everything you want, or a set of scripts that were expressly designed to work with one-another, then you may run into more problems.
You may be able to work around this by changing the execution order/position of this script. In TamperMonkey for example, if you move the Smart Blocker to position 1, then it should execute before the other scripts do - allowing it to change the layout of the page as intended. However, unless the other scripts are better at compensating for page changes than the Smart Blocker, then you may just be shuffling your issues around. It's going to be a gamble either way.
I'd offer to modify the Smart Blocker to work around your current issue, but if you added or took away a script in the future, it may break this one again. Unless you find a single script that does everything you want, or a set of scripts that were expressly designed to work with one-another, then you may run into more problems.
The Haggler script you're using specifically targets and removes the item's "onclick" attribute in order to allow you to jump to the haggle page without a confirmation popup. The Smart Blocker was specifically designed to parse an item's "onclick" attribute in order to get that item's name. So when the Haggler removes "onclick" - it stops the Smart Blocker from reading the items.
Try this version of the Smart Blocker. I've replaced the name retrieval method with one that doesn't use the "onclick" attribute.
Code:
// ==UserScript==
// @author Backslash
// @(you need an account to see links)cription Hides items that are not in the restock list
// @include (you need an account to see links)
// @(you need an account to see links) Neopets : Shops : Smart Block
// @(you need an account to see links)space (you need an account to see links)
// @version 1.2
// ==/UserScript==
/*
2018-11-15 Modified by Odd
- replaced item name retrieval method by reading the "B" element after the item haggle link instead of reading the haggle link's "onclick" attribute
2018-11-14 Modified by Odd
- added version
- changed the "include" so that the script will only run in shops instead of on every page
- fixed issue with adding the listbox UI by targeting the specific cell that the author wanted it in instead of doing a page-wide find-and-replace
- fixed issue with "rsList" showing on initial load despite the "User the Smart Block Feature" checkbox not being checked
- replaced GM_getValue and GM_setValue with a quick and dirty localStorage getter and setter (also added a "smartBlock" prefix to each variable in order to avoid ambiguity issues when using shared storage)
*/
function getValue(name, defaultValue) {
var value = localStorage.getItem(name);
if (value != null) return value;
return defaultValue;
}
function setValue(name, value) {
if (value == null || value === undefined) localStorage.removeItem(name);
else localStorage.setItem(name, value);
}
var layout = '\
<div class="contentModule" style="height: 100%"><table cellpadding="3" cellspacing="0" border="0" class="contentModuleTable">\
<tr>\
<td class="contentModuleHeader"> Smart Block</td>\
</tr>\
<tr>\
<td align="left" valign="top" class="contentModuleContent">\
<div align="center">\
<input type="checkbox" name="team" id="team" value="team" '+ getValue('smartBlock.team', '') + '> <label for="team">Use the Smart Block Feature</label><br>\
<div id="rsList" style="' + ((getValue('smartBlock.team') == "checked") ? "" : "display: none;") + '">Enter a list of items that you don\'t want the script to block.<br><textarea id="listBox" style="width:80%;height:125px;">'+ getValue('smartBlock.rsList', 'No Items Listed') + '</textarea><br><Br></div><button id="saveButton">Save Settings</button>\
</div><br />\
</td>\
</tr></table></div>\
';
document.querySelector("td[width='304']").innerHTML += layout;
document.getElementById('team').addEventListener('click', sBlockClick, false);
function sBlockClick() {
if (document.getElementById('team').checked == true) {
document.getElementById('rsList').setAttribute("style", "");
}
else {
document.getElementById('rsList').setAttribute("style", "display:none;");
}
}
document.getElementById('saveButton').addEventListener('click', saveSettings, false);
function saveSettings() {
setValue('smartBlock.rsList', document.getElementById('listBox').value);
if (document.getElementById('team').checked == true) {
setValue('smartBlock.team', 'checked');
} else {
setValue('smartBlock.team');
}
window.location.reload();
}
function AdBlock(c) {
a = document.evaluate("//table[@align = 'center' and @cellpadding = '4']/tbody//td", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
b = a.snapshotLength;
h = new Array();
if (b > 0) {
hiddenItems = document.evaluate("//table[@align = 'center' and @cellpadding = '4']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(0).innerHTML;
for (var i = 0, link; i < b; i++) {
if ((link = a.snapshotItem(i).getElementsByTagName('a')[0]) && link.nextSibling && link.nextSibling.nodeName == "B") {
itemName = (link.nextSibling.textContent || "");
for (j = 0; j < c.length; j++) {
if (c[j].toLowerCase() == itemName.toLowerCase()) {
h.push(a.snapshotItem(i));
break;
}
}
a.snapshotItem(i).parentNode.removeChild(a.snapshotItem(i));
}
}
if (h.length > 0) {
for (i = 0; i < (h.length / 6) + 1; i++) {
f = document.evaluate("//table[@align = 'center' and @cellpadding = '4']/tbody/tr", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(i);
for (j = 0; j < 6 ; j++) {
if (typeof h[0] != 'undefined') {
f.appendChild(h[0]);
h.splice(0, 1);
}
}
}
}
document.evaluate("//td[@class = 'contentModuleHeader']/b", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(0).innerHTML = "Shop Inventory currently contains <b><font color=#3BB9FF>" + b + "</font></b> items (click <u><div style='cursor:pointer; display:inline;' id='hiddenItems'>here</div></u> to view full shop stock)";
document.getElementById('hiddenItems').addEventListener('click', function () { document.evaluate("//table[@align = 'center' and @cellpadding = '4']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(0).innerHTML = hiddenItems; }, false);
}
}
if (getValue('smartBlock.team') == "checked") {
var items = getValue('smartBlock.rsList').split('\n');
AdBlock(items);
}
The Haggler script you're using specifically targets and removes the item's "onclick" attribute in order to allow you to jump to the haggle page without a confirmation popup. The Smart Blocker was specifically designed to parse an item's "onclick" attribute in order to get that item's name. So when the Haggler removes "onclick" - it stops the Smart Blocker from reading the items.
Try this version of the Smart Blocker. I've replaced the name retrieval method with one that doesn't use the "onclick" attribute.
Code:
// ==UserScript==
// @author Backslash
// @(you need an account to see links)cription Hides items that are not in the restock list
// @include (you need an account to see links)
// @(you need an account to see links) Neopets : Shops : Smart Block
// @(you need an account to see links)space (you need an account to see links)
// @version 1.2
// ==/UserScript==
/*
2018-11-15 Modified by Odd
- replaced item name retrieval method by reading the "B" element after the item haggle link instead of reading the haggle link's "onclick" attribute
2018-11-14 Modified by Odd
- added version
- changed the "include" so that the script will only run in shops instead of on every page
- fixed issue with adding the listbox UI by targeting the specific cell that the author wanted it in instead of doing a page-wide find-and-replace
- fixed issue with "rsList" showing on initial load despite the "User the Smart Block Feature" checkbox not being checked
- replaced GM_getValue and GM_setValue with a quick and dirty localStorage getter and setter (also added a "smartBlock" prefix to each variable in order to avoid ambiguity issues when using shared storage)
*/
function getValue(name, defaultValue) {
var value = localStorage.getItem(name);
if (value != null) return value;
return defaultValue;
}
function setValue(name, value) {
if (value == null || value === undefined) localStorage.removeItem(name);
else localStorage.setItem(name, value);
}
var layout = '\
<div class="contentModule" style="height: 100%"><table cellpadding="3" cellspacing="0" border="0" class="contentModuleTable">\
<tr>\
<td class="contentModuleHeader"> Smart Block</td>\
</tr>\
<tr>\
<td align="left" valign="top" class="contentModuleContent">\
<div align="center">\
<input type="checkbox" name="team" id="team" value="team" '+ getValue('smartBlock.team', '') + '> <label for="team">Use the Smart Block Feature</label><br>\
<div id="rsList" style="' + ((getValue('smartBlock.team') == "checked") ? "" : "display: none;") + '">Enter a list of items that you don\'t want the script to block.<br><textarea id="listBox" style="width:80%;height:125px;">'+ getValue('smartBlock.rsList', 'No Items Listed') + '</textarea><br><Br></div><button id="saveButton">Save Settings</button>\
</div><br />\
</td>\
</tr></table></div>\
';
document.querySelector("td[width='304']").innerHTML += layout;
document.getElementById('team').addEventListener('click', sBlockClick, false);
function sBlockClick() {
if (document.getElementById('team').checked == true) {
document.getElementById('rsList').setAttribute("style", "");
}
else {
document.getElementById('rsList').setAttribute("style", "display:none;");
}
}
document.getElementById('saveButton').addEventListener('click', saveSettings, false);
function saveSettings() {
setValue('smartBlock.rsList', document.getElementById('listBox').value);
if (document.getElementById('team').checked == true) {
setValue('smartBlock.team', 'checked');
} else {
setValue('smartBlock.team');
}
window.location.reload();
}
function AdBlock(c) {
a = document.evaluate("//table[@align = 'center' and @cellpadding = '4']/tbody//td", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
b = a.snapshotLength;
h = new Array();
if (b > 0) {
hiddenItems = document.evaluate("//table[@align = 'center' and @cellpadding = '4']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(0).innerHTML;
for (var i = 0, link; i < b; i++) {
if ((link = a.snapshotItem(i).getElementsByTagName('a')[0]) && link.nextSibling && link.nextSibling.nodeName == "B") {
itemName = (link.nextSibling.textContent || "");
for (j = 0; j < c.length; j++) {
if (c[j].toLowerCase() == itemName.toLowerCase()) {
h.push(a.snapshotItem(i));
break;
}
}
a.snapshotItem(i).parentNode.removeChild(a.snapshotItem(i));
}
}
if (h.length > 0) {
for (i = 0; i < (h.length / 6) + 1; i++) {
f = document.evaluate("//table[@align = 'center' and @cellpadding = '4']/tbody/tr", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(i);
for (j = 0; j < 6 ; j++) {
if (typeof h[0] != 'undefined') {
f.appendChild(h[0]);
h.splice(0, 1);
}
}
}
}
document.evaluate("//td[@class = 'contentModuleHeader']/b", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(0).innerHTML = "Shop Inventory currently contains <b><font color=#3BB9FF>" + b + "</font></b> items (click <u><div style='cursor:pointer; display:inline;' id='hiddenItems'>here</div></u> to view full shop stock)";
document.getElementById('hiddenItems').addEventListener('click', function () { document.evaluate("//table[@align = 'center' and @cellpadding = '4']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(0).innerHTML = hiddenItems; }, false);
}
}
if (getValue('smartBlock.team') == "checked") {
var items = getValue('smartBlock.rsList').split('\n');
AdBlock(items);
}
This has probably been asked over and over but I can't find it so can't hurt to ask I guess. Is it possible to turn converted pets into unconverted pets? XP