Hellcase Auto Daily Free

Automatically get Hellcase daily free bonus

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Hellcase Auto Daily Free
// @namespace    https://github.com/kb1000fx/ToolBox/
// @version      0.1
// @description  Automatically get Hellcase daily free bonus
// @icon         https://cdn.hellcase.com/hellcase/img/web/hw.png
// @author       kb1000fx
// @match        https://hellcase.com/en/dailyfree
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    if($('#btn_open_daily_free span').length){
        $('#btn_open_daily_free').click();
        setTimeout(() => {
            location.reload();
        }, 3000);
    }else{
        let str = $('.hellcase-btn-success.big.disabled.notavailable span').text().split(" ");
        let length = str.length;
        let hr = Number(str[length-4])||0;
        let min = Number(str[length-2]);
        let time = (hr * 60 + min + 5) * 60 * 1000;
        console.log('Page will reload in ' + hr + " hours " + (min + 5) + " minutes.");
        setTimeout(() => {
            location.reload()
        }, time);
    }
})();