Site Notice
hello, world
Difference between revisions of "超星弹幕助手"
From Project-EPB Commons
([InPageEdit] 没有编辑摘要) |
([InPageEdit] 没有编辑摘要) |
||
Line 19: | Line 19: | ||
setInterval(function(){ | setInterval(function(){ | ||
var randomMsg = [ | var randomMsg = [ | ||
− | ' | + | '大概明白了!', |
− | ' | + | '请问是不是还有另外一种解法?', |
− | ' | + | '哇这题太难了我快晕了!🤯🤯🤯', |
− | ' | + | '考试要是考这题我算是完了。。。', |
+ | '大概…懂了…其实还是不太明白。', | ||
+ | '啊…老师请问可以再讲一次嘛?', | ||
'送出🚀x1000<br/>[<span style="color:red">用户已被禁言</span>]', | '送出🚀x1000<br/>[<span style="color:red">用户已被禁言</span>]', | ||
], | ], | ||
finalMsg = randomMsg[Math.floor(Math.random() * randomMsg.length)], | finalMsg = randomMsg[Math.floor(Math.random() * randomMsg.length)], | ||
− | randomUser = ['张三','李四','王五','赵六','周七','老八','司马缸','初濑伊纲'], | + | randomUser = ['张三','李四','王五','赵六','周七','老八','司马缸','初濑伊纲','品如','坤坤'], |
finalUser = randomUser[Math.floor(Math.random() * randomUser.length)] | finalUser = randomUser[Math.floor(Math.random() * randomUser.length)] | ||
sendComment(finalUser, finalMsg); | sendComment(finalUser, finalMsg); |
Revision as of 01:10, 22 February 2020
<html> <script src="https://common.wjghj.cn/js/ChaoXingDanMuZhuShou"></script> 这是一个超星网课直播平台弹幕刷屏助手的演示页面,我在这简单做了一个类似于评论区的东西。 <pre id="msgArea" style="padding: 4px; height: 200px; overflow: auto; border: 1px solid #aaa;"><p class="comment">[<span style="color:#f48">管理员消息</span>]<b>老师:</b>同学们怎么想呢?</p></pre> <textarea id="RKLBChat_sendText"></textarea> <button id="RKLBChat_sendMsg" onclick="sendCommentByMe()">发送评论</button> <script> function sendComment(user, comment) {
if (comment === '' || user === '') return; $('#msgArea').append('<p class="comment"><b>' + user + ':</b>' + comment + '<span style="color:#999">' + new Date().toTimeString() + '</span></p>'); var msgArea = document.getElementById('msgArea'); msgArea.scrollTop = msgArea.scrollHeight;
} function sendCommentByMe(){
var toSent = $('#RKLBChat_sendText').val(); $('#RKLBChat_sendText').val(''); sendComment('您', toSent);
} setInterval(function(){
var randomMsg = [ '大概明白了!', '请问是不是还有另外一种解法?', '哇这题太难了我快晕了!🤯🤯🤯', '考试要是考这题我算是完了。。。', '大概…懂了…其实还是不太明白。', '啊…老师请问可以再讲一次嘛?', '送出🚀x1000<br/>[<span style="color:red">用户已被禁言</span>]', ], finalMsg = randomMsg[Math.floor(Math.random() * randomMsg.length)], randomUser = ['张三','李四','王五','赵六','周七','老八','司马缸','初濑伊纲','品如','坤坤'], finalUser = randomUser[Math.floor(Math.random() * randomUser.length)] sendComment(finalUser, finalMsg);
},3000); </script> </html>