Greasy Fork is available in English.

UD Scale

Betrays the weight of things

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name		UD Scale
// @namespace		http://www.cursedtower.com/dem
// @version		1.0
// @description		Betrays the weight of things
// @include		http://urbandead.com/*
// @include		http://www.urbandead.com/*
// @grant      
// ==/UserScript==

/* Urban Dead Scale
 * v1.0
 *
 * Copyright (C) 2014 Dr Heward
 * Author: Elaine M Heward (MEMS) aka Ayelis
 * Last Modified: 2014-04-27
 * 
 * Tested under: Firefox 28 on Windows
 *   
 * Changes:
 *   v1.0 - Now works in Firefox
 *
 */

var drops = document.evaluate("//select[@name='drop']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

for(var i=0;i<drops.snapshotLength;i++){
    drop = drops.snapshotItem(i);
    for(j=0;j<drop.options.length;j++){
        if(drop.options[j].value!="")
           drop.options[j].text=drop.options[j].text+" - "+getWeight(drop.options[j].value)+"%";
    }
}

function getWeight(item){
    switch(item.substring(0,1)){
        case "a": case "c": case "e": case "f":
        case "g": case "h": case "j": case "k":
        case "l": case "m": case "n": case "r":
        case "t": case "x": case "y": case "z":
            val=2;
            break;
        case "b": case "B": case "d": case "D":
        case "F": case "p": case "q": case "u":
        case "w":
            val=4;
            break;
        case "o": case "s":
            val=6;
            break;
        case "i":
            val=10;
            break;
        default:
       switch(item){
        case "G6":
               val=0;
               break;
        case "J1":
               val=16;
               break;
        case "G2": case "G3": case "G4": case "J2":
               val=2;
               break;
        case "I39":
               val=6;
               break;
           default:
               val=20;
       }
    }
    return val;
}