SIDs

Covert SID to HEX in Kingofsat.fr

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         SIDs
// @version      0.1
// @description  Covert SID to HEX in Kingofsat.fr
// @author       ShadyOrr
// @icon         http://upload.dinhosting.fr/j/a/r/d41d8cd98f00b204e9800998ecf8427e.png
// @include      http://*.kingofsat.fr/*.php*
// @namespace http://your.homepage/
// ==/UserScript==

var tds = document.getElementsByTagName("TD");
var priceEls = document.getElementsByClassName("s");
var j = 0 ; 

function decimalToHexString(number)
{
    if (number < 0)
    {
    	number = 0xFFFFFFFF + number + 1;
    }

    return number.toString(16).toUpperCase();
}


for (var i = 0; i<tds.length; i++) {
	
	var price = priceEls[i].innerText;
	
	var n = decimalToHexString(parseFloat(price)).toString();
	
	if (n.length != 4) {
    for (var g = 1; 4 - n.length; g++) {
    n = '0' + n ;
     }
     }
    document.getElementsByClassName("s")[i].innerHTML = n;
}