Advertisement
coinwalk

rain alert 999dice for tampermonkey

Aug 10th, 2019
1,729
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.27 KB | None | 0 0
  1. // ==UserScript==
  2. // @name koplak robot klik & RainAlert
  3. // @namespace https://www.999dice.com/
  4. // @version 0.4a
  5. // @description Tools: Autoclicker, markets exchange infos, command, rain alert and option in account tab for 999dice chatroom
  6. // @author NaughtySanta mod by MoeMoney
  7. // @match https://www.999dice.com/
  8. // @include https://www.999dice.com/
  9. // @grant none
  10. // ==/UserScript==
  11. var rainalert = {};
  12. var repeat = 1;
  13. var d;
  14. var Player;
  15. rainalert = new Audio();
  16. rainalert.src = 'http://www.buddhanet.net/filelib/audio/tinsha.wav';
  17. rainalert.volume = 0.3;
  18. var t;
  19. var result;
  20. var Search;
  21. var el1 = document.getElementById('ChatTab');
  22. var el2 = document.getElementById('ChatTabOtherRooms');
  23. function soundz() {
  24. rainalert.play();
  25. }
  26. function testSound() {
  27. rainalert.volume = Number(((document.getElementById('SoundVolume').value) / 100).toFixed(2));
  28. soundz();
  29. }
  30. function ActiveChat() {
  31. ClickId('MinBetButton');
  32. document.getElementById('AutoBetSizeInput').value = "0.00000001";
  33. var evt = window.document.createEvent("MouseEvents");
  34. evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  35. if (document.getElementsByClassName("BetsTable")[0].children[1].innerHTML.length > 5000) {
  36. document.getElementById("ContentTabsContainer").children[2].dispatchEvent(evt);
  37. clearInterval(ChatVar);
  38. }
  39. }
  40. function ChronoTimer() {
  41. var t = new Date();
  42. var chrono = t - d;
  43. chrono = Math.floor(chrono / 1000);
  44. var second = chrono % 60;
  45. chrono = Math.floor((chrono - second) / 60);
  46. var minute = chrono % 60;
  47. chrono = Math.floor((chrono - minute) / 60);
  48. var hour = chrono % 24;
  49. if (!d) {
  50. document.getElementById("RainTimer").innerText = "No Data Yet!";
  51. } else {
  52. document.getElementById("RainTimer").innerText = "Last Rain : " + hour + " hours " + minute + " minutes " + second + " seconds";
  53. }
  54. }
  55. function ClickSend() {
  56. var evt = window.document.createEvent("MouseEvents");
  57. evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  58. document.getElementById("ChatTabSendButton").dispatchEvent(evt);
  59. }
  60. function ClickId(id) {
  61. var evt = window.document.createEvent("MouseEvents");
  62. evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  63. document.getElementById(id).dispatchEvent(evt);
  64. }
  65. function RainWarning() {
  66. if (NotifEnable === true) {
  67. document.getElementById("ChatTabText").value = NotifMessage;
  68. ClickSend();
  69. }
  70. }
  71. function ShowBalance() {
  72. document.getElementById("ChatTabText").value = "/balance";
  73. ClickSend();
  74. }
  75. function ShowAddy() {
  76. document.getElementById("ChatTabText").value = "/deposit";
  77. ClickSend();
  78. }
  79. function ShowClear() {
  80. document.getElementById("ChatTabText").value = "/clear";
  81. ClickSend();
  82. }
  83. function ShowHelp() {
  84. document.getElementById("ChatTabText").value = "/help";
  85. ClickSend();
  86. }
  87. function ShowRules() {
  88. document.getElementById("ChatTabText").value = "===>Sabar Ya Bro<===";
  89. ClickSend();
  90. }
  91. function ShowRainTimer() {
  92. document.getElementById("ChatTabText").value = document.getElementById("RainTimer").innerText;
  93. ClickSend();
  94. }
  95. function ShowStats() {
  96. var crypto;
  97. if (document.getElementById("DisplayCurrencies").children[0].classList.length == 1) {
  98. crypto = "Btc";
  99. } else if (document.getElementById("DisplayCurrencies").children[1].classList.length == 1) {
  100. crypto = "Doge";
  101. } else {
  102. crypto = "Ltc";
  103. }
  104. document.getElementById("ChatTabText").value = crypto + " Stats: Bets " + document.getElementById("StatsUserBetCount").innerHTML + " | Wagered " + document.getElementById("StatsUserBetPayIn").innerHTML + " | Profit " + document.getElementById("StatsUserBetProfit").innerHTML;
  105. ClickSend();
  106. }
  107. function SendCommand(type) {
  108. if (type === 'Clear') {
  109. ShowClear();
  110. }
  111. if (type === 'Help') {
  112. ShowHelp();
  113. }
  114. if (type === 'Rules') {
  115. ShowRules();
  116. }
  117. if (type === 'Stats') {
  118. ShowStats();
  119. }
  120. }
  121. function SaveData() {
  122. var params = d;
  123. localStorage.setItem("DataDice", params);
  124. }
  125. function LoadData() {
  126. var dataDice = localStorage.getItem("DataDice");
  127. d = new Date(dataDice);
  128. }
  129. function setOption() {
  130. rainalert.src = elO1.value;
  131. rainalert.volume = Number(elO2.value) / 100;
  132. NotifEnable = elO3.checked;
  133. NotifMessage = elO4.value;
  134. }
  135. function SaveO() {
  136. localStorage.setItem('SoundU', elO1.value);
  137. localStorage.setItem('SoundV', elO2.value);
  138. localStorage.setItem('NotifR', elO3.checked);
  139. localStorage.setItem('NotifM', elO4.value);
  140. loadO();
  141. }
  142. function loadO() {
  143. elO1.value = localStorage.getItem('SoundU');
  144. elO2.value = localStorage.getItem('SoundV');
  145. if (localStorage.getItem('NotifR') === "true") {
  146. elO3.checked = true;
  147. } else {
  148. elO3.checked = false;
  149. }
  150. elO4.value = localStorage.getItem('NotifM');
  151. setOption();
  152. }
  153. function onLoad() {
  154. if (!!localStorage.SoundV) {
  155. loadO();
  156. } else {
  157. SaveO();
  158. }
  159. }
  160. function clickMe() {
  161. var type = document.getElementById('AutoHighLow').value;
  162. var test = !!(document.getElementById('AutoBetsActionBoxSet').style.display === "block");
  163. if (!!type.match(/low/i)) {
  164. if (test === false) {
  165. ClickId('BetLowButton');
  166. } else {
  167. ClickId('AutoBetLowButton');
  168. }
  169. }
  170. if (!!type.match(/high/i)) {
  171. if (test === false) {
  172. ClickId('BetHighButton');
  173. } else {
  174. ClickId('AutoBetHighButton');
  175. }
  176. }
  177. if (!!type.match(/rswap/i)) {
  178. var rnd = Math.random();
  179. if (rnd < 0.5) {
  180. if (test === false) {
  181. ClickId('BetLowButton');
  182. } else {
  183. ClickId('AutoBetLowButton');
  184. }
  185. } else {
  186. if (test === false) {
  187. ClickId('BetHighButton');
  188. } else {
  189. ClickId('AutoBetHighButton');
  190. }
  191. }
  192. }
  193. //if (!!type.match(/swapme/i)) {}
  194. //<option value="SwapMe">Swap</option>
  195. }
  196. function autoClicker() {
  197. var temp = document.getElementById('ClickDelay');
  198. click = window.setInterval(clickMe, temp * 1000);
  199. }
  200. function autoClickStop() {
  201. clearInterval(click);
  202. }
  203. function cryptoRequest(type) {
  204. var xmlhttp = new XMLHttpRequest();
  205. xmlhttp.open("GET", "https://www.cryptonator.com/api/full/" + type, true);
  206. xmlhttp.send();
  207. xmlhttp.onreadystatechange = function () {
  208. if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
  209. var temp = JSON.parse(xmlhttp.responseText);
  210. var el = document.getElementById('CryptoMarket')
  211. el.innerHTML = '<span style="color: green; margin-left: 2px;">Average: ' + temp.ticker.price + '</span><br>';
  212. for (i = 0; i < temp.ticker.markets.length; i++) {
  213. el.innerHTML += (i + 1) + '|' + temp.ticker.markets[i].market + ' | ' + temp.ticker.markets[i].price + '<br>';
  214. }
  215. }
  216. }
  217. }
  218. function stopRequest() {
  219. clearInterval(priceUp);
  220. }
  221. function startRequest(type) {
  222. if (!type.match(/empty/i)) {
  223. stopRequest();
  224. priceUp = window.setInterval(function () {
  225. cryptoRequest(type);
  226. }, 30000);
  227. cryptoRequest(type);
  228. } else {
  229. stopRequest();
  230. }
  231. }
  232. function CreateChatButton(type, id, classe, value, context) {
  233. var button = document.createElement("input");
  234. button.type = type;
  235. button.id = id;
  236. button.className = classe;
  237. button.value = value;
  238. context.appendChild(button);
  239. }
  240. function CreateNewInput(id, value, context) {
  241. var input = document.createElement("input");
  242. input.type = "text";
  243. input.id = id;
  244. input.maxlength = "20";
  245. input.className = "StandardTextBox";
  246. input.value = value;
  247. context.appendChild(input);
  248. }
  249. function CreateObject(type, id, value, context) {
  250. var div = document.createElement(type);
  251. div.id = id;
  252. div.innerText = value;
  253. context.appendChild(div);
  254. }
  255. function CreateObject2(type, id, value, context, child) {
  256. var div = document.createElement(type);
  257. div.id = id;
  258. div.innerText = value;
  259. context.insertBefore(div, child);
  260. }
  261. function setB() {
  262. var ObjectInChat = CreateObject('div', 'DivInChat', '', el1.children[0]);
  263. var ObjectR = CreateObject('span', "RainTimer", "No Rain Data!", document.getElementById("DivInChat"));
  264. var ObjectSelect = CreateObject('select', 'ActionSelect', '', el1.children[1]);
  265. var ButtonC = CreateChatButton("button", "BalanceButton", "TextButton", "Balance", el2);
  266. var ButtonA = CreateChatButton("button", "AddyButton", "TextButton", "Addy", el2);
  267. document.getElementById("DivInChat").setAttribute("style", "position: absolute; right: 30px; top: 1px; background-color: rgba(255,255,255,0.6); border-style: solid; border-width: 1px; display: block;");
  268. document.getElementById("RainTimer").setAttribute("style", "float: right; margin-right: 0px; text-align: center; font-size: 120%; color: black;");
  269. document.getElementById("RainTimer").setAttribute("onclick", "ShowRainTimer();");
  270. document.getElementById("ActionSelect").innerHTML = '<option value="Empty">-=||O_O||=-</option><option value="Clear">/clear</option><option value="Help">/help</option><option value="Rules">/rules</option><option value="Stats">Show Stats</option>';
  271. document.getElementById("ActionSelect").setAttribute("onchange", "SendCommand(this.value)");
  272. document.getElementById("ActionSelect").setAttribute("style", "margin-left: 5px; color: white; background-color: black;");
  273. document.getElementById("BalanceButton").setAttribute("onclick", "ShowBalance();");
  274. document.getElementById("BalanceButton").setAttribute("style", "float: right; margin-right: 5px;");
  275. document.getElementById("AddyButton").setAttribute("onclick", "ShowAddy()");
  276. document.getElementById("AddyButton").setAttribute("style", "float: right; margin-right: 10px;");
  277. }
  278. function setO() {
  279. var oPanel = CreateObject('div', 'oPanel', '', document.getElementById('AccountTab'));
  280. document.getElementById('ChatTabChatContainer').setAttribute("style", "display: inline-block");
  281. document.getElementById("oPanel").setAttribute("style", "position: relative; width: 400px; height: 330px; top: -1140px; right: -487px; background-color: rgba(0,0,0,0.1); border-style: solid; border-width: 1px; display: inline-block;");
  282. var temp = '<p style="width: 97.7%; top: -20px; text-align: center; font-size: 150%; margin: 5px; color: black; background-color: rgb(255,255,255); border-bottom-style: solid; display: block;">Script Settings</p><p style="width: 96%; margin-top: 2%; margin-left: 2%; text-align: center; font-size: 120%; color: black; background-color: rgba(255,255,255,.3); border-bottom-style: solid; display: block;">Sound Settings</p><p style="width: 60px; left: 5px; margin-top: 10px; color: white; text-align: right; display: inline-block;">url:</p><input id="SoundUrl" type="url" value="http://www.buddhanet.net/filelib/audio/tinsha.wav" style="width: 310px; margin-left: 10px; display: inline-block;"><br><p style="width: 60px; left: 5px; margin-top: 10px; color: white; text-align: right; display: inline-block;">Volume: </p><input id="SoundVolume" type="number" value="30" min="0" max="100" step="5" style="width: 50px; margin-left: 10px; display: inline-block;"><button type="TextButton" onclick="testSound()" style="margin-left: 170px;">Sound Test</button><br><p style="width: 96%; margin-top: 2%; margin-left: 2%; text-align: center; font-size: 120%; color: black; background-color: rgba(255,255,255,.3); border-bottom-style: solid; display: block;">Rain Notification</p><p style="width: 60px; left: 5px; margin-top: 10px; color: white; text-align: right; display: inline-block;">Enable:</p><input id="RainNotif" type="checkbox" style="margin-left: 10px; display: inline-block;"><input id="NotifVal" type="text" value="====> Thanks for the Rain, Jake <====" style="width: 285px; margin-left: 10px; display: inline-block;"><br>';
  283. var el = document.getElementById("oPanel");
  284. el.innerHTML = temp;
  285. CreateChatButton("button", "SaveSet", "TextButton", "SaveSet", el);
  286. el = document.getElementById('SaveSet');
  287. el.setAttribute("onclick", "SaveO();");
  288. el.setAttribute("style", "position: absolute; right: 20px; bottom: 20px;");
  289. }
  290. function setL() {
  291. var LeftPanel = CreateObject('div', 'LeftPanel', '', el1.children[0]);
  292. document.getElementById("LeftPanel").setAttribute("style", "position: absolute; width: 17.5vw; height: 500px; top: -100px; left: -18vw; background-color: rgba(0,0,0,0.2); border-style: solid; border-width: 1px; display: inline-block; overflow: hidden;");
  293. var temp = '<p style="width: 96%; margin-top: 2%; margin-left: 2%; text-align: center; font-size: 120%; color: black; background-color: rgba(255,255,255,.3); border-bottom-style: solid; display: block;">Auto Clicker V1</p><select id="AutoHighLow" style="margin-left: 2vw; color: white; background-color: black;"><option value="Empty">Choose</option><option value="Low">Low</option><option value="High">High</option><option value="RSwap">Random</option></select><input id="ClickDelay" type="text" value="2.5" style="width: 60px; margin-left: 2vw"><span style="margin-left: 2px;">second(s)</span><br><br><button class="TextButton" onclick="autoClickStop()" style="margin-left: 2vw">Stop Me</button><button class="TextButton" onclick="autoClicker()" style="margin-left: 2vw">Start Me</button><br><br><p style="width: 96%; margin-top: 2%; margin-left: 2%; margin-bottom: 0px; text-align: center; font-size: 120%; color: black; background-color: rgba(255,255,255,.3); border-bottom-style: solid; display: block;">Exchange Infos V0</p><select id="MarketPrice" onchange="startRequest(this.value)" style="margin-bottom: 5px; width: 40%; margin-left: 30%; color: white; background-color: black;"><option value="Empty">-|0_O|-</option><option value="ltc-btc">LTC/BTC</option><option value="doge-btc">DOGE/BTC</option><option value="doge-ltc">DOGE/LTC</option><option value="btc-usd">BTC/USD</option><option value="btc-eur">BTC/EURO</option><option value="ltc-usd">LTC/USD</option><option value="ltc-eur">LTC/EURO</option><option value="doge-usd">DOGE/USD</option><option value="doge-eur">DOGE/EURO</option></select><br><div id="CryptoMarket" style="max-height: 270px; top: 5px; width: 96%; margin-left: 2%; font-size: 110%; border-style: solid; border-width: 1px; overflow: auto;"></div>';
  294. var el = document.getElementById("LeftPanel");
  295. el.innerHTML = temp;
  296. }
  297. setB();
  298. setO();
  299. setL();
  300. var ChatVar = window.setInterval(ActiveChat, 1000);
  301. var script = document.createElement('script');
  302. script.type = "text/javascript";
  303. script.appendChild(document.createTextNode('var rainalert = {};\nvar count = 0;\nvar repeat = 1;\nvar d;\nvar Player;\nvar rainalert = new Audio();\nrainalert.src = "http://www.buddhanet.net/filelib/audio/tinsha.wav";\nrainalert.volume = 0.3;\nvar t;\nvar result;\nvar Search;\nvar speech = new Audio();\nvar NotifMessage;\nvar elO1 = document.getElementById("SoundUrl");\nvar elO2 = document.getElementById("SoundVolume");\nvar elO3 = document.getElementById("RainNotif");\nvar elO4 = document.getElementById("NotifVal");\nvar click = "";\nvar priceUp;\n\n' + soundz + '\n' + testSound + '\n' + ActiveChat + '\n' + ChronoTimer + '\n' + ClickSend + '\n' + ClickId + '\n' + RainWarning + '\n' + ShowClear + '\n' + ShowAddy + '\n' + ShowBalance + '\n' + ShowHelp + '\n' + ShowRules + '\n' + ShowRainTimer + '\n' + ShowStats + '\n' + SendCommand + '\n' + clickMe + '\n' + autoClicker + '\n' + autoClickStop + '\n' + cryptoRequest + '\n' + stopRequest + '\n' + startRequest + '\n' + SaveO + '\n' + loadO + '\n' + setOption + '\n' + setL + '\n' + onLoad + '\n' + SaveData + '\n' + LoadData + '\nLoadData();\nwindow.setTimeout(onLoad, 5000);\nwindow.setInterval(function(){\nChronoTimer();\nif (document.getElementsByClassName("Rain").length !== 0 ) {\nif (count === 0 ){\nd = new Date();\nSaveData();\nRainWarning();\n}\nif (count < repeat){\nsoundz();\ncount++;\n}\n}else{\ncount = 0;\n}\n}, 1000);'));
  304. (document.body || document.head || document.documentElement).appendChild(script);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement