Skip to content

Instantly share code, notes, and snippets.

@valex
Last active April 29, 2025 13:40
Show Gist options
  • Save valex/c5ee9c01c3a5aaf34b9de4e26a9f0737 to your computer and use it in GitHub Desktop.
Save valex/c5ee9c01c3a5aaf34b9de4e26a9f0737 to your computer and use it in GitHub Desktop.
Script for freebitco.in that can click ROLL button automatically
// ==UserScript==
// @name freebitco.in Autoroll Autoclick script
// @namespace https://gist.github.com/valex/c5ee9c01c3a5aaf34b9de4e26a9f0737
// @version 0.3
// @description Script for freebitco.in that can click ROLL button automatically
// @author valex
// @match https://freebitco.in/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=freebitco.in
// @grant none
// @run-at document-end
// ==/UserScript==
// This script DOES NOT RESOLVES captcha
// This script works only for freebitco.in premium users, who can roll WITHOUT CAPTCHA
// ================================================
//
// If you like this script
// please register using link: https://freebitco.in/?r=41688905
//
// Or please donate BTC: bc1qysg9g7xdguxuz233d8n5v2dwykaxp0pm6xcxzx
//
// ================================================
// ============ INSTALLATION ======================
//
// 1. Use Tampermonkey extension to run script
// Chrome: https://chrome.google.com/webstore/detail/dhdgffkkebhmkfjojejmpbldmpobfkfo
// Firefox: https://addons.mozilla.org/en-US/firefox/addon/tampermonkey/
// Opera: https://addons.opera.com/en/extensions/details/tampermonkey-beta/
// Tampermonkey home page: https://www.tampermonkey.net/
//
// 2. In Tampermonkey dashboard click '+' sign to add new script
// 3. Copy and paste into tampermonkey the entire contents of this file
// 4. Save script (Ctrl + S)
// 5. Open freebitco.in in new tab or refresh page
//
// Tampermonkey FAQ page: https://www.tampermonkey.net/faq.php
//
//
// Script is starting after page reload and trying to click ROLL button if it is active
//
// Please try to keep the tab with freebitco.in active
(async () => {
const random = (min, max) => {
return Math.floor(Math.random() * (max - min + 1) + min);
}
// Delay before script starts after page load/reload [min, max] [12sec, 18sec]
const delayBeforeStart = [12 * 1000, 18 * 1000];
// Delay before roll [min, max] [30sec, 60sec]
const delayBeforeRoll = [30 * 1000, 60 * 1000];
// Delay before close popup [min, max] [14sec, 30sec]
const delayBeforeClosePopup = [14 * 1000, 30 * 1000];
// Create status display element
const statusDiv = document.createElement('div');
statusDiv.style.cssText = 'position:fixed;bottom:30px;left:10px;background-color:white;opacity:0.7;padding:10px;border-radius:5px;box-shadow:0 0 10px rgba(0,0,0,0.2);z-index:9999;font-size:14px;min-width:200px;';
document.body.appendChild(statusDiv);
// Function to update status
const updateStatus = (message) => {
const timestamp = new Date().toLocaleTimeString('en-GB', { hour12: false });
statusDiv.innerHTML = `<strong>Autoroll Status:</strong><br>${timestamp} - ${message}`;
console.log(`Autoroll script: ${message}`);
}
const smoothScrollToBottom = () => {
return new Promise((resolve) => {
const scrollHeight = document.documentElement.scrollHeight;
const scrollStep = Math.floor(scrollHeight / 20);
let currentScroll = window.pageYOffset;
const scrollInterval = setInterval(() => {
if (currentScroll >= scrollHeight - window.innerHeight) {
clearInterval(scrollInterval);
resolve();
return;
}
currentScroll += scrollStep;
window.scrollTo({
top: currentScroll,
behavior: 'smooth'
});
}, 100);
});
};
const freebitcoinAutorollAutoclick = async function(){
await smoothScrollToBottom();
let rollBtn = document.getElementById('free_play_form_button');
let rollBtnStyle = window.getComputedStyle(rollBtn);
if(rollBtnStyle.display !== 'none'){
// do click
let beforeRollTimeout = random(...delayBeforeRoll);
updateStatus(`Will click ROLL after ${Math.round(beforeRollTimeout/1000)} seconds`);
await new Promise((res) => setTimeout(res, beforeRollTimeout));
// if button still active
if(rollBtnStyle.display !== 'none'){
rollBtn.click();
let beforeClosePopupTimeout = random(...delayBeforeClosePopup);
updateStatus(`Will close popup after ${Math.round(beforeClosePopupTimeout/1000)} seconds`);
await new Promise((res) => setTimeout(res, beforeClosePopupTimeout));
const buttonClosePopupEl = document.querySelector(
"#myModal22 a.close-reveal-modal"
);
buttonClosePopupEl.click();
updateStatus('Popup closed. Waiting for next roll opportunity');
}else{
updateStatus('Roll button disappeared. Maybe already clicked');
}
}else{
updateStatus('Roll button is not available');
}
updateStatus('ROLL button currently unavailable on page');
}
console.log('Script loaded');
let delayBeforeStartTimeout = random(...delayBeforeStart);
updateStatus(`Will start after ${Math.round(delayBeforeStartTimeout/1000)} seconds`);
setTimeout(freebitcoinAutorollAutoclick, delayBeforeStartTimeout)
})();
// ================================================
//
// If you like this script
// please register using link: https://freebitco.in/?r=41688905
//
// Or please donate BTC: bc1qysg9g7xdguxuz233d8n5v2dwykaxp0pm6xcxzx
//
// ================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment