FLBOT_NO1

free crypto + Dice roll

  1. // ==UserScript==
  2. // @name FLBOT_NO1
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.4
  5. // @description free crypto + Dice roll
  6. // @author Peckovic
  7. // @license MIT
  8. // @match *://*.suipick.io/*
  9. // @match *://*.tonpick.game/*
  10. // @match *://*.polpick.io/*
  11. // @match *://*.solpick.io/*
  12. // @match *://*.tronpick.io/*
  13. // @match *://*.dogepick.io/*
  14. // @match *://*.bnbpick.io/*
  15. // @match *://*.litepick.io/*
  16. // @match *://*.freetron.in/*
  17. // @match *://*.freebnb.in/*
  18. // @match *://*.freexrp.in/*
  19. // @match *://*.freetoncoin.in/*
  20. // @match *://*.usdpick.io/*
  21. // @match *://*.freeshib.in/*
  22. // @match *://*.freebitco.in/*
  23. // @match *://*.freetrump.in/*
  24. // @grant none
  25. // ==/UserScript==
  26.  
  27. (function () {
  28. // Debug log za proveru pokretanja
  29. console.log("[FLBOT] SKRIPTA POKRENUTA!");
  30.  
  31. if (window.top !== window.self || window.FLBOTv5_started) {
  32. console.log("[FLBOT] Skripta se već izvršava ili je u iframe-u");
  33. return;
  34. }
  35. window.FLBOTv5_started = true;
  36. console.log("[FLBOT] Inicijalizujem bot...");
  37.  
  38. // Tab focus management
  39. document.addEventListener('visibilitychange', function() {
  40. if (document.hidden) {
  41. window.focus();
  42. if (!window.flbotAudio) {
  43. window.flbotAudio = new Audio();
  44. window.flbotAudio.src = "data:audio/wav;base64,UklGRnoGAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQoGAACBhYqFbF1fdJivrJBhNjVgodDbq2EcBj+a2/LDciUFLIHO8tiJNwgZaLvt559NEAxQp+PwtmMcBjiR1/LMeSwFJHfH8N2QQAoUXrTp66hVFApGn+DyvmEgBTGH0fPTgDAFJnrC7+ONQQ0PVqzn77BdGAU+ltryxnkpBSl+zPLZgTMIGWq+8OShUgwLU6fj8LhjHgg2jdXzzn0vBSF0xe/eizELDlOq5O+zYBoGPJPY88p9KwUme8rx2oQ2Bylt1O3Nhx4FO5Pz8x1eHgMvecGCa5BGMZVGrGFt1xGj7OBkOhKfbU6I1KLh7eSr1bvq";
  45. window.flbotAudio.loop = true;
  46. window.flbotAudio.volume = 0;
  47. }
  48. window.flbotAudio.play().catch(e => console.log("[FLBOT] Audio play prevented:", e));
  49. }
  50. });
  51.  
  52. // Funkcije za čuvanje dice bot stanja
  53. function getDiceBotStateKey() {
  54. return `flbot_dicebot_states`;
  55. }
  56.  
  57. function loadDiceBotStates() {
  58. const stateKey = getDiceBotStateKey();
  59. const saved = localStorage.getItem(stateKey);
  60. if (saved) {
  61. try {
  62. return JSON.parse(saved);
  63. } catch (e) {
  64. console.log("[FLBOT] Greška pri učitavanju dice bot stanja:", e);
  65. return {};
  66. }
  67. }
  68. return {};
  69. }
  70.  
  71. function saveDiceBotState(hostname, isEnabled) {
  72. const stateKey = getDiceBotStateKey();
  73. const states = loadDiceBotStates();
  74. states[hostname] = isEnabled;
  75. localStorage.setItem(stateKey, JSON.stringify(states));
  76. console.log(`[FLBOT] Dice bot stanje za ${hostname}:`, isEnabled ? 'ON' : 'OFF');
  77. }
  78.  
  79. function isDiceBotEnabled(hostname) {
  80. const states = loadDiceBotStates();
  81. // Ako nema sačuvano stanje, default je ON
  82. return states[hostname] !== false;
  83. }
  84.  
  85. // Poboljšane funkcije za čuvanje statistika
  86. function getStatsKey() {
  87. return `flbot_stats_${location.hostname}`;
  88. }
  89.  
  90. function loadStats() {
  91. const statsKey = getStatsKey();
  92. const saved = localStorage.getItem(statsKey);
  93. if (saved) {
  94. try {
  95. return JSON.parse(saved);
  96. } catch (e) {
  97. console.log("[FLBOT] Greška pri učitavanju statistika:", e);
  98. return { profit: 0, totalBet: 0, rolls: 0, wins: 0, losses: 0, lastUpdate: Date.now() };
  99. }
  100. }
  101. return { profit: 0, totalBet: 0, rolls: 0, wins: 0, losses: 0, lastUpdate: Date.now() };
  102. }
  103.  
  104. function saveStats(stats) {
  105. const statsKey = getStatsKey();
  106. stats.lastUpdate = Date.now();
  107. localStorage.setItem(statsKey, JSON.stringify(stats));
  108. }
  109.  
  110. function resetStats() {
  111. const statsKey = getStatsKey();
  112. localStorage.removeItem(statsKey);
  113. console.log("[FLBOT] Statistike resetovane za", location.hostname);
  114. }
  115.  
  116. function mergeStats(oldStats, newStats) {
  117. // Spaja stare i nove statistike, uzimajući veće vrednosti za ključne metrike
  118. return {
  119. profit: Math.max(oldStats.profit || 0, newStats.profit || 0),
  120. totalBet: Math.max(oldStats.totalBet || 0, newStats.totalBet || 0),
  121. rolls: Math.max(oldStats.rolls || 0, newStats.rolls || 0),
  122. wins: Math.max(oldStats.wins || 0, newStats.wins || 0),
  123. losses: Math.max(oldStats.losses || 0, newStats.losses || 0),
  124. lastUpdate: Date.now()
  125. };
  126. }
  127.  
  128. const sites = [
  129. { host: "suipick.io", aff: "https://suipick.io/?ref=peckovic", dice: "https://suipick.io/dice.php", minBet: 0.000010000, usesIframe: false },
  130. { host: "tonpick.game", aff: "https://tonpick.game/?ref=ba1tazar666", dice: "https://tonpick.game/dice.php", minBet: 0.00001000, usesIframe: false },
  131. { host: "polpick.io", aff: "https://polpick.io/?ref=ba1tazar666", dice: "https://polpick.io/dice.php", minBet: 0.00001000, usesIframe: false },
  132. { host: "solpick.io", aff: "https://solpick.io/?ref=ba1tazar666", dice: "https://solpick.io/dice.php", minBet: 0.00000010, usesIframe: false },
  133. { host: "tronpick.io", aff: "https://tronpick.io/?ref=ba1tazar666", dice: "https://tronpick.io/dice.php", minBet: 0.000100, usesIframe: false },
  134. { host: "dogepick.io", aff: "https://dogepick.io/?ref=ba1tazar666", dice: "https://dogepick.io/dice.php", minBet: 0.00010000, usesIframe: false },
  135. { host: "bnbpick.io", aff: "https://bnbpick.io/?ref=ba1tazar666", dice: "https://bnbpick.io/dice.php", minBet: 0.00000001, usesIframe: false },
  136. { host: "litepick.io", aff: "https://litepick.io/?ref=ba1tazar666", dice: "https://litepick.io/dice.php", minBet: 0.00000010, usesIframe: false },
  137. { host: "freetron.in", aff: "https://freetron.in/faucet", dice: "https://freetron.in/games/dice", minBet: 0.0005, usesIframe: true },
  138. { host: "freebnb.in", aff: "https://freebnb.in/faucet", dice: "https://freebnb.in/games/dice", minBet: 0.00000010, usesIframe: true },
  139. { host: "freexrp.in", aff: "https://freexrp.in/faucet", dice: "https://freexrp.in/games/dice", minBet: 0.000050, usesIframe: true },
  140. { host: "freetoncoin.in", aff: "https://freetoncoin.in/faucet", dice: "https://freetoncoin.in/games/dice", minBet: 0.00001000, usesIframe: true },
  141. { host: "usdpick.io", aff: "https://usdpick.io/faucet", dice: "https://usdpick.io/games/dice", minBet: 0.00005, usesIframe: false },
  142. { host: "freeshib.in", aff: "https://freeshib.in/faucet", dice: "https://freeshib.in/games/dice", minBet: 10.00000000, usesIframe: true },
  143. { host: "freebitco.in", aff: "https://freebitco.in/?op=home#", dice: "https://freebitco.in/?op=home#", minBet: 0.00000001, usesIframe: false },
  144. { host: "freetrump.in", aff: "https://freetrump.in?ref=5fsHx6sPFX", dice: "https://freetrump.in/games/dice", minBet: 0.00003, usesIframe: true, mainUrl: "https://freetrump.in/faucet" }
  145. ];
  146.  
  147. console.log("[FLBOT] Lista sajtova učitana, ukupno:", sites.length);
  148.  
  149. const ROTATE_IN = 60;
  150. let countdown = ROTATE_IN;
  151. let wentToDice = false;
  152. let index = parseInt(localStorage.getItem("flbot_index") || "0");
  153. let botIsPlaying = false;
  154. let diceBotActive = false;
  155. let currentBet = 0;
  156. let baseBet = 0;
  157. let winChance = 49.5;
  158. let high = true;
  159. let autoMode = true;
  160. let dicePanel = null;
  161. let togglePanel = null;
  162.  
  163. function nextSite() {
  164. let nextIndex = (index + 1) % sites.length;
  165. let attempts = 0;
  166. const maxAttempts = sites.length;
  167.  
  168. // Proverava da li je dice bot uključen za sledeći sajt
  169. while (attempts < maxAttempts) {
  170. const nextSite = sites[nextIndex];
  171.  
  172. // Ako je freebitco.in, uvek preskači dice bot proveru
  173. if (nextSite.host === "freebitco.in" || isDiceBotEnabled(nextSite.host)) {
  174. index = nextIndex;
  175. localStorage.setItem("flbot_index", index);
  176. console.log("[FLBOT] Prelazim na sajt:", nextSite.host,
  177. nextSite.host === "freebitco.in" ? "(freebitco.in - nema dice)" :
  178. isDiceBotEnabled(nextSite.host) ? "(dice bot ON)" : "");
  179. return nextSite;
  180. } else {
  181. console.log(`[FLBOT] Preskačem sajt ${nextSite.host} (dice bot OFF)`);
  182. nextIndex = (nextIndex + 1) % sites.length;
  183. attempts++;
  184. }
  185. }
  186.  
  187. // Fallback - ako su svi sajti OFF, idi na sledeći u nizu
  188. index = (index + 1) % sites.length;
  189. localStorage.setItem("flbot_index", index);
  190. console.log("[FLBOT] Svi dice bot-ovi su OFF, prelazim na:", sites[index].host);
  191. return sites[index];
  192. }
  193.  
  194. function getCurrentIndex() {
  195. const currentSite = getCurrentSite();
  196. if (!currentSite) return 0;
  197. return sites.findIndex(site => site.host === currentSite.host);
  198. }
  199.  
  200. function getCurrentSite() {
  201. const site = sites.find(site => location.hostname.includes(site.host));
  202. if (site) {
  203. console.log("[FLBOT] Trenutni sajt:", site.host);
  204. } else {
  205. console.log("[FLBOT] Sajt nije prepoznat:", location.hostname);
  206. }
  207. return site;
  208. }
  209.  
  210. function getCurrentBalance() {
  211. const balanceSelectors = [
  212. 'span.balance',
  213. '.balance',
  214. '#balance',
  215. 'span[id*="balance"]',
  216. 'div[id*="balance"]',
  217. '.user-balance',
  218. 'span.text-xs.font-bold',
  219. '#user_balance',
  220. 'span.user-balance',
  221. '.wallet-balance',
  222. '#wallet_balance',
  223. 'span.amount',
  224. '.amount',
  225. '#amount',
  226. 'span[class*="balance"]',
  227. 'div[class*="balance"]',
  228. ];
  229.  
  230. // Prvo proveri glavni dokument
  231. for (const selector of balanceSelectors) {
  232. const element = document.querySelector(selector);
  233. if (element) {
  234. const balanceText = element.textContent || element.innerText || '';
  235. const balanceMatch = balanceText.match(/[\d,.]+/);
  236. if (balanceMatch) {
  237. const balance = parseFloat(balanceMatch[0].replace(/,/g, ''));
  238. if (!isNaN(balance)) {
  239. console.log(`[FLBOT] Pronađen balans: ${balance} (selektor: ${selector})`);
  240. return balance;
  241. }
  242. }
  243. }
  244. }
  245.  
  246. // Ako nije pronađeno u glavnom dokumentu, proveri iframe
  247. const iframe = document.querySelector('iframe');
  248. if (iframe && iframe.contentDocument) {
  249. for (const selector of balanceSelectors) {
  250. const element = iframe.contentDocument.querySelector(selector);
  251. if (element) {
  252. const balanceText = element.textContent || element.innerText || '';
  253. const balanceMatch = balanceText.match(/[\d,.]+/);
  254. if (balanceMatch) {
  255. const balance = parseFloat(balanceMatch[0].replace(/,/g, ''));
  256. if (!isNaN(balance)) {
  257. console.log(`[FLBOT] Pronađen balans u iframe-u: ${balance} (selektor: ${selector})`);
  258. return balance;
  259. }
  260. }
  261. }
  262. }
  263. }
  264.  
  265. console.log("[FLBOT] Balans nije pronađen ili je 0");
  266. return 0;
  267. }
  268.  
  269. function isBalanceSufficient(currentBalance, requiredBet) {
  270. const bufferMultiplier = 10;
  271. const requiredBalance = requiredBet * bufferMultiplier;
  272. return currentBalance >= requiredBalance;
  273. }
  274.  
  275. function switchToNextSiteDueToBalance() {
  276. if (diceBotActive) {
  277. console.log("[FLBOT] ⚠️ Dice bot je aktivan - neću prebaciti na sljedeći sajt zbog balansa");
  278. return;
  279. }
  280.  
  281. console.log("[FLBOT] ⚠️ Nedovoljan balans - prebacujem na sljedeći sajt");
  282. botIsPlaying = false;
  283. updatePanel();
  284.  
  285. setTimeout(() => {
  286. const next = nextSite();
  287. location.href = next.mainUrl || next.aff;
  288. }, 3000);
  289. }
  290.  
  291. function getMainPanelHeight() {
  292. const mainPanel = document.getElementById("flbotPanel");
  293. if (mainPanel) {
  294. return mainPanel.offsetHeight;
  295. }
  296. return 0;
  297. }
  298.  
  299. function getTogglePanelHeight() {
  300. if (togglePanel) {
  301. return togglePanel.offsetHeight;
  302. }
  303. return 0;
  304. }
  305.  
  306. function updateDicePanelPosition() {
  307. if (dicePanel) {
  308. const mainPanelHeight = getMainPanelHeight();
  309. const togglePanelHeight = getTogglePanelHeight();
  310. dicePanel.style.bottom = `${mainPanelHeight + togglePanelHeight + 30}px`;
  311. dicePanel.style.right = '10px';
  312. }
  313. }
  314.  
  315. function updateTogglePanelPosition() {
  316. if (togglePanel) {
  317. const mainPanelHeight = getMainPanelHeight();
  318. togglePanel.style.bottom = `${mainPanelHeight + 10}px`;
  319. togglePanel.style.right = '10px';
  320. }
  321. }
  322.  
  323. function createTogglePanel() {
  324. if (togglePanel) return togglePanel;
  325.  
  326. const currentSite = getCurrentSite();
  327. if (!currentSite) return null;
  328.  
  329. // Ne prikazuj toggle panel za freebitco.in
  330. if (currentSite.host === "freebitco.in") return null;
  331.  
  332. const isEnabled = isDiceBotEnabled(currentSite.host);
  333.  
  334. togglePanel = document.createElement('div');
  335. togglePanel.id = 'flbotTogglePanel';
  336. togglePanel.style.cssText = `
  337. position: fixed;
  338. bottom: 280px;
  339. right: 10px;
  340. background: rgba(25, 25, 25, 0.95);
  341. color: #fff;
  342. font-family: monospace;
  343. font-size: 12px;
  344. padding: 10px;
  345. border-radius: 8px;
  346. width: 260px;
  347. z-index: 9999997;
  348. box-shadow: 0 0 10px #000;
  349. border: 2px solid ${isEnabled ? '#4a9' : '#a94'};
  350. `;
  351.  
  352. togglePanel.innerHTML = `
  353. <div style="font-weight: bold; margin-bottom: 8px; text-align: center; color: #fff;">
  354. 🎮 DICE BOT CONTROL - ${currentSite.host}
  355. </div>
  356. <div style="display: flex; gap: 5px; margin-bottom: 8px;">
  357. <button id="flbot-toggle-on" style="
  358. flex: 1;
  359. background: ${isEnabled ? '#4a9' : '#444'};
  360. color: #fff;
  361. border: none;
  362. padding: 6px;
  363. border-radius: 4px;
  364. cursor: pointer;
  365. font-weight: bold;
  366. font-size: 12px;
  367. transition: all 0.2s ease;
  368. ">ON</button>
  369. <button id="flbot-toggle-off" style="
  370. flex: 1;
  371. background: ${!isEnabled ? '#a94' : '#444'};
  372. color: #fff;
  373. border: none;
  374. padding: 6px;
  375. border-radius: 4px;
  376. cursor: pointer;
  377. font-weight: bold;
  378. font-size: 12px;
  379. transition: all 0.2s ease;
  380. ">OFF</button>
  381. </div>
  382. <div style="text-align: center; font-size: 11px; color: #ccc;">
  383. Current: <span id="flbot-toggle-status" style="color: ${isEnabled ? '#4a9' : '#a94'}; font-weight: bold;">
  384. ${isEnabled ? 'ON' : 'OFF'}
  385. </span>
  386. </div>
  387. `;
  388.  
  389. document.body.appendChild(togglePanel);
  390. updateTogglePanelPosition();
  391.  
  392. // Event listeners za toggle dugmad
  393. const onBtn = document.getElementById('flbot-toggle-on');
  394. const offBtn = document.getElementById('flbot-toggle-off');
  395. const toggleStatus = document.getElementById('flbot-toggle-status');
  396.  
  397. if (onBtn) {
  398. onBtn.addEventListener('click', () => {
  399. saveDiceBotState(currentSite.host, true);
  400.  
  401. // Ažuriraj UI
  402. onBtn.style.background = '#4a9';
  403. offBtn.style.background = '#444';
  404. toggleStatus.textContent = 'ON';
  405. toggleStatus.style.color = '#4a9';
  406. togglePanel.style.border = '2px solid #4a9';
  407.  
  408. console.log(`[FLBOT] Dice bot za ${currentSite.host} UKLJUČEN`);
  409. updatePanel();
  410. });
  411. }
  412.  
  413. if (offBtn) {
  414. offBtn.addEventListener('click', () => {
  415. saveDiceBotState(currentSite.host, false);
  416.  
  417. // Ažuriraj UI
  418. offBtn.style.background = '#a94';
  419. onBtn.style.background = '#444';
  420. toggleStatus.textContent = 'OFF';
  421. toggleStatus.style.color = '#a94';
  422. togglePanel.style.border = '2px solid #a94';
  423.  
  424. console.log(`[FLBOT] Dice bot za ${currentSite.host} ISKLJUČEN`);
  425. updatePanel();
  426. });
  427. }
  428.  
  429. return togglePanel;
  430. }
  431.  
  432. function createDicePanel() {
  433. if (dicePanel) return dicePanel;
  434.  
  435. const site = getCurrentSite();
  436. if (!site) return null;
  437.  
  438. const currentBalance = getCurrentBalance();
  439. let stats = loadStats();
  440. let { profit, totalBet, rolls, wins, losses } = stats;
  441.  
  442. dicePanel = document.createElement('div');
  443. dicePanel.id = 'flbotDicePanel';
  444. dicePanel.style.cssText = `
  445. position: fixed;
  446. bottom: 360px;
  447. right: 10px;
  448. background: rgba(17, 17, 17, 0.95);
  449. color: #4a9;
  450. font-family: monospace;
  451. font-size: 12px;
  452. padding: 10px;
  453. border-radius: 8px;
  454. width: 260px;
  455. z-index: 9999998;
  456. box-shadow: 0 0 10px #000;
  457. border: 2px solid #4a9;
  458. `;
  459.  
  460. dicePanel.innerHTML = `
  461. <div style="font-weight: bold; margin-bottom: 6px; text-align: center; color: #4a9;">🎲 DICE BOT - ${site.host}</div>
  462. <div>Balance: <span id="flbot-balance-display">${currentBalance.toFixed(8)}</span></div>
  463. <div>Rolls: <span id="flbot-rolls">${rolls}</span></div>
  464. <div>Wins: <span id="flbot-wins">${wins}</span></div>
  465. <div>Losses: <span id="flbot-losses">${losses}</span></div>
  466. <div>Profit: <span id="flbot-profit">${profit.toFixed(8)}</span></div>
  467. <div>Total Bet: <span id="flbot-total">${totalBet.toFixed(8)}</span></div>
  468. <button id="flbot-reset" style="background:#a94;color:#fff;border:none;padding:5px;margin-top:5px;border-radius:4px;cursor:pointer;width:100%;">Reset Stats</button>
  469. `;
  470.  
  471. document.body.appendChild(dicePanel);
  472. updateDicePanelPosition();
  473.  
  474. return dicePanel;
  475. }
  476.  
  477. function createPanel() {
  478. console.log("[FLBOT] Kreiram glavni panel...");
  479.  
  480. const panel = document.createElement("div");
  481. panel.id = "flbotPanel";
  482. panel.style.cssText = `
  483. position: fixed;
  484. bottom: 10px;
  485. right: 10px;
  486. background: rgba(0,0,0,0.8);
  487. color: #fff;
  488. font-family: Arial, sans-serif;
  489. font-size: 12px;
  490. padding: 10px;
  491. border-radius: 8px;
  492. width: auto;
  493. min-width: 260px;
  494. max-width: 100%;
  495. max-height: none;
  496. overflow-y: visible;
  497. z-index: 9999999;
  498. box-shadow: 0 0 10px #000;
  499. `;
  500.  
  501. panel.innerHTML = `
  502. <div style="font-weight: bold; margin-bottom: 6px; text-align: center;">FLBOT Panel v1.2.3</div>
  503. <div>Tab Status: <span id="flbotFocusStatus" style="color: #4a9;">Active</span></div>
  504. <div>Countdown: <span id="flbotCountdown">${countdown}</span>s</div>
  505. <div>Status: <span id="flbotStatus"ekam...</span></div>
  506. <div>Balance: <span id="flbotBalance">Provjeram...</span></div>
  507. <div style="margin-top: 8px; font-weight: bold;">Sajtovi:</div>
  508. <ul id="flbotSiteList" style="padding-left: 18px; margin: 4px 0 0 0; white-space: nowrap;"></ul>
  509.  
  510. <div id="flbot-step1" style="
  511. position: absolute;
  512. top: 90px;
  513. left: 170px;
  514. color: white;
  515. font-size: 14px;
  516. font-weight: bold;
  517. text-align: center;
  518. line-height: 1.2;
  519. ">
  520. Step 1<br>
  521. <span style="font-size: 20px; color: #4a9;">↓</span>
  522. </div>
  523.  
  524. <button id="flbot-play" disabled style="
  525. margin-top: 10px;
  526. background: gray;
  527. color: white;
  528. border: none;
  529. padding: 6px 50px;
  530. font-size: 14px;
  531. font-weight: bold;
  532. border-radius: 4px;
  533. cursor: not-allowed;
  534. display: block;
  535. margin-left:auto;
  536. margin-right: 0;
  537. ">Auto Play</button>
  538.  
  539. <div id="flbot-Step2" style="
  540. position: absolute;
  541. bottom: 10px;
  542. left: 20%;
  543. transform: translateX(-50%);
  544. color: white;
  545. font-size: 14px;
  546. font-weight: bold;
  547. text-align: center;
  548. line-height: 1.2;
  549. ">
  550. <span style="font-size: 12px; font-weight: bold;">Step 2</span>
  551. <span style="font-size: 20px; margin-left: 5px; color: #4a9;">→</span>
  552. </div>
  553. `;
  554.  
  555. document.body.appendChild(panel);
  556. console.log("[FLBOT] Panel kreiran i dodat na stranicu");
  557.  
  558. if (window.ResizeObserver) {
  559. const resizeObserver = new ResizeObserver(() => {
  560. updateDicePanelPosition();
  561. updateTogglePanelPosition();
  562. });
  563. resizeObserver.observe(panel);
  564. }
  565. }
  566.  
  567. function updatePanel() {
  568. const countdownEl = document.getElementById("flbotCountdown");
  569. if (countdownEl) countdownEl.textContent = countdown;
  570.  
  571. const statusEl = document.getElementById("flbotStatus");
  572. if (statusEl) {
  573. statusEl.textContent = botIsPlaying ? "Bot igra..." : "Čekam...";
  574. statusEl.style.color = botIsPlaying ? "#4a9" : "#fff";
  575. }
  576.  
  577. const focusStatusEl = document.getElementById("flbotFocusStatus");
  578. if (focusStatusEl) {
  579. focusStatusEl.textContent = document.hidden ? "Inactive" : "Active";
  580. focusStatusEl.style.color = document.hidden ? "#a94" : "#4a9";
  581. }
  582.  
  583. const balanceEl = document.getElementById("flbotBalance");
  584. if (balanceEl) {
  585. const currentBalance = getCurrentBalance();
  586. if (currentBalance > 0) {
  587. balanceEl.textContent = currentBalance.toFixed(8);
  588. balanceEl.style.color = "#4a9";
  589. } else {
  590. balanceEl.textContent = "0 ili N/A";
  591. balanceEl.style.color = "#a94";
  592. }
  593. }
  594.  
  595. const siteListEl = document.getElementById("flbotSiteList");
  596. if (!siteListEl) return;
  597.  
  598. siteListEl.innerHTML = "";
  599. const currentSite = getCurrentSite();
  600.  
  601. // Dodajemo sve postojeće sajtove
  602. sites.forEach((site, i) => {
  603. const li = document.createElement("li");
  604. li.style.cssText = `
  605. cursor: default;
  606. padding: 2px 6px;
  607. border-radius: 4px;
  608. display: flex;
  609. align-items: center;
  610. justify-content: space-between;
  611. `;
  612. li.title = site.mainUrl || site.aff;
  613.  
  614. const siteText = document.createElement("span");
  615. const diceBotStatus = site.host === "freebitco.in" ? "" : (isDiceBotEnabled(site.host) ? " ON" : " OFF");
  616. const statusColor = site.host === "freebitco.in" ? "" : (isDiceBotEnabled(site.host) ? "color: #4a9;" : "color: #a94;");
  617. siteText.innerHTML = `${i + 1}. ${site.host}<span style="${statusColor} font-weight: bold;">${diceBotStatus}</span>`;
  618.  
  619. const regBtn = document.createElement("button");
  620. regBtn.textContent = "REG";
  621. regBtn.style.cssText = `
  622. background: #333;
  623. color: #fff;
  624. border: 1px solid #555;
  625. padding: 2px 8px;
  626. border-radius: 4px;
  627. cursor: pointer;
  628. font-size: 10px;
  629. margin-left: 5px;
  630. min-width: 105px;
  631. height: 20px;
  632. transition: transform 0.2s ease;
  633. `;
  634.  
  635. regBtn.onmouseover = () => regBtn.style.transform = "scale(1.1)";
  636. regBtn.onmouseout = () => regBtn.style.transform = "scale(1)";
  637. regBtn.onclick = () => location.href = site.aff;
  638.  
  639. li.appendChild(siteText);
  640. li.appendChild(regBtn);
  641.  
  642. if (site === currentSite) {
  643. li.style.backgroundColor = "#4a9";
  644. li.style.fontWeight = "bold";
  645. li.style.color = "#fff";
  646. } else {
  647. li.style.backgroundColor = "transparent";
  648. li.style.color = "#ccc";
  649. }
  650.  
  651. siteListEl.appendChild(li);
  652. });
  653.  
  654. // Dodajemo "soon" sajt na kraju liste
  655. const soonLi = document.createElement("li");
  656. soonLi.style.cssText = `
  657. cursor: default;
  658. padding: 2px 6px;
  659. border-radius: 4px;
  660. display: flex;
  661. align-items: center;
  662. justify-content: space-between;
  663. color: #ccc;
  664. `;
  665.  
  666. const soonText = document.createElement("span");
  667. soonText.innerHTML = `17. soon`;
  668.  
  669. const disabledRegBtn = document.createElement("button");
  670. disabledRegBtn.textContent = "REG";
  671. disabledRegBtn.style.cssText = `
  672. background: #222;
  673. color: #666;
  674. border: 1px solid #333;
  675. padding: 2px 8px;
  676. border-radius: 4px;
  677. font-size: 10px;
  678. margin-left: 5px;
  679. min-width: 105px;
  680. height: 20px;
  681. cursor: not-allowed;
  682. `;
  683. disabledRegBtn.disabled = true;
  684.  
  685. soonLi.appendChild(soonText);
  686. soonLi.appendChild(disabledRegBtn);
  687. siteListEl.appendChild(soonLi);
  688.  
  689. updateDicePanelPosition();
  690. updateTogglePanelPosition();
  691. }
  692.  
  693. function startCountdown() {
  694. console.log("[FLBOT] Pokrećem countdown timer...");
  695.  
  696. const timer = setInterval(() => {
  697. countdown--;
  698. updatePanel();
  699.  
  700. if (countdown <= 10 && !wentToDice) {
  701. const site = getCurrentSite();
  702. if (site) {
  703. if (site.host === "freebitco.in") {
  704. wentToDice = true;
  705. const next = nextSite();
  706. location.href = next.mainUrl || next.aff;
  707. clearInterval(timer);
  708. } else if (!location.href.includes("/dice") && !location.href.includes("/games/dice")) {
  709. // Proverava da li je dice bot uključen pre prelaska na dice stranicu
  710. if (isDiceBotEnabled(site.host)) {
  711. wentToDice = true;
  712. console.log(`[FLBOT] Idem na dice stranicu: ${site.dice} (dice bot ON)`);
  713. location.href = site.dice;
  714. clearInterval(timer);
  715. } else {
  716. console.log(`[FLBOT] Dice bot je OFF za ${site.host}, prelazim na sledeći sajt`);
  717. wentToDice = true;
  718. const next = nextSite();
  719. location.href = next.mainUrl || next.aff;
  720. clearInterval(timer);
  721. }
  722. }
  723. }
  724. }
  725.  
  726. if (countdown <= 0) {
  727. if (diceBotActive) {
  728. console.log("[FLBOT] ⚠️ Dice bot je aktivan - neću prebaciti na sljedeći sajt zbog timeout-a");
  729. return;
  730. }
  731.  
  732. const next = nextSite();
  733. location.href = next.mainUrl || next.aff;
  734. clearInterval(timer);
  735. }
  736. }, 1000);
  737. }
  738.  
  739. function startDiceTimeout() {
  740. console.log('[FLBOT] Pokrećem 10-sekundni timeout za dice...');
  741. setTimeout(() => {
  742. if (!botIsPlaying) {
  743. console.log('[FLBOT] ⏰ Timeout - bot ne igra, prelazim na sledeći sajt');
  744. const next = nextSite();
  745. location.href = next.mainUrl || next.aff;
  746. } else {
  747. console.log('[FLBOT] Bot igra, ne prekidam...');
  748. }
  749. }, 10000);
  750. }
  751.  
  752. const TURNSTILE_RESPONSE_SELECTOR = 'input[name="cf-turnstile-response"]';
  753. const CLAIM_BUTTON_TEXT = 'claim';
  754. let isClaimClicked = false;
  755.  
  756. function isVerificationComplete() {
  757. const input = document.querySelector(TURNSTILE_RESPONSE_SELECTOR);
  758. return input && input.value.trim() !== '';
  759. }
  760.  
  761. function clickClaimButton() {
  762. if (isClaimClicked) return;
  763. const buttons = Array.from(document.querySelectorAll('button, input[type="submit"], input[type="button"]'));
  764. for (const btn of buttons) {
  765. const text = (btn.textContent || btn.value || "").trim().toLowerCase();
  766. if (text === CLAIM_BUTTON_TEXT) {
  767. console.log("[FLBOT] Verifikacija ok, klik na Claim dugme");
  768. btn.click();
  769. isClaimClicked = true;
  770. break;
  771. }
  772. }
  773. }
  774.  
  775. function checkClaimLoop() {
  776. if (isVerificationComplete()) {
  777. clickClaimButton();
  778. } else {
  779. console.log("[FLBOT] Čekam turnstile verifikaciju...");
  780. }
  781. }
  782.  
  783. function waitForEl(selector, callback, maxAttempts = 20) {
  784. let attempts = 0;
  785. const checkElement = () => {
  786. const el = document.querySelector(selector);
  787. if (el) return callback(el);
  788. attempts++;
  789. if (attempts < maxAttempts) setTimeout(checkElement, 500);
  790. else console.warn(`[FLBOT] Element ${selector} nije pronađen nakon ${maxAttempts} pokušaja`);
  791. };
  792. checkElement();
  793. }
  794.  
  795. function getIframeDocument(iframe) {
  796. try {
  797. return iframe.contentDocument || iframe.contentWindow.document;
  798. } catch (e) {
  799. console.error("[FLBOT] Greška pri pristupu iframe dokumentu:", e);
  800. return null;
  801. }
  802. }
  803.  
  804. function getDiceElements() {
  805. const currentSite = getCurrentSite();
  806. if (!currentSite) return null;
  807.  
  808. if (currentSite.usesIframe) {
  809. const iframe = document.querySelector('iframe');
  810. if (!iframe) return null;
  811.  
  812. const iframeDoc = getIframeDocument(iframe);
  813. if (!iframeDoc) return null;
  814.  
  815. return {
  816. betInput: iframeDoc.querySelector('#bet_amount'),
  817. rollBtn: iframeDoc.querySelector('#roll_dice'),
  818. resultSpan: iframeDoc.querySelector('.result_maker span')
  819. };
  820. } else {
  821. return {
  822. betInput: document.querySelector('#bet_amount'),
  823. rollBtn: document.querySelector('#roll_dice'),
  824. resultSpan: document.querySelector('.result_maker span')
  825. };
  826. }
  827. }
  828.  
  829. function startDiceBot() {
  830. console.log('[FLBOT] Pokrećem dice bot...');
  831.  
  832. const site = getCurrentSite();
  833. if (!site) return;
  834.  
  835. // Proverava da li je dice bot uključen za trenutni sajt
  836. if (!isDiceBotEnabled(site.host)) {
  837. console.log(`[FLBOT] ⚠️ Dice bot je isključen za ${site.host}, prelazim na sledeći sajt`);
  838. setTimeout(() => {
  839. const next = nextSite();
  840. location.href = next.mainUrl || next.aff;
  841. }, 3000);
  842. return;
  843. }
  844.  
  845. const currentBalance = getCurrentBalance();
  846. const requiredBet = site.minBet;
  847.  
  848. if (!isBalanceSufficient(currentBalance, requiredBet)) {
  849. console.log(`[FLBOT] ⚠️ Nedovoljan balans! Trenutni: ${currentBalance}, Potreban: ${requiredBet * 10}`);
  850. switchToNextSiteDueToBalance();
  851. return;
  852. }
  853.  
  854. botIsPlaying = true;
  855. diceBotActive = true;
  856. updatePanel();
  857.  
  858. baseBet = site.minBet;
  859. currentBet = baseBet;
  860. winChance = 49.5;
  861. high = true;
  862. autoMode = true;
  863.  
  864. let stats = loadStats();
  865. let { profit, totalBet, rolls, wins, losses } = stats;
  866.  
  867. createDicePanel();
  868.  
  869. const resetBtn = document.getElementById('flbot-reset');
  870. if (resetBtn) {
  871. resetBtn.addEventListener('click', () => {
  872. resetStats();
  873. profit = 0;
  874. totalBet = 0;
  875. rolls = 0;
  876. wins = 0;
  877. losses = 0;
  878. updateDisplay();
  879. console.log('[FLBOT] Statistike resetovane');
  880. });
  881. }
  882.  
  883. const updateDisplay = () => {
  884. const currentStats = loadStats();
  885. const rollsEl = document.getElementById('flbot-rolls');
  886. const winsEl = document.getElementById('flbot-wins');
  887. const lossesEl = document.getElementById('flbot-losses');
  888. const profitEl = document.getElementById('flbot-profit');
  889. const totalEl = document.getElementById('flbot-total');
  890. const balanceDisplayEl = document.getElementById('flbot-balance-display');
  891.  
  892. if (rollsEl) rollsEl.textContent = currentStats.rolls;
  893. if (winsEl) winsEl.textContent = currentStats.wins;
  894. if (lossesEl) lossesEl.textContent = currentStats.losses;
  895. if (profitEl) profitEl.textContent = currentStats.profit.toFixed(8);
  896. if (totalEl) totalEl.textContent = currentStats.totalBet.toFixed(8);
  897.  
  898. const newBalance = getCurrentBalance();
  899. if (balanceDisplayEl) {
  900. balanceDisplayEl.textContent = newBalance.toFixed(8);
  901. }
  902. };
  903.  
  904. const play = () => {
  905. if (!autoMode) return;
  906.  
  907. // Proverava ponovo da li je dice bot još uvek uključen
  908. if (!isDiceBotEnabled(site.host)) {
  909. console.log(`[FLBOT] ⚠️ Dice bot je isključen tokom igre za ${site.host}, prekidam`);
  910. botIsPlaying = false;
  911. diceBotActive = false;
  912. autoMode = false;
  913. setTimeout(() => {
  914. const next = nextSite();
  915. location.href = next.mainUrl || next.aff;
  916. }, 3000);
  917. return;
  918. }
  919.  
  920. const diceElements = getDiceElements();
  921. if (!diceElements || !diceElements.betInput || !diceElements.rollBtn || !diceElements.resultSpan) {
  922. console.warn('[FLBOT] Nedostaju elementi za dice igru');
  923. setTimeout(play, 5000);
  924. return;
  925. }
  926.  
  927. const currentBalance = getCurrentBalance();
  928. if (!isBalanceSufficient(currentBalance, currentBet)) {
  929. console.log(`[FLBOT] ⚠️ Nedovoljan balans za bet ${currentBet}! Trenutni balans: ${currentBalance}`);
  930. botIsPlaying = false;
  931. diceBotActive = false;
  932. setTimeout(() => {
  933. const next = nextSite();
  934. location.href = next.mainUrl || next.aff;
  935. }, 10000);
  936. return;
  937. }
  938.  
  939. try {
  940. diceElements.betInput.value = currentBet.toFixed(8);
  941. } catch (e) {
  942. console.error('[FLBOT] Greška pri postavljanju vrednosti bet-a:', e);
  943. setTimeout(play, 5000);
  944. return;
  945. }
  946.  
  947. console.log("[FLBOT] ⏳ Čekam 10 sekundi prije klika na ROLL DICE...");
  948. setTimeout(() => {
  949. const balanceBeforeRoll = getCurrentBalance();
  950. if (!isBalanceSufficient(balanceBeforeRoll, currentBet)) {
  951. console.log(`[FLBOT] ⚠️ Balans se promijenio! Čekam 10s...`);
  952. setTimeout(play, 10000);
  953. return;
  954. }
  955.  
  956. try {
  957. diceElements.rollBtn.click();
  958. console.log("[FLBOT] 🎲 Kliknuo ROLL DICE");
  959.  
  960. setTimeout(() => {
  961. try {
  962. const resultText = diceElements.resultSpan.textContent;
  963. const result = parseFloat(resultText);
  964. if (isNaN(result)) {
  965. console.warn('[FLBOT] Nevalidan rezultat:', resultText);
  966. setTimeout(play, 5000);
  967. return;
  968. }
  969.  
  970. totalBet += currentBet;
  971.  
  972. const isWin = (high && result > 100 - winChance) || (!high && result < winChance);
  973. if (isWin) {
  974. wins++;
  975. profit += currentBet * (100 / winChance - 1);
  976. currentBet = baseBet;
  977.  
  978. rolls++;
  979. const newStats = { profit, totalBet, rolls, wins, losses };
  980. const mergedStats = mergeStats(loadStats(), newStats);
  981. saveStats(mergedStats);
  982. updateDisplay();
  983.  
  984. console.log('[FLBOT] ✅ WIN - Čekam 10s i rotiram sajt');
  985. botIsPlaying = false;
  986. diceBotActive = false;
  987. autoMode = false;
  988.  
  989. setTimeout(() => {
  990. const next = nextSite();
  991. location.href = next.mainUrl || next.aff;
  992. }, 10000);
  993. return;
  994. } else {
  995. losses++;
  996. currentBet *= 2;
  997.  
  998. const nextBalance = getCurrentBalance();
  999. if (!isBalanceSufficient(nextBalance, currentBet)) {
  1000. console.log(`[FLBOT] ⚠️ Sljedeći bet prevelik. Čekam 10s i rotiram`);
  1001. const newStats = { profit, totalBet, rolls, wins, losses };
  1002. const mergedStats = mergeStats(loadStats(), newStats);
  1003. saveStats(mergedStats);
  1004. botIsPlaying = false;
  1005. diceBotActive = false;
  1006. autoMode = false;
  1007.  
  1008. setTimeout(() => {
  1009. const next = nextSite();
  1010. location.href = next.mainUrl || next.aff;
  1011. }, 10000);
  1012. return;
  1013. }
  1014. }
  1015.  
  1016. rolls++;
  1017. const newStats = { profit, totalBet, rolls, wins, losses };
  1018. const mergedStats = mergeStats(loadStats(), newStats);
  1019. saveStats(mergedStats);
  1020. updateDisplay();
  1021.  
  1022. if (autoMode) setTimeout(play, 10000);
  1023. } catch (e) {
  1024. console.error('[FLBOT] Greška pri obradi rezultata:', e);
  1025. setTimeout(play, 10000);
  1026. }
  1027. }, 1500);
  1028. } catch (e) {
  1029. console.error('[FLBOT] Greška pri kliku na roll dugme:', e);
  1030. setTimeout(play, 10000);
  1031. }
  1032. }, 10000);
  1033. };
  1034.  
  1035. play();
  1036. }
  1037.  
  1038. function handleFreeBitcoin() {
  1039. function clickFreeBtcAfterDelay() {
  1040. const freePlayBtn = document.getElementById("free_play_form_button");
  1041. if (freePlayBtn && !freePlayBtn.disabled) {
  1042. console.log("[FLBOT] Čekam 30 sekundi pre klika FREE BTC dugmeta na freebitco.in");
  1043. setTimeout(() => {
  1044. console.log("[FLBOT] Klikćem FREE BTC dugme na freebitco.in");
  1045. freePlayBtn.click();
  1046. }, 30000);
  1047. } else {
  1048. setTimeout(clickFreeBtcAfterDelay, 1000);
  1049. }
  1050. }
  1051. clickFreeBtcAfterDelay();
  1052. }
  1053.  
  1054. // Glavna inicijalizacija
  1055. try {
  1056. console.log("[FLBOT] Pokrećem glavnu inicijalizaciju...");
  1057.  
  1058. // Kreiraj panel
  1059. createPanel();
  1060.  
  1061. const currentIndex = getCurrentIndex();
  1062. if (currentIndex !== -1) {
  1063. index = currentIndex;
  1064. localStorage.setItem("flbot_index", index);
  1065. }
  1066.  
  1067. const currentSite = getCurrentSite();
  1068. console.log("[FLBOT] Trenutna lokacija:", location.href);
  1069.  
  1070. // For freetrump.in, always use the faucet URL as main page
  1071. if (currentSite && currentSite.host === "freetrump.in" && !location.href.includes("/faucet") && !location.href.includes("/games/dice")) {
  1072. console.log("[FLBOT] Redirecting freetrump.in to faucet page");
  1073. location.href = currentSite.mainUrl;
  1074. return;
  1075. }
  1076.  
  1077. // Kreiraj toggle panel
  1078. createTogglePanel();
  1079.  
  1080. if (currentSite && (location.href.includes("/dice") || location.href.includes("/games/dice"))) {
  1081. console.log("[FLBOT] Detektovana dice stranica");
  1082.  
  1083. // Proverava da li je dice bot uključen pre pokretanja
  1084. if (!isDiceBotEnabled(currentSite.host)) {
  1085. console.log(`[FLBOT] ⚠️ Dice bot je isključen za ${currentSite.host}, prelazim na sledeći sajt`);
  1086. setTimeout(() => {
  1087. const next = nextSite();
  1088. location.href = next.mainUrl || next.aff;
  1089. }, 3000);
  1090. return;
  1091. }
  1092.  
  1093. startDiceTimeout();
  1094.  
  1095. if (currentSite.usesIframe) {
  1096. console.log('[FLBOT] Detektovana dice stranica sa iframe-om');
  1097. const waitForIframe = setInterval(() => {
  1098. const iframe = document.querySelector("iframe");
  1099. if (iframe) {
  1100. clearInterval(waitForIframe);
  1101. console.log("[FLBOT] Iframe pronađen, pokrećem dice bot");
  1102. setTimeout(() => {
  1103. startDiceBot();
  1104. }, 3000);
  1105. }
  1106. }, 1000);
  1107. } else {
  1108. console.log('[FLBOT] Detektovana dice stranica bez iframe-a');
  1109. waitForEl("#bet_amount", () => {
  1110. waitForEl("#roll_dice", () => {
  1111. waitForEl(".result_maker span", startDiceBot);
  1112. });
  1113. });
  1114. }
  1115. } else {
  1116. console.log("[FLBOT] Pokrećem countdown na glavnoj stranici");
  1117. startCountdown();
  1118. setInterval(checkClaimLoop, 3000);
  1119.  
  1120. if (location.hostname.includes("freebitco.in")) {
  1121. handleFreeBitcoin();
  1122. }
  1123. }
  1124.  
  1125. updatePanel();
  1126.  
  1127. setInterval(updatePanel, 5000);
  1128.  
  1129. setInterval(() => {
  1130. if (document.hidden) {
  1131. window.focus();
  1132. }
  1133. }, 5000);
  1134.  
  1135. console.log("[FLBOT] ✅ Skripta uspešno pokrenuta!");
  1136.  
  1137. } catch (error) {
  1138. console.error("[FLBOT] ❌ Greška pri pokretanju skripte:", error);
  1139. }
  1140.  
  1141. })();