Advertisement
CrimsonNoble

Part 2 - Interactive Bot

Feb 26th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /////////////////////////////////////////
  2. //Simple Bot Example 2                 //
  3. /////////////////////////////////////////
  4. //A slightly more advanced version with very few gui alterations.
  5.  
  6. //Base Bet Settings//                  
  7. basebet       =1;   // Amount in satoshi
  8. basecondition ='<'; // '<' for under '>' for over
  9. winchance     =0.01;// 49.5 has 2x payout...if your rolling under,
  10. //Other Settings////
  11. win_increment  =0;    //Increase bet by this amount(in satoshi) when you win.
  12. win_multiplier =1;    //Multiply bet by this amount when you win.(1 is no change)
  13. win_reset      =false;//If true when you win bet amount goes back to base bet.
  14. loss_increment =0;    //Increase bet by this amount(in satoshi) when you lose.
  15. loss_multiplier=1;    //Multiply bet by this amount when you lose.(1 is no change)
  16. loss_reset     =false;//If true when you lose bet amount goes back to base bet.
  17. min_wager      =0;    //Bet will never go lower then this.(satoshi)
  18. max_wager      =10000;//Bet will never go higher then this.(satoshi)
  19. roll_remaining =true; //When true if your balance is too low to make a bet then you bet what you have left.
  20. betspeed       =500;  // 1000 = 1 second, this is still limited by server speed.
  21. //Assign Base Values////
  22. truebet=basebet;truecondition=basecondition;pause=false;balance=0;
  23. ////////////////////////
  24. setInterval(function (){
  25.   if(pause===false){  
  26.    $('.btn__text.select div').html("<button style='background-color:green' onclick='pause=!pause;'>Pause Bot</button><br>"+"<button onclick='truebet++;')>+</button><button onclick='truebet--;')>-</button>Bet:"+Math.floor(truebet)+"<br>"+"Balance:"+(balance / 100000000).toFixed(8));                    
  27.    if(truebet>max_wager){truebet=max_wager;}
  28.    if(truebet<min_wager){truebet=min_wager;}
  29.    if(roll_remaining===true && balance<truebet && balance>1){
  30.       betData = {
  31.           amount: Math.floor(balance),
  32.           condition: truecondition,
  33.           target: winchance
  34.       }  
  35.     }else{    
  36.       betData = {
  37.           amount: Math.floor(truebet),
  38.           condition: truecondition,
  39.           target: winchance
  40.       }
  41.     }
  42.     $.ajax({
  43.                 url: 'https://api.primedice.com/api/bet?access_token=' + localStorage.token,
  44.                 type: 'POST',
  45.                 data: betData,
  46.                 datatype: 'json',
  47.                 async: true,
  48.                 success: function (data, textStatus, jqXHR) {
  49.                   balance=data.user.balance-1;
  50.                   if(data.bet.win===true){        //Bet Won://
  51.                         truebet*=win_multiplier;
  52.                         truebet+=win_increment;
  53.                         if(win_reset===true){truebet=basebet;}  
  54.                   }else{                          //Bet Lost://
  55.                         truebet*=loss_multiplier;
  56.                         truebet+=loss_increment;
  57.                         if(loss_reset===true){truebet=basebet;}
  58.                   }                    
  59.                 }
  60.     });    
  61.   }else{
  62.     $('.btn__text.select div').html("<button style='background-color:red' onclick='pause=!pause;'>Start Bot</button><br>"+"<button onclick='truebet++;')>+</button><button onclick='truebet--;')>-</button>Bet:"+Math.floor(truebet)+"<br>"+"Balance:"+(balance / 100000000).toFixed(8));                    
  63.   }    
  64. }, betspeed);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement