d2jsp
Log InRegister
d2jsp Forums > d2jsp > Ladder Slasher > History Of Items
Prev1234Next
Add Reply New Topic New Poll
Members++
Posts: 71,770
Joined: Jun 12 2007
Gold: 505,061.21
Trader: Trusted
Apr 22 2018 07:29am
Quote (Dante @ 22 Apr 2018 15:28)
if I can reproduce it, or we can figure out what's wrong on either side, I can fix that and post the fixed script


https://forums.d2jsp.org/user.php?c=3&i=344838&p=101246
https://i.imgur.com/stKgZem.jpg

Ice
Member
Posts: 26,503
Joined: Oct 15 2006
Gold: 105,555.55
Apr 22 2018 07:29am
Quote (RistVaLL @ 22 Apr 2018 14:29)


see my edit, softcore seems to be c=0
I'll work on something to fix that
Members++
Posts: 71,770
Joined: Jun 12 2007
Gold: 505,061.21
Trader: Trusted
Apr 22 2018 07:31am
Quote (Dante @ 22 Apr 2018 15:29)
see my edit, softcore seems to be c=0
I'll work on something to fix that


I will look around on the script in a few min :D
Member
Posts: 26,503
Joined: Oct 15 2006
Gold: 105,555.55
Apr 22 2018 07:32am
Quote (RistVaLL @ 22 Apr 2018 14:31)
I will look around on the script in a few min :D


Code
// ==UserScript==
// @name Show Item IDs
// @namespace http://tampermonkey.net/
// @version 0.1
// @author Dante@JSP
// @match http*://forums.d2jsp.org/user.php?c=*&i=*&p=*
// ==/UserScript==

/* jshint ignore:start */
(function() {
var elements = Array.apply(null, document.querySelectorAll('dd.ce'))
// Get all elements except the first because we don't want that
.slice(1)
// Convert nodeList to native arrays and remove the text elements
.map(a => Array.apply(null, a.childNodes).filter(b => b.nodeType !== 3))
.reduce( (prev, curr) => prev.concat(curr), [])
// Filter empty elements that are at the end
.filter(a => a.className !== 'c');

elements
.reduce( (prev, curr) => {
// Previous node was a comment and current node is an item
if (prev.nodeType === 8 && curr.nodeType === 1) {
const id = prev.data.match(/\d{1,99}/)[0];
const core = document.querySelectorAll('.ftbt')[0].childNodes[1].childNodes[2].childNodes[1].innerHTML === 'Original' ? 0 : 1;
const url = `http://ladderslasher.d2jsp.org/itemHistory.php?i=${id}&c=${core}`

curr.innerHTML += `<br/><a href=${url}>ID: ${id}</a>`;
curr.style.height = '100%'
}

// Always return the node for the next iteration
return curr;
}, {nodeType: null})


var maxHeight = elements
.reduce( (prev, curr) => prev > curr.offsetHeight || !curr.offsetHeight ? prev : curr.offsetHeight, 0);

elements
.forEach(ell => {ell.nodeType === 1 && (ell.style.height = `${maxHeight}px`)});

})()


can you try this? this includes the core fix
Members++
Posts: 71,770
Joined: Jun 12 2007
Gold: 505,061.21
Trader: Trusted
Apr 22 2018 07:33am
Quote (Dante @ 22 Apr 2018 15:32)
Code
// ==UserScript==
// @name Show Item IDs
// @namespace http://tampermonkey.net/
// @version 0.1
// @author Dante@JSP
// @match http*://forums.d2jsp.org/user.php?c=*&i=*&p=*
// ==/UserScript==

/* jshint ignore:start */
(function() {
var elements = Array.apply(null, document.querySelectorAll('dd.ce'))
// Get all elements except the first because we don't want that
.slice(1)
// Convert nodeList to native arrays and remove the text elements
.map(a => Array.apply(null, a.childNodes).filter(b => b.nodeType !== 3))
.reduce( (prev, curr) => prev.concat(curr), [])
// Filter empty elements that are at the end
.filter(a => a.className !== 'c');

elements
.reduce( (prev, curr) => {
// Previous node was a comment and current node is an item
if (prev.nodeType === 8 && curr.nodeType === 1) {
const id = prev.data.match(/\d{1,99}/)[0];
const core = document.querySelectorAll('.ftbt')[0].childNodes[1].childNodes[2].childNodes[1].innerHTML === 'Original' ? 0 : 1;
const url = `http://ladderslasher.d2jsp.org/itemHistory.php?i=${id}&c=${core}`

curr.innerHTML += `<br/><a href=${url}>ID: ${id}</a>`;
curr.style.height = '100%'
}

// Always return the node for the next iteration
return curr;
}, {nodeType: null})


var maxHeight = elements
.reduce( (prev, curr) => prev > curr.offsetHeight || !curr.offsetHeight ? prev : curr.offsetHeight, 0);

elements
.forEach(ell => {ell.nodeType === 1 && (ell.style.height = `${maxHeight}px`)});

})()


can you try this? this includes the core fix


Thanks, that works! :D
Member
Posts: 26,503
Joined: Oct 15 2006
Gold: 105,555.55
Apr 22 2018 07:34am
Quote (RistVaLL @ 22 Apr 2018 14:33)
Thanks, that works! :D


thanks for the bug report, I only play HC so I didn't instinctively test SC items
Members++
Posts: 71,770
Joined: Jun 12 2007
Gold: 505,061.21
Trader: Trusted
Apr 22 2018 07:34am
Quote (Dante @ 22 Apr 2018 15:34)
thanks for the bug report, I only play HC so I didn't instinctively test SC items


Yeah I thought it had something to do with hc, since alot of lines was asking for hcchar etc
I never really use it myself, but thanks alot , im sure alot of ppl will be happy !

This post was edited by RistVaLL on Apr 22 2018 07:35am
Member
Posts: 26,503
Joined: Oct 15 2006
Gold: 105,555.55
Apr 22 2018 07:36am
Quote (RistVaLL @ 22 Apr 2018 14:34)
Yeah I thought it had something to do with hc, since alot of lines was asking for hcchar etc
I never really use it myself, but thanks alot , im sure alot of ppl will be happy !


it was a fun challenge, glad if it helps anyone
Member
Posts: 24,497
Joined: Jan 30 2007
Gold: 74,290.21
Apr 22 2018 07:39am
Quote (Dante @ Apr 22 2018 07:34am)
thanks for the bug report, I only play HC so I didn't instinctively test SC items


So. I play both. How can we modify it so I don't have to have two scripts running :P
Member
Posts: 26,503
Joined: Oct 15 2006
Gold: 105,555.55
Apr 22 2018 07:40am
Quote (a_hotter_otter @ 22 Apr 2018 14:39)
So. I play both. How can we modify it so I don't have to have two scripts running :P


you don't, the script I just posted should work for both now
I didn't post a separate softcore script, I just modified it to consider the core
Go Back To Ladder Slasher Topic List
Prev1234Next
Add Reply New Topic New Poll