From 753555063089883dce63b365b54b417709b27572 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Sat, 13 Mar 2021 06:09:54 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E5=96=84=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E6=97=B6=20=E5=88=B7=E6=96=B0=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mcbbs/vending-machine.user.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mcbbs/vending-machine.user.js b/mcbbs/vending-machine.user.js index 1b2b267..698f7b4 100644 --- a/mcbbs/vending-machine.user.js +++ b/mcbbs/vending-machine.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name MCBBS自动售卖机 // @namespace https://miaowoo.cc/ -// @version 0.6.3 +// @version 0.7.0 // @description 自动售卖道具 // @author MiaoWoo // @match https://www.mcbbs.net/home.php?mod=magic** @@ -101,7 +101,12 @@ sendItem(() => window.showWindow('magics', 'home.php?mod=magic&action=mybox&operation=give&magicid=32', 'get', 0), masterInfo.username, masterInfo.amount || stock) } async function refresh() { - location.href = '/home.php?mod=magic&action=mybox&nodeType=' + params.nodeType + try { + await fetch('/api/mobile/index.php?version=4&module=credit') + location.href = '/home.php?mod=magic&action=mybox&nodeType=' + params.nodeType + } catch (error) { + setTimeout(refresh, 5000) + } } async function shopAction() { await sendOrderAction(() => window.showWindow('magics', 'home.php?mod=magic&action=shop&operation=give&mid=mcbbs_mcserver_plus:serverBump'), true)