您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Another Autodarts-Caller
当前为
// ==UserScript== // @name Autodarts_Caller // @namespace http://tampermonkey.net/ // @version 1.1 // @description Another Autodarts-Caller // @author benebelter // @match https://play.autodarts.io/matches/* // @match https://play.autodarts.io/* // @icon https://www.google.com/s2/favicons?sz=64&domain=autodarts.io // @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; //////////////// CONFIG //////////////////// var triplesound = 2; // 0=off / 1=simple beep on / 2=Löwen-sound (Soft-tip) on => triple_sound if hitting a triple var buhsound = 1; // 0=off / 1=on => crowd-boo if hitting a miss var server = 'http://autodarts.x10.mx/'; // Server-adress var caller = 'russ_bray'; // caller-folder russ_bray, google //////////////// CONFIG //////////////////// if( caller == 'google') { server = 'translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=en&q='; caller = ''; } function soundGo(file, audio){ if (audio === 1){ const audio = new Audio(file); audio.play(); } } function getDarts(){ var runde = $('.css-1tw9fat').text().substring(1).split("/"); var numItems = $('.css-1chp9v4').length ; var dartsgesamt = (runde[0]*3-3)+numItems; return "<span style='font-size:0.5em;'>"+dartsgesamt+" Darts</span>" ; } $(document).ready(function(){ var t1 = 0; var t2 = 0; var t3 = 0; var m1 = 0; var m2 = 0; var m3 = 0; var called = 0 ; var gameshot_status = 0; var busted = 0; var audio = 1; var firstgameoncall = 0; setInterval(function() { // Caller icon laden if(!$("#russbray").length) { //$( ".css-1m5ohpg" ).prepend( "<span id=\"russbray\" class=\"css-1xn1mdy\"><button type=\"submit\" id=\"mute\"><img style=\"height: 20px; width: 20px;\" src=\"https://asc-images.forward-publishing.io/2021/5/13/76d0a824-c5ca-409b-91ae-c69df96daccb.jpeg?auto=compress%2Cformat\"></button</span>" ); $( ".css-1m5ohpg" ).prepend( "<span id=\"russbray\" class=\"css-1xn1mdy\"><button type=\"submit\" id=\"mute\">Caller</button</span>" ); $(".css-1xn1mdy").first().css("background-color","green"); } var x = $(".css-1tq00ko").text(); var x0 = $(".css-1tq00ko:eq(0)").text(); // Scrore-Feld var x1 = $(".css-1tq00ko:eq(1)").text(); // 1. Dart var x2 = $(".css-1tq00ko:eq(2)").text(); // 2. Dart var x3 = $(".css-1tq00ko:eq(3)").text(); // 3. Dart var gameshot1 = $(".css-x3m75h").eq(0).text(); // Spieler 1 var gameshot2 = $(".css-x3m75h").eq(1).text(); // Spieler 2 var gameshot3 = $(".css-x3m75h").eq(2).text(); // Spieler 3 var gameshot4 = $(".css-x3m75h").eq(3).text(); // Spieler 4 var gameshot5 = $(".css-x3m75h").eq(4).text(); // Spieler 5 var gameshot6 = $(".css-x3m75h").eq(5).text(); // Spieler 6 console.log('P1: '+gameshot1 + '- P2: '+ gameshot2); //// Bust-Ausgabe //// if (x0 == 'BUST' && busted == 0) { soundGo(server+caller+"/0.mp3", audio); busted = 1; } //// Gameshot-Ausgabe //// // Gameshot aktivieren $("button:contains('Undo'),button:contains('Next Leg'),button:contains('Finish'),button:contains('Start')").on( "click", function() { gameshot_status = 0; console.log('GAMESHOT Status 0 '); }) if ( gameshot_status != 1 && (gameshot1 == "0" || gameshot2 == "0" || gameshot3 == "0"|| gameshot4 == "0"|| gameshot5 == "0"|| gameshot6 == "0") ){ gameshot_status = 1; //soundGo("http://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=en&q="+gameshot+"&dummysox.mp3", audio); soundGo(server+caller+"/gameshot2.mp3", audio); if (gameshot1 == "0") { $(".css-x3m75h").eq(0).html(getDarts()); } if (gameshot2 == "0") { $(".css-x3m75h").eq(1).html(getDarts()); } if (gameshot3 == "0") { $(".css-x3m75h").eq(2).html(getDarts()); } if (gameshot4 == "0") { $(".css-x3m75h").eq(3).html(getDarts()); } if (gameshot5 == "0") { $(".css-x3m75h").eq(4).html(getDarts()); } if (gameshot6 == "0") { $(".css-x3m75h").eq(5).html(getDarts()); } console.log('GAMESHOT Status '+gameshot_status ); } //// END Gameshot //// ///////////////////////////////////////////////// TRIPLE CALLER /////////////////////////// if(triplesound == 1) { // Triple 1st dart if ( x1.includes("T") && t1 === 0 && $(".css-1tq00ko:eq(1)").closest('div').attr('class') == 'css-rzdgh7' && called == 0){ t1 = 1; soundGo(server+caller+"/triple_beep.mp3", audio); } // Triple 2st dart if ( x2.includes("T") && t2 === 0 && $(".css-1tq00ko:eq(2)").closest('div').attr('class') == 'css-rzdgh7' && called == 0){ t2 = 1; soundGo(server+caller+"/triple_beep.mp3", audio); } // Triple 3rd dart if ( x3.includes("T") && t3 === 0 && $(".css-1tq00ko:eq(3)").closest('div').attr('class') == 'css-rzdgh7' && called == 0){ t3 = 1; soundGo(server+caller+"/triple_beep.mp3", audio); } } ///////////////////////////////////////////////// END TRIPLE CALLER /////////////////////////// ///////////////////////////////////////////////// TRIPLE CALLER E-Dart Löwen/////////////////////////// if(triplesound == 2) { // Triple 20 1st dart if ( x1.includes("T20") && t1 === 0 && $(".css-1tq00ko:eq(1)").closest('div').attr('class') == 'css-rzdgh7' && called == 0){ t1 = 1; soundGo(server+caller+"/SoundHwTriple20_old.wav", audio); } // Triple 19 1st dart if ( x1.includes("T19") && t1 === 0 && $(".css-1tq00ko:eq(1)").closest('div').attr('class') == 'css-rzdgh7' && called == 0){ t1 = 1; soundGo(server+caller+"/SoundHwTriple19_old.wav", audio); } // Triple 18 1st dart if ( x1.includes("T18") && t1 === 0 && $(".css-1tq00ko:eq(1)").closest('div').attr('class') == 'css-rzdgh7' && called == 0){ t1 = 1; soundGo(server+caller+"/SoundHwTriple18_old.wav", audio); } // Triple 17 1st dart if ( x1.includes("T17") && t1 === 0 && $(".css-1tq00ko:eq(1)").closest('div').attr('class') == 'css-rzdgh7' && called == 0){ t1 = 1; soundGo(server+caller+"/SoundHwTriple17_old.wav", audio); } /// 2. Dart // Triple 20 1st dart if ( x2.includes("T20") && t2 === 0 && $(".css-1tq00ko:eq(2)").closest('div').attr('class') == 'css-rzdgh7' && called == 0){ t2 = 1; soundGo(server+caller+"/SoundHwTriple20_old.wav", audio); } // Triple 19 1st dart if ( x2.includes("T19") && t2 === 0 && $(".css-1tq00ko:eq(2)").closest('div').attr('class') == 'css-rzdgh7' && called == 0){ t2 = 1; soundGo(server+caller+"/SoundHwTriple19_old.wav", audio); } // Triple 18 1st dart if ( x2.includes("T18") && t2 === 0 && $(".css-1tq00ko:eq(2)").closest('div').attr('class') == 'css-rzdgh7' && called == 0){ t2 = 1; soundGo(server+caller+"/SoundHwTriple18_old.wav", audio); } // Triple 17 1st dart if ( x2.includes("T17") && t2 === 0 && $(".css-1tq00ko:eq(2)").closest('div').attr('class') == 'css-rzdgh7' && called == 0){ t2 = 1; soundGo(server+caller+"/SoundHwTriple17_old.wav", audio); } /// 3. Dart // Triple 20 1st dart if ( x3.includes("T20") && t3 === 0 && $(".css-1tq00ko:eq(3)").closest('div').attr('class') == 'css-rzdgh7' && called == 0){ t3 = 1; soundGo(server+caller+"/SoundHwTriple20_old.wav", audio); } // Triple 19 1st dart if ( x3.includes("T19") && t3 === 0 && $(".css-1tq00ko:eq(3)").closest('div').attr('class') == 'css-rzdgh7' && called == 0){ t3 = 1; soundGo(server+caller+"/SoundHwTriple19_old.wav", audio); } // Triple 18 1st dart if ( x3.includes("T18") && t3 === 0 && $(".css-1tq00ko:eq(3)").closest('div').attr('class') == 'css-rzdgh7' && called == 0){ t3 = 1; soundGo(server+caller+"/SoundHwTriple18_old.wav", audio); } // Triple 17 1st dart if ( x3.includes("T17") && t3 === 0 && $(".css-1tq00ko:eq(3)").closest('div').attr('class') == 'css-rzdgh7' && called == 0){ t3 = 1; soundGo(server+caller+"/SoundHwTriple17_old.wav", audio); } } ///////////////////////////////////////////////// Miss CALLER /////////////////////////// if(buhsound == 1){ // miss 1st dart if ( x1.includes("M") && m1 === 0 && $(".css-1tq00ko:eq(1)").closest('div').attr('class') == 'css-rzdgh7' && called == 0) { m1 = 1; soundGo(server+caller+"/miss_1st_dart.mp3", audio); } // miss 2st dart if ( x2.includes("M") && m2 === 0 && $(".css-1tq00ko:eq(2)").closest('div').attr('class') == 'css-rzdgh7' && called == 0) { m2 = 1; soundGo(server+caller+"/miss_2nd_dart.mp3", audio); } // miss 3rd dart if ( x3.includes("M") && m3 === 0 && $(".css-1tq00ko:eq(3)").closest('div').attr('class') == 'css-rzdgh7' && called == 0) { m3 = 1; soundGo(server+caller+"/miss_3rd_dart.mp3", audio); } } // Caller reset if( (x1 == '' || $(".css-1tq00ko:eq(3)").closest('div').attr('class') != 'css-rzdgh7') && called == 1) { called = 0; busted = 0; } // Caller if 3rd Dart has score and called = 0 if( $(".css-1tq00ko:eq(3)").closest('div').attr('class') == 'css-rzdgh7' && called == 0 ) { //add 00 to score // if(x0 < 10) {x0 = "00"+x0;} // else if(x0 <100) { x0 = "0"+x0 ;} soundGo(server+caller+"/"+x0+".mp3", audio); console.log('Caller Ausgabe!'); called = 1; t1 = 0; t2 = 0; t3 = 0; m1 = 0; m2 = 0; m3 = 0; } },200); $(document).on('click', '#mute', function(){ if(audio == 1) { audio = 0; $(".css-1xn1mdy").first().css("background-color","red"); } else if(audio == 0) { audio = 1; $(".css-1xn1mdy").first().css("background-color","green"); } }); }); })();