This is a read-only archive of forum.logicalgamers.com. Registration, posting and private messaging are not available.

[Userscript] - zOMG Inventory Ring Sorter

2k views · started by XiRaX ·
#1
[Userscript] - zOMG Inventory Ring Sorter
I'll keep this short and sweet.

The zOMG Inventory tab was giving me a headache so I added a sort button. Use it, edit it.. I don't really care.

Tampermonkey Script
Spoiler

// ==UserScript==
// @name zOMG Ring Sorter
// @namespace all
// @include http://www.gaiaonline.com/inventory*
// @version 1
// @grant none
// ==/UserScript==

(function(){
'use strict';

window.addEventListener('load', () => {
addButton('click', sortRings);
});

function addButton(text, onclick, cssObj) {
cssObj = cssObj || {position: 'block'};
var zomgDiv = document.getElementById('tabs_container');
let button = document.createElement('button'), btnStyle = button.style;
zomgDiv.prepend(button);
var html_to_insert = "<span>Sort Rings</span>";
button.innerHTML += html_to_insert;
button.onclick = onclick;
button.className = 'cta-button-md';
Object.keys(cssObj).forEach(key => btnStyle[key] = cssObj[key]);
return button;
}

function sortRings() {
$("#zomg li").sort(sort_li).appendTo('#zomg ul');
function sort_li(a, b){
return ($(b).data('item')) < ($(a).data('item')) ? 1 : -1;
}
}

}());
[/key][/key]


If you want to save the sort just move an item to enable the save button
#2
OK. This is good for me

Was literally trying to sort everything last night :( thank you
#3
This is god beautiful idea, thank you
#4
OK. This is good for me

Was literally trying to sort everything last night :( thank you


MattSmith wrote:
This is god beautiful idea, thank you


Thanks, I couldn't stand the clutter.
#5
Do you think you can make one for each of the tabs? Or somehow organize the items by the most expensive?
#6
[QUOTE=Tem Ditties;426122]Do you think you can make one for each of the tabs? Or somehow organize the items by the most expensive?[/QUOTE]

Items by worth would be great.
#7
This is very useful. Thank you so much.
#8
sylverx wrote:
Items by worth would be great.


Yes please! I spent so long organizing by color so I don't know if it would be possible to do that either but either of those things would be so helpful
#9
i hope this still works
#10
because my inventory is a mess now
#11
Dhacker wrote:
i hope this still works


Just add an s in the http in the script above.