|
|
(未显示同一用户的9个中间版本) |
第1行: |
第1行: |
| ''用以进行一些简(ruo)单(zhi)聊天室小功能开发的房间, 本 界面 用以 存放 某猹写出来的屎山'' | | ''用以进行一些简(ruo)单(zhi)聊天室小功能开发的房间, 此 界面 做 存放 处用'' |
|
| |
|
| 虽然是屎山但还是能用的 ——by [[@蛤猹鸣泣之时|哈茶]]
| | ——by [[@蛤猹鸣泣之时|哈茶]] |
| ==='''<big>!TSOP按钮</big>'''=== | | ==='''<big>!TSOP按钮</big>'''=== |
| 这个功能用来在 "POST!" 按钮的边上增加一个 "!TSOP" 按钮'''。''' | | 这个功能用来在 "POST!" 按钮的边上增加一个 "!TSOP" 按钮'''。''' |
第8行: |
第8行: |
| <syntaxhighlight lang="javascript" line="1"> | | <syntaxhighlight lang="javascript" line="1"> |
| var oon = $("#message> div.room-submit-wrap> input") | | var oon = $("#message> div.room-submit-wrap> input") |
|
| |
| function fan(a1,b=[""]){ | | function fan(a1,b=[""]){ |
| //将字符串颠倒
| |
| a = a1+""; | | a = a1+""; |
| mes2 = a.length-1; | | mes2 = a.length-1; |
第29行: |
第27行: |
|
| |
|
| $("<button type='button' onclick='fan2();'>!TSOP</button>").insertAfter(oon); | | $("<button type='button' onclick='fan2();'>!TSOP</button>").insertAfter(oon); |
| | </syntaxhighlight> |
| | |
| | ==='''<big> 房间保持器 </big>'''=== |
| | |
| | |
| | 通过不停私信自己来保持房间(和自身)的存活。 |
| | |
| | 相比起泡泡机和报时器,减少了刷屏(对他人来说)。 |
| | |
| | <syntaxhighlight lang="javascript" line="1"> |
| | postt=()=>{$.post("#",{message:"keepalive",to:""+profile.id})} |
| | setInterval(postt,1200000) |
| </syntaxhighlight> | | </syntaxhighlight> |
|
| |
|
第41行: |
第51行: |
| <syntaxhighlight lang="javascript" line="1"> | | <syntaxhighlight lang="javascript" line="1"> |
| $('#talks').bind('DOMNodeInserted',function(){ | | $('#talks').bind('DOMNodeInserted',function(){ |
| var TIm = new Date(); | | TIm = new Date(); |
| var tim5 = ("↑"+TIm.getHours()+"点"+TIm.getMinutes()+"分"+TIm.getSeconds()+"秒↑"); | | tim5 = ("↑"+TIm.getHours()+"点"+TIm.getMinutes()+"分"+TIm.getSeconds()+"秒↑"); |
| var hua = $("div#talks>:first-child"); | | hua = $("div#talks>:first-child"); |
| if ($("div#talks>:eq(1)").attr("class") == "nope"){}
| | if ($("div#talks>:eq(1)").attr("class") == "nope"){} |
| else{
| | else{ |
| $("<span id='dema' class ='nope' ></span>").insertAfter(hua);
| | $("<span id='dema' class ='nope' ></span>").insertAfter(hua); |
| document.getElementById("dema").innerHTML=tim5
| | document.getElementById("dema").innerHTML=tim5 |
| } | | } |
| }); | | }); |
| </syntaxhighlight> | | </syntaxhighlight> |
| | |
| | ===自爆式失忆喷雾=== |
| | <span title="总而言之" style="color:black;background-color:black;cursor:default;font-color:black">慎用</span> |
| | |
| | 啊,这是什么?失忆喷雾?喷一下。 |
| | |
| | 啊,这是什么?失忆喷雾?喷一下。 |
| | |
| | 啊,这是什么?失忆喷雾?喷一下。 |
| | |
| | 啊,这是什么?失忆喷雾?喷一下。 |
| | |
| | 啊,这是什么?失忆喷雾?喷一下。<syntaxhighlight lang="javascript" line="1"> |
| | Time1 = 3000; |
| | WhatIsTihs=()=>{ |
| | $.post("#",{message:"啊,这是什么?失忆喷雾?喷一下。",to:""+profile.id}) |
| | setTimeout(WhatIsTihs,1500) |
| | Time1 =Time1-500 |
| | } |
| | WhatIsTihs(); |
| | </syntaxhighlight> |
| | |
|
| |
|
| ==='''<big>说书脚本</big>'''=== | | ==='''<big>说书脚本</big>'''=== |
第78行: |
第110行: |
| <syntaxhighlight lang="javascript" line="1"> | | <syntaxhighlight lang="javascript" line="1"> |
| pao = [ "O", "o", "〇","·","0",".",""]; | | pao = [ "O", "o", "〇","·","0",".",""]; |
| ran2 =0 | | x=(ran2=0,ran3="")=>{ |
| ran3 = "" | |
| x =() => {
| |
|
| |
| while (ran2 <= 40){ | | while (ran2 <= 40){ |
| ran1 = pao[Math.floor(Math.random()*pao.length)]; | | ran3 = ran3+pao[Math.floor(Math.random()*pao.length)] |
| ran3 = ran3+ran1;
| |
| ran2 = ran2+1; | | ran2 = ran2+1; |
| } | | } |
| $.post("#",{message: "/me冒泡"+ran3}); | | $.post("#",{message: "/me冒泡"+ran3}); |
| ran2 = 0
| |
| ran3 = ""
| |
| }; | | }; |
| x();
| | x(); |
| setInterval(function(){ x()},20*60*1000);
| | setInterval(x,20*60*1000); |
| </syntaxhighlight>
| |
| | |
| | |
| ==='''网易歌单JSON生成器'''===
| |
| | |
| | |
| 这个功能可以把网易云的歌单做成一个JSON串
| |
| | |
| 配合下面的自动音乐播放器使用
| |
| <syntaxhighlight lang="javascript" line="1">
| |
| function time2(tim){
| |
| ti2 = tim.split(":");
| |
| ti3 = ti2[0]*60*1000+ti2[1]*1000;
| |
| return ti3;
| |
| }
| |
| function wyzfc(zfc){
| |
| var zfc_l = zfc.length;
| |
| var zfc2 = zfc.slice(30,zfc_l)
| |
| var zfc3 = "https://link.hhtjim.com/163/"+zfc2+".mp3";
| |
| return zfc3;
| |
| }
| |
| var obj1 = [];
| |
| | |
| function nameurl(a_name,a_url,a_time){
| |
| | |
| obj2 = {name:a_name,url:a_url,time:a_time}
| |
| obj1.push(obj2);
| |
|
| |
| }
| |
| function wyy(){
| |
| x11 = 1;
| |
| var tbody = "html>:last-child>:nth-child(5) > div > div.g-mn3.f-pr.j-flag > div > div:nth-child(2) >div>div>table>tbody"
| |
| var x_length = $(tbody).childNodes.length;
| |
| while(x11<=x_length){
| |
| tr_class= $(tbody+">:nth-child("+ x11 +")").className;
| |
| x1 = tbody + ">:nth-child("+ x11 +")> td:nth-child(2) > div > div > div > span > a";
| |
| x_url = wyzfc($(x1).href);
| |
| x_name = $(x1+">b").title;
| |
| x_time = time2( $(tbody+">:nth-child("+x11+")> td:nth-child(3)> span ").textContent );
| |
| //剔除无效链接👇
| |
| if (tr_class == 'even js-dis' || tr_class == " js-dis" ){
| |
|
| |
| x11 = x11+1;
| |
| }
| |
| else{
| |
| nameurl(x_name,x_url,x_time);
| |
| x11 = x11+1;
| |
| }
| |
| //剔除无效链接👆
| |
| }
| |
|
| |
| }
| |
| wyy();
| |
| obj1
| |
| </syntaxhighlight>
| |
| | |
| ==='''自动音乐播放器'''===
| |
| | |
| | |
| 这个功能用来自动连播音乐。
| |
| | |
| JSON输入栏用来输入JSON串。
| |
| | |
| 循环按钮用来控制循环开启/关闭。
| |
| | |
| 下一首按钮用来切歌/开始播放。<syntaxhighlight lang="javascript" line="1">
| |
| function drr(namee,url){
| |
| $("#form-room-music-url").val(url);
| |
| $("#form-room-music-name").val(namee);
| |
| $("#music_pannel > div > div:nth-child(2) > span.input-group-btn > input").click();
| |
| a4();
| |
| }
| |
| function a4(){
| |
| //检查播放状态
| |
| var div_class = document.querySelector("body> :last-child").className
| |
| setTimeout(function(){
| |
| if (div_class == "sweet-alert showSweetAlert visible"){
| |
| document.querySelector("body > div.sweet-alert.showSweetAlert.visible > div.sa-button-container > div > button").click();
| |
| bofangqi();
| |
| }
| |
| },5000);
| |
| | |
| setTimeout(function(){
| |
| if($("#musicBox > div > div.progress-music").attr("class") == "progress-music"){
| |
| bofangqi();
| |
| }
| |
| },35000);
| |
| }
| |
| var oon = $("#message> div.room-submit-wrap> input")
| |
| $("<button type='button' onclick='aaa();' id = 'aab'>循环:开启</button>").insertAfter(oon);
| |
| var fst = true;
| |
| function aaa(){
| |
| if (fst == true){
| |
| var element=document.getElementById("aab");
| |
| element.innerHTML="循环:关闭";
| |
| fst = false;
| |
| }
| |
| else if(fst == false){
| |
| var element=document.getElementById("aab");
| |
| element.innerHTML="循环:开启";
| |
| fst = true;
| |
| }
| |
| | |
| }
| |
| bfq1 = 0;
| |
| $("<p>'JSON'<Textarea id = 'JSON' cols = '4' rows = '1' value = 'JSON' > </Textarea></p>").insertAfter(oon);
| |
| $("<button type='button' onclick='bofangqi();' id = 'a12'>下一首</button>").insertAfter(oon);
| |
| setT = setTimeout(x345=1,3000);
| |
| function bofangqi(){
| |
| | |
| x2 = JSON.parse( $("#JSON").val() );
| |
| x2_length = x2.length-1;
| |
| musicbox = $("#musicBox > div > div.progress-music").attr("class");
| |
| if ( bfq1<=x2_length ){
| |
|
| |
| clearTimeout(setT);
| |
| js1 = x2[bfq1];
| |
| drr(js1.name,js1.url)
| |
| bfq1 = bfq1+1;
| |
| setT = setTimeout(bofangqi,js1.time+3000);
| |
| }
| |
| else if (fst == true){
| |
| bfq1 = 0;
| |
| setT = setTimeout(bofangqi,3000);
| |
| }
| |
| else {}
| |
| | |
| }
| |
| </syntaxhighlight> | | </syntaxhighlight> |
|
| |
|