Shartak Rearrange Inventory

rearranges a few inventory items

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// ==UserScript==
// @name           Shartak Rearrange Inventory
// @namespace      http://userscripts.org/users/125692
// @description    rearranges a few inventory items
// @include        http://www.shartak.com/game.cgi
// @version 1.1
// ==/UserScript==

var a= document.getElementsByClassName("nodot inventory");
var first=a[0].firstElementChild;
var last=a[0].lastElementChild;
var target;
var b;

b= document.getElementsByClassName("inv-08 invtype-tool");//active GPS
if(b.length>0){
    target=b[0];
    var c=document.getElementsByClassName("timenowshown");
    var buttons=c[0].nextElementSibling;
    var newElement = document.createElement("ul");
    c[0].parentNode.insertBefore(newElement,buttons);
    newElement.appendChild(target);
	target.className="";//get rid of class name for this moved gps!
}


b= document.getElementsByClassName("inv-07 invtype-healing");//healing herbs
if(b.length>0){
    target=b[0];
    a[0].insertBefore(target,first);
}

b= document.getElementsByClassName("inv-06 invtype-healing");//FAKS
if(b.length>0){
    target=b[0];
    a[0].insertBefore(target,first);
}

b= document.getElementsByClassName("inv-0W invtype-drink");//empties
if(b.length>0){
    target=b[0];
    a[0].insertBefore(target,last.nextSibling);
}

b= document.getElementsByClassName("inv-0X invtype-drink");//native empties
if(b.length>0){
    target=b[0];
    a[0].insertBefore(target,last.nextSibling);
}