Skip to content

Instantly share code, notes, and snippets.

@PrOmPt0
PrOmPt0 / autoExchangeCoin.js
Last active October 14, 2019 03:16
Bilibili Evolved 脚本自动换硬币函数
//自动触发瓜子换硬币
autoExchangeCoin();
async function autoExchangeCoin(){
const date=(new Date).getDate();
const date_GM=await GM.getValue('ex_date');
console.warn(date,date_GM,date-date_GM);
(()=>{
const t=`https://api.live.bilibili.com/pay/v1/Exchange/silver2coin`;
const s=async()=>{
const s=await Ajax.getJsonWithCredentials(t);
//异步加载JS
function loadJS(src, target, callback) {
target = target || 'head'
appendElem('script', target, {src: src, onload: callback, async: true, defer: true})
}
//动态创建元素
function appendElem(tagName, target, props) {
var tagElem = document.createElement(tagName)
for (var keyName in props) {