Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name OGUsers Coin Flipper
- // @namespace https://ogusers.com
- // @version 1.1
- // @description flippa da wriss
- // @author https://github.com/tnadzieja
- // @match https://ogusers.com/newpoints.php?action=flipcoin
- // @grant none
- // ==/UserScript==
- //ctrl+f my_post_key =
- var postkey = "a0fd6386deaba999ab7314c6d6f4becb";
- const delta = document.createElement('p');
- const divider = document.createElement('div');
- var ibet = 5, bet = ibet, loss = 0, ls = 0, lsmax = 0, wins = 0, ws = 0, wsmax = 0, games = 0, wr = 0, lr = 0;
- var bust = 0, choice = "HEADS", deltaw = 0, busts = 0, eTime;
- var bBal = document.getElementsByClassName("flipcoins-credits")[0].innerHTML;
- var sBal = parseInt(bBal.replace(/,/g, '')), balance = sBal;
- var sTime = new Date();
- (function() {
- 'use strict';
- divider.className = 'col_row delta';
- divider.style["margin-right"] = "0px";
- delta.style["font-weight"] = "bold";
- delta.className = 'elapsed';
- document.getElementsByClassName("flipcoin-rules")[0].append(divider);
- document.getElementsByClassName("col_row delta")[0].append(delta);
- startBet();
- })();
- //primary
- function startBet() {
- flipCoin();
- var def = $.Deferred();
- function flipCoin() {
- if(balance > 1000){
- deltaw = balance - sBal;
- wr = wins/games*100;
- lr = loss/games*100;
- eTime = (new Date() - sTime ) / 1000;
- delta.innerHTML = deltaw.toString() + " || Busts: " + busts.toString() + " || Time Elapsed: " + Math.round(eTime) + " || Wins: " + wins.toString() + " || Losses: " + loss.toString() + " || W/L Ratio: " + Math.round(wr) + ":" + Math.round(lr) + " || Loss Streak: " + lsmax.toString() + " || Win Streak: " + wsmax.toString();
- if(balance < sBal){
- delta.style["color"] = "red";
- } else {
- delta.style["color"] = "green";
- }
- if(ls > lsmax) {
- lsmax = ls;
- }
- if(ws > wsmax) {
- wsmax = ws;
- }
- setTimeout(function(){
- $.ajax({
- url: "https://ogusers.com/newpoints.php?action=flipcoin&do=bet&key=" + postkey + "&type=amount&bet=" + bet + "&choice=" + choice,
- type: 'GET',
- dataType: 'json', // added data type
- success: function(res) {
- games++;
- balance = res.points;
- balance = parseInt(balance.replace(/,/g, ''));
- if(res.winchoice != choice) {
- bet = bet*2;
- bust++;
- ls++;
- ws = 0;
- if (bust == 4){
- bust = 0;
- if(choice == "TAILS") {
- choice = "HEADS";
- } else {
- choice = "TAILS";
- }
- }
- console.log("loss");
- loss++;
- } else
- {
- bet = ibet;
- console.log(balance);
- wins++;
- bust = 0;
- ls = 0;
- ws++;
- }
- document.getElementsByClassName("textbox")[0].value = bet;
- if(bet >= 350) {
- bet = ibet;
- busts++;
- console.log("Base bet reset");
- if(choice == "TAILS") {
- choice = "HEADS";
- } else {
- choice = "TAILS";
- }
- }
- }
- });
- def.resolve();
- flipCoin();
- }, 1201);
- } else {
- delta.innerHTML = "Balance under 1000."
- }
- }
- return def.promise();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement