// ==UserScript==
// @name 999Tools
// @namespace https://drive.google.com/open?id=0BzwzmqEWk5a-U1NsMF9uRFdhSklyXzRneFo0RGY0YWRiWnIw
// @version 0.9.0
// @description Tools: Naugthy Bot script download link and start link, markets exchange infos, bet calculator, chat command, rain alert and option in account tab for 999dice chatroom. use chrome with tampermonkey
// @author NaughtySanta and re-edit some script by Landak
// @match https://www.999dice.com/
// @match https://www.999doge.com/
// @include https://www.999doge.com/
// @include https://www.999dice.com/
// @grant none
// ==/UserScript==
var repeat = 1,
d, Player, t, result, Search, el1 = document.getElementById("ChatTab"),
el2 = document.getElementById("ChatTabOtherRooms");
function collectRef() {
var el = document.getElementById('EarnTabReferralsTable').children[1];
var ar = [];
var i, id, name;
for (i = 0; i < el.children.length; i++) {
var el1 = el.children[i];
id = el1.children[0].innerHTML;
name = el1.children[1].innerHTML;
if (id !== "") {
ar.push([id, name]);
}
}
return ar;
}
function collectRefId() {
var el = document.getElementById('EarnTabReferralsTable').children[1];
var ar = [];
var i, id;
for (i = 0; i < el.children.length; i++) {
var el1 = el.children[i];
id = el1.children[0].innerHTML;
if (id !== "") {
ar.push(id);
}
}
return ar;
}
function collectRefFull() {
var el = document.getElementById('EarnTabReferralsTable').children[1];
var ar = [];
var arT = [];
var arId = [];
var i, id;
for (i = 0; i < el.children.length; i++) {
var el1 = el.children[i];
id = el1.children[0].innerHTML;
if (id !== "") {
arId.push(id);
arT = [id, el1.children[1].innerHTML];
ar.push([arT[0], arT[1], el1.children[2].innerHTML, el1.children[3].innerHTML]);
} else {
ar.push([arT[0], arT[1], el1.children[2].innerHTML, el1.children[3].innerHTML]);
}
}
return ar;
}
function soundz() {
rainalert.play();
}
function testSound() {
rainalert.volume = Number((document.getElementById("SoundVolume").value / 100).toFixed(2));
soundz();
}
function ActiveChat() {
ClickId("MinBetButton");
document.getElementById("AutoBetSizeInput").value = "0.00000001";
document.getElementById("ChatTabChatContainer").style.width = "98%";
var e = window.document.createEvent("MouseEvents");
e.initMouseEvent("click", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null);
5E3 < document.getElementsByClassName("BetsTable")[0].children[1].innerHTML.length && (document.getElementById("ContentTabsContainer").children[2].dispatchEvent(e), clearInterval(ChatVar));
}
function ChronoTimer() {
var e = new Date - d,
e = Math.floor(e / 1E3),
c = e % 60,
e = Math.floor((e - c) / 60),
f = e % 60,
e = Math.floor((e - f) / 60),
e = e % 24;
if (e < 10){
e = "0" + e;
}
if (f < 10){
f = "0" + f;
}
if (c < 10){
c = "0" + c;
}
d ? document.getElementById("RainTimer").innerText = "" + e + ":" + f + ":" + c + "" : document.getElementById("RainTimer").innerText = "No Data Yet!";
}
function ClickSend() {
var e = window.document.createEvent("MouseEvents");
e.initMouseEvent("click", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null);
document.getElementById("ChatTabSendButton").dispatchEvent(e);
}
function ClickId(e) {
var c = window.document.createEvent("MouseEvents");
c.initMouseEvent("click", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null);
document.getElementById(e).dispatchEvent(c);
}
function RainWarning() {
!0 === NotifEnable && (document.getElementById("ChatTabText").value = NotifMessage, ClickSend());
}
function RainUpdate() {
document.getElementById("ChatTabText").value = "Last Rain Data: " + d.getTime();
ClickSend();
}
function RainUp() {
var e = document.getElementById("DateM").value;
"" !== e && (d = new Date(Number(e)));
}
function BigRain() {
if (8 < document.getElementById("ChatTab").children[2].children.length || -1 !== document.getElementById("ChatTab").children[2].innerHTML.search(/btc|ltc|dog/i)) {
luckyrain.play(), console.log("The BIG LUCKY RAIN is here!!! Ho ho ho");
}
}
function ShowBalance() {
document.getElementById("ChatTabText").value = "/balance";
ClickSend();
}
function ShowAddy() {
document.getElementById("ChatTabText").value = "/deposit";
ClickSend();
}
function ShowClear() {
document.getElementById("ChatTabText").value = "/clear";
ClickSend();
}
function ShowHelp() {
document.getElementById("ChatTabText").value = "/help";
ClickSend();
}
function ShowRules() {
document.getElementById("ChatTabText").value = "/Rules";
ClickSend();
}
function ShowRainTimer() {
document.getElementById("ChatTabText").value = document.getElementById("RainTimer").innerText;
ClickSend();
}
function ShowStats() {
var e;
e = 1 == document.getElementById("DisplayCurrencies").children[0].classList.length ? "Btc" : 1 == document.getElementById("DisplayCurrencies").children[1].classList.length ? "Doge" : "Ltc";
document.getElementById("ChatTabText").value = e + " Stats: Bets " + document.getElementById("StatsUserBetCount").innerHTML + " | Wagered " + document.getElementById("StatsUserBetPayIn").innerHTML + " | Profit " + document.getElementById("StatsUserBetProfit").innerHTML;
ClickSend();
}
function showE() {
showTools('Empty');
var e = document.getElementById("ChatTabChatContainer"),
c = document.getElementById("EPanel");
document.getElementById("TPanel").style.display = "none";
document.getElementById("GPanel").style.display = "none";
document.getElementById("BtnPanel").style.display = "none";
"98%" === e.style.width && (e.style.width = "68%", c.style.display = "inline-block");
}
function showT() {
showTools('Empty');
var e = document.getElementById("ChatTabChatContainer");
document.getElementById("EPanel").style.display = "none";
document.getElementById("BtnPanel").style.display = "none";
var c = document.getElementById("TPanel");
document.getElementById("GPanel").style.display = "none";
"98%" === e.style.width && (e.style.width = "68%", c.style.display = "inline-block");
}
function showG() {
showTools('Empty');
var e = document.getElementById("ChatTabChatContainer");
document.getElementById("EPanel").style.display = "none";
document.getElementById("TPanel").style.display = "none";
document.getElementById("BtnPanel").style.display = "none";
var c = document.getElementById("GPanel");
"98%" === e.style.width && (e.style.width = "58%", c.style.display = "inline-block");
}
function showBtn() {
showTools('Empty');
var e = document.getElementById("ChatTabChatContainer");
document.getElementById("EPanel").style.display = "none";
document.getElementById("TPanel").style.display = "none";
document.getElementById("GPanel").style.display = "none";
var c = document.getElementById("BtnPanel");
"98%" === e.style.width && (e.style.width = "68%", c.style.display = "inline-block");
}
function showTools(e) {
"Market" === e && showE();
"AutoClicker" === e && showT();
"Generator" === e && showG();
"Button" === e && showBtn();
"Empty" === e && (document.getElementById("ChatTabChatContainer").style.width = "98%", document.getElementById("EPanel").style.display = "none", document.getElementById("TPanel").style.display = "none", document.getElementById("GPanel").style.display = "none", document.getElementById("BtnPanel").style.display = "none");
scrollDown();
}
function SendCommand(e) {
"Stats" === e && ShowStats();
}
function scrollDown() {
var e = document.getElementById("ChatTabChatContainer");
e.scrollTop = e.scrollHeight;
}
function SaveData() {
localStorage.setItem("DataDice", d);
}
function LoadData() {
var e = localStorage.getItem("DataDice");
d = new Date(e);
}
function setOption() {
rainalert.src = elO1.value;
rainalert.volume = Number(elO2.value) / 100;
NotifEnable = elO3.checked;
NotifMessage = elO4.value;
}
function SaveO() {
localStorage.setItem("SoundU", elO1.value);
localStorage.setItem("SoundV", elO2.value);
localStorage.setItem("NotifR", elO3.checked);
localStorage.setItem("NotifM", elO4.value);
localStorage.setItem("FavMarket", elO5.value);
loadO();
}
function loadO() {
elO1.value = localStorage.getItem("SoundU");
elO2.value = localStorage.getItem("SoundV");
"true" === localStorage.getItem("NotifR") ? elO3.checked = !0 : elO3.checked = !1;
elO4.value = localStorage.getItem("NotifM");
elO5.value = localStorage.getItem("FavMarket");
setOption();
upFavMarket();
}
function onLoad() {
localStorage.SoundV ? loadO() : SaveO();
}
function NewReq(e, c, f, g, l, h, m) {
var n = new XMLHttpRequest,
p;
document.getElementById("BalanceActionBoxTab");
n.open("GET", g, !0);
n.send();
n.onreadystatechange = function () {
4 === n.readyState && 200 === n.status && (p = JSON.parse(n.responseText), document.getElementById(e).innerHTML = p.ticker.markets[f].market + "|" + Number(p.ticker.markets[f].price * l).toFixed(m) + " " + h);
};
}
function NewStartReq(e) {
var c = document.getElementById("BtcExchange").value,
f = document.getElementById("BtcMarket").value,
g, l = 1,
h = "Idr";
"btc_idr" !== f ? (g = "https://www.cryptonator.com/api/full/" + f, "btc-xpf" === f && (l = 119.332, h = " F Cfp"), h = "usd" === f.split("-")[1] ? " $" : " \u20ac") : g = "https://vip.bitcoin.co.id/api/" + f + "/ticker";
NewStopReq();
ExMark = window.setInterval(function () {
NewReq("BtcPrice", f, c, g, l, h);
NewReq("LtcPrice", "ltc-btc", c, g, l, "");
NewReq("DogePrice", "doge-btc", c, g, l, "");
}, 1E3 * e);
}
function cryptoRequest(e) {
var c = new XMLHttpRequest,
f, g = document.getElementById("CryptoMarket"),
l = document.getElementById("CalcA").value;
l.match(/bal/i) && (l = Number(document.getElementById("BalanceActionBoxTab").children[1].children[0].innerText));
var h = 0;
if ("btc-xpf" === e) {
c.open("GET", "https://www.cryptonator.com/api/full/btc-eur", !0), c.send(), c.onreadystatechange = function () {
if (4 === c.readyState && 200 === c.status) {
f = JSON.parse(c.responseText);
g.innerHTML = "0 |Cryptonator |" + Number((119.332 * f.ticker.price).toFixed(0)).toLocaleString() + " |" + Number((f.ticker.price * l * 119.332).toFixed(0)).toLocaleString() + " F CFP
";
for (i = 0; i < f.ticker.markets.length; i++) {
g.innerHTML += i + 1 + " |" + f.ticker.markets[i].market + " |" + Number((119.332 * f.ticker.markets[i].price).toFixed(0)).toLocaleString() + " |" + Number((f.ticker.markets[i].price * l * 119.332).toFixed(0)).toLocaleString() + " F CFP
", h += Number(f.ticker.markets[i].price);
}
h = (Number(h) / Number(f.ticker.markets.length) * 119.332).toFixed(0);
g.innerHTML = 'Average: ' + Number(h).toLocaleString() + " |" + Number((h * l).toFixed(0)).toLocaleString() + " F CFP
" + g.innerHTML;
}
};
} else {
if ("btc-idr" === e) {
c.open("GET", "https://vip.bitcoin.co.id/api/btc_idr/ticker", !0), c.send(), c.onreadystatechange = function () {
4 === c.readyState && 200 === c.status && (f = JSON.parse(c.responseText), g.innerHTML = "Bitcoin.co.id |" + Number(f.ticker.buy).toLocaleString("id-ID", {
style: "currency",
currency: "IDR"
}) + " |" + Number(f.ticker.buy * l).toLocaleString("id-ID", {
style: "currency",
currency: "IDR"
}) + "
");
};
} else {
if (e.match(/eur/i) || e.match(/usd/i)) {
var m = e.match(/eur/i) ? ["fr-FR", "EUR"] : ["us-US", "USD"];
e.match(/doge/i) && (l = "1000", document.getElementById("CalcA").value = "1000");
c.open("GET", "https://www.cryptonator.com/api/full/" + e, !0);
c.send();
c.onreadystatechange = function () {
if (4 === c.readyState && 200 === c.status) {
f = JSON.parse(c.responseText);
g.innerHTML = "0 |Cryptonator |" + Number(f.ticker.price).toLocaleString(m[0], {
style: "currency",
currency: m[1]
}) + " |" + Number(f.ticker.price * l).toLocaleString(m[0], {
style: "currency",
currency: m[1]
}) + "
";
for (i = 0; i < f.ticker.markets.length; i++) {
g.innerHTML += i + 1 + " |" + f.ticker.markets[i].market + " |" + Number(f.ticker.markets[i].price).toLocaleString(m[0], {
style: "currency",
currency: m[1]
}) + " |" + Number(f.ticker.markets[i].price * l).toLocaleString(m[0], {
style: "currency",
currency: m[1]
}) + "
", h += Number(f.ticker.markets[i].price);
}
h = (Number(h) / Number(f.ticker.markets.length)).toFixed(8);
g.innerHTML = 'Average: ' + Number(h).toLocaleString(m[0], {
style: "currency",
currency: m[1]
}) + " |" + Number(h * l).toLocaleString(m[0], {
style: "currency",
currency: m[1]
}) + "
" + g.innerHTML;
}
};
} else {
c.open("GET", "https://www.cryptonator.com/api/full/" + e, !0), c.send(), c.onreadystatechange = function () {
if (4 === c.readyState && 200 === c.status) {
f = JSON.parse(c.responseText);
g.innerHTML = "0 |Cryptonator |" + Number(f.ticker.price).toFixed(8).toLocaleString() + " |" + (f.ticker.price * l).toFixed(8).toLocaleString() + "
";
for (i = 0; i < f.ticker.markets.length; i++) {
g.innerHTML += i + 1 + " |" + f.ticker.markets[i].market + " |" + Number(f.ticker.markets[i].price).toFixed(8).toLocaleString() + " |" + (f.ticker.markets[i].price * l).toFixed(8).toLocaleString() + "
", h += Number(f.ticker.markets[i].price);
}
h = (Number(h) / Number(f.ticker.markets.length)).toFixed(8);
g.innerHTML = 'Average: ' + Number(h).toLocaleString() + " |" + (h * l).toFixed(8).toLocaleString() + "
" + g.innerHTML;
}
};
}
}
}
}
function favMarket(e, id, txtS, txtE) {
var c = new XMLHttpRequest;
var el = document.getElementById(id);
var txt;
var x = 1,
d = 8;
if (e !== 'IDR') {
c.open("GET", "https://www.cryptonator.com/api/ticker/" + e, !0), c.send(), c.onreadystatechange = function () {
if (4 === c.readyState && 200 === c.status) {
f = JSON.parse(c.responseText);
if (elO5.value == 'XPF,Fcp' && e == 'btc-eur') {
x = 119.332;
d = 0;
txtE = ' Fcp'
} else if (e.search(/usd|eur/i) > -1) {
d = 2;
} else {
x = 1;
d = 8;
}
el.innerHTML = txtS + (Number(f.ticker.price) * x).toFixed(d) + txtE;
}
};
} else {
c.open("GET", "https://vip.bitcoin.co.id/api/btc_idr/ticker", true);
c.send();
c.onreadystatechange = function () {
if (c.readyState === 4 && c.status === 200) {
f = JSON.parse(c.responseText);
el.innerHTML = "฿TC » " + Number(f.ticker.buy).toLocaleString('id-ID', {
style: 'currency',
currency: 'IDR'
});
}
};
}
}
function stopRequest() {
clearInterval(priceUp);
}
function startRequest(e) {
e.match(/empty/i) ? (document.getElementById("CryptoMarket").innerHTML = "", stopRequest()) : (stopRequest(), priceUp = window.setInterval(function () {
cryptoRequest(e);
}, 3E4), cryptoRequest(e));
}
function calcAmount(e) {
e = document.getElementById("MarketPrice").value;
"Empty" !== e && cryptoRequest(e);
}
function InjectorType(e, c) {
"BetSize" === c ? (document.getElementById("BetSizeVar").value = e, document.getElementById("XVar").value = 1) : "Multi" === c ? document.getElementById("BetXVar").value = e : "MaxBet" === c && console.log("Error MaxBet Stop Injection\nOnly Available For Automatic");
}
function Generate() {
BetCalc((1E8 * document.getElementById("BetSizeInput").value).toFixed(8), document.getElementById("GenIncrease").value, document.getElementById("GenStreak").value, document.getElementById("GenStop").value, document.getElementById("InjectorChoice").value);
}
function BetCalc(e, c, f, g, l) {
var h = Number(e),
m = 0,
n = 0,
p = "",
r = 0,
q = document.getElementById("BetChanceInput").value,
q = 99.9 / q - 1;
document.getElementById("GenResults").innerHTML = "";
if (document.getElementById("BetSizeInput").value.match(/fib/i)) {
for (a = 0, b = 1, k = 0; k < f; a = b, b = x, k++) {
x = a + b, n += x, p += x + ",", GenResults(k + 1, x, n, 0);
}
} else {
for (e = 1; e <= f; e++) {
if (m++, r = (Math.floor(q * h - n) / xC).toFixed(8), n += h, p += Math.round(h) + ",", GenResults(m, (Math.round(h) / xC).toFixed(8), (n / xC).toFixed(8), r), h = Math.floor(h * (c / 100 + 1)), 0 < g && h > g) {
return InjectorType(p.slice(0, p.length - 1), l), "Last Streak Reached";
}
}
}
InjectorType(p.slice(0, p.length - 1), l);
}
function GenResults(e, c, f, g) {
var l = document.getElementById("GenResults");
e = '
Script Settings
Sound Settings
url:
'; e += ''; e += "Volume:
'; e += ''; e += ''; e += "Rain Notification
'; e += 'Enable:
'; e += ''; e += ''; e += "Rain Date Update
'; e += 'Value:
'; e += ''; e += "Favorite Market Choice
'; e += 'Value:
'; e += '"; var c = document.getElementById("oPanel"); c.innerHTML = e; CreateChatButton("button", "SaveSet", "TextButton", "SaveSet", c); CreateChatButton("button", "RainUpdate", "TextButton", "RainUpdate", c); c = document.getElementById("SaveSet"); c.setAttribute("onclick", "SaveO();"); c.setAttribute("style", "position: absolute; right: 20px; bottom: 20px;"); c = document.getElementById("RainUpdate"); c.setAttribute("onclick", "RainUp();"); c.setAttribute("style", "position: absolute; left: 20px; bottom: 20px;"); } function setE() { CreateObject("div", "EPanel", "", el1.children[0]); var e = document.getElementById("EPanel"); e.setAttribute("style", "position: relative; width: 560px; height: 300px; background-color: black; border-style: solid; border-width: 1px; display: none; overflow: hidden;"); var c; c = 'Market Exchange Infos
'; c += '"; c += 'Amount:'; c += ''; c += "New Bot link
Bet Generator
Increase %:'; c += 'Streak:'; c += ''; c += "Button Creator
'; c += 'Button Class'; c += '"; c += '