d2jsp
Log InRegister
d2jsp Forums > d2jsp > Ladder Slasher > History Of Items
Prev1234Next
Add Reply New Topic New Poll
Member
Posts: 15,284
Joined: Dec 22 2004
Gold: 72,365.76
Apr 19 2018 11:06am
Quote (sp_patl @ 19 Apr 2018 06:50)
still works, but since some firefox update its a little bugged when moving back and forth on the same page / char


the bug i meant . but nothing a refresh cannot solve , so its okay

http://prntscr.com/j7gob3

Member
Posts: 26,620
Joined: Jul 3 2006
Gold: 7,798.12
Apr 19 2018 02:50pm
Can one of you guys that are versed in programming set up exactly whatever I need to copy/paste to make the script work?
Robin from UA was trying to help me, but it's not working. I'm not a programmer, so I'm pretty clueless. He said the same thing :lol:

I'm using Firefox. It's up-to-date.
I installed ViolentMonkey (and removed Greasemonkey)

I copy and pasted what was above (and changed/added my d2jsp user ID...pretty sure I did that right)
My d2jsp user ID is: 256037

Anyways, it's not working. And I'm thinking this should be way more easier to do...but I've tried!

Thanks.

This post was edited by Brainwashed on Apr 19 2018 02:51pm
Member
Posts: 26,503
Joined: Oct 15 2006
Gold: 105,555.55
Apr 20 2018 03:39am
Quote (Brainwashed @ 19 Apr 2018 21:50)
Can one of you guys that are versed in programming set up exactly whatever I need to copy/paste to make the script work?
Robin from UA was trying to help me, but it's not working. I'm not a programmer, so I'm pretty clueless. He said the same thing :lol:

I'm using Firefox. It's up-to-date.
I installed ViolentMonkey (and removed Greasemonkey)

I copy and pasted what was above (and changed/added my d2jsp user ID...pretty sure I did that right)
My d2jsp user ID is: 256037

Anyways, it's not working. And I'm thinking this should be way more easier to do...but I've tried!

Thanks.


You shouldn't have to insert your d2jsp user ID anywhere.
https://github.com/violentmonkey/violentmonkey/issues/107 There's a bug with ViolentMonkey, so you might wanna use TamperMonkey.
I'm using the Firefox Developer version, that shouldn't matter.

I just:

  • went to TamperMonkey
  • clicked create new script
  • pasted my code
  • saved


and it just werks.

I wrote my own script (which slightly differs from the one I posted earlier due to tampermonkey using it slightly different):

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 url = `http://ladderslasher.d2jsp.org/itemHistory.php?i=${id}&c=1`

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`)});

})()


if you want you can try that, or just use what patl posted.
Member
Posts: 17,642
Joined: Nov 27 2005
Gold: 1,039.71
Trader: Trusted
Apr 20 2018 10:19am
Quote (Dante @ Apr 20 2018 01:39am)
You shouldn't have to insert your d2jsp user ID anywhere.
https://github.com/violentmonkey/violentmonkey/issues/107 There's a bug with ViolentMonkey, so you might wanna use TamperMonkey.
I'm using the Firefox Developer version, that shouldn't matter.

I just:
  • went to TamperMonkey
  • clicked create new script
  • pasted my code
  • saved


and it just werks.

I wrote my own script (which slightly differs from the one I posted earlier due to tampermonkey using it slightly different):

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 url = `http://ladderslasher.d2jsp.org/itemHistory.php?i=${id}&c=1`

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`)});

})()


if you want you can try that, or just use what patl posted.


This works for me on Chrome also. Ty Dante
Member
Posts: 26,620
Joined: Jul 3 2006
Gold: 7,798.12
Apr 22 2018 05:37am
Quote (Dante @ Apr 20 2018 05:39am)
You shouldn't have to insert your d2jsp user ID anywhere.
https://github.com/violentmonkey/violentmonkey/issues/107 There's a bug with ViolentMonkey, so you might wanna use TamperMonkey.
I'm using the Firefox Developer version, that shouldn't matter.

I just:
  • went to TamperMonkey
  • clicked create new script
  • pasted my code
  • saved


and it just werks.

I wrote my own script (which slightly differs from the one I posted earlier due to tampermonkey using it slightly different):

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 url = `http://ladderslasher.d2jsp.org/itemHistory.php?i=${id}&c=1`

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`)});

})()


if you want you can try that, or just use what patl posted.


Okay so I tried this and it worked like a charm.

Thanks dude! :hug:
Members++
Posts: 71,770
Joined: Jun 12 2007
Gold: 505,061.21
Trader: Trusted
Apr 22 2018 06:16am
Quote (sp_patl @ 19 Apr 2018 19:06)
the bug i meant . but nothing a refresh cannot solve , so its okay

http://prntscr.com/j7gob3


Didnt work for me

__________

Tried Dante's and each item says "item not found"

I do see the id's and they are all correct im sure, it's just not showin any history clicking the links.

I'm using Chrome

This post was edited by RistVaLL on Apr 22 2018 06:30am
Member
Posts: 26,620
Joined: Jul 3 2006
Gold: 7,798.12
Apr 22 2018 06:30am
Quote (RistVaLL @ Apr 22 2018 08:16am)
Yours dont work for me, I wonder if it's because of "hcchar" listed twice in the script, would a simple scchar work you think? ^^

edit; didnt work unless im supposed to remove them or something, idk i cant script so ^^


_:__________

Tried Dante's and each item says "item not found"

I do see the id's and they are all correct im sure, it's just not showin any history clicking the links.

I'm using Chrome


I didn't click on the item ID link earlier, so I tired it. And it also says Item not found.
However, at least I can see the item ID's easier. And doing a copy/paste in the gold logs shows the history.
I can settle with this though since I can see the item IDs and not sift through the messy page source coding :D

This post was edited by Brainwashed on Apr 22 2018 06:31am
Member
Posts: 26,503
Joined: Oct 15 2006
Gold: 105,555.55
Apr 22 2018 07:27am
Quote (RistVaLL @ 22 Apr 2018 13:16)
Didnt work for me

__________

Tried Dante's and each item says "item not found"

I do see the id's and they are all correct im sure, it's just not showin any history clicking the links.

I'm using Chrome


are you sure the items you're clicking have a history?
if so, please send me the character link so I can investigate
Members++
Posts: 71,770
Joined: Jun 12 2007
Gold: 505,061.21
Trader: Trusted
Apr 22 2018 07:27am
Quote (Dante @ 22 Apr 2018 15:27)
are you sure the items you're clicking have a history?
if so, please send me the character link so I can investigate


yes, will after the climb :D
Member
Posts: 26,503
Joined: Oct 15 2006
Gold: 105,555.55
Apr 22 2018 07:28am
Quote (RistVaLL @ 22 Apr 2018 14:27)
yes, will after the climb :D


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

edit: I have a feeling it has to do with cores. one param says c=1, which may be hardcore, that might need to be adjusted

This post was edited by Dante on Apr 22 2018 07:29am
Go Back To Ladder Slasher Topic List
Prev1234Next
Add Reply New Topic New Poll