Advertisement
TheSTRIG

Dota 2 RNG Simulator v0.3

Nov 2nd, 2014
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.76 KB | None | 0 0
  1. import java.util.Random;
  2. import java.util.Scanner;
  3.  
  4. public class PRD {
  5.     public static int rngCounter()
  6.     {
  7.         int a;
  8.        
  9.         Random rand = new Random();
  10.         a = rand.nextInt(99);
  11.         return a;
  12.     }
  13.    
  14.     public static int chance(){
  15.         int chance = 0;
  16.         Scanner sc = new Scanner(System.in);
  17.         System.out.println("====================================");
  18.         System.out.println("Welcome to Dota 2 RNG Simulator v0.3");
  19.         System.out.println("====================================");
  20.         System.out.println();
  21.         System.out.println("Available skills: ");
  22.         System.out.println("-----------------------------------------------------------------");
  23.         System.out.println("1. Axe - Counter Helix (20%)");
  24.         System.out.println("2. Chaos Knight - Chaos Strike (10%)");
  25.         System.out.println("3. Lycan - Shapeshift Critical (30%)");
  26.         System.out.println("4. Sniper - Headshot (40%)");
  27.         System.out.println("5. Wraith King - Mortal Strike (15%)");
  28.         System.out.println("6. Phantom Assassin - Coup de Grace (15%)");
  29.         System.out.println("7. Troll Warlord - Berserseker's Rage Bash (10%)");
  30.         System.out.println("-----------------------------------------------------------------");
  31.         System.out.println();
  32.         System.out.print("Pick a skill number: ");
  33.         int skill = sc.nextInt();
  34.         if (skill == 1){
  35.             chance = 20;
  36.         } else if (skill == 2 || skill == 7){
  37.             chance = 10;
  38.         } else if (skill == 3){
  39.             chance = 30;
  40.         } else if (skill == 4){
  41.             chance = 40;
  42.         } else if (skill == 5 || skill == 6){
  43.             chance = 15;
  44.         }
  45.         return chance;
  46.     }
  47.    
  48.     public static void PRD()
  49.     {
  50.         Scanner in = new Scanner(System.in);
  51.         int rngPlease = chance();
  52.         String rngg;
  53.         int[] noprocArray;
  54.         noprocArray = new int[100];
  55.        
  56.         Integer p;
  57.         int tryCounter = 0;
  58.        
  59.         boolean randomLagi = true;
  60.         boolean seratus = true;
  61.        
  62.         while(tryCounter != 100)
  63.         {
  64.             p = rngCounter();
  65.             if(p != null)
  66.             {
  67.                 while(randomLagi)
  68.                 {
  69.                     p = rngCounter();
  70.                     for(int i = 0; i < noprocArray.length; i++)
  71.                     {
  72.                         if(tryCounter == 0)
  73.                         {
  74.                             break;
  75.                         }
  76.                         else if(p == noprocArray[i])
  77.                         {
  78.                             randomLagi = true;
  79.                             break;
  80.                         }
  81.                         else
  82.                         {
  83.                             noprocArray[i] = p;
  84.                             randomLagi = false;
  85.                         }
  86.                     }
  87.                     break;
  88.                 }
  89.                 if(p < rngPlease)
  90.                 {
  91.                     System.out.printf("Angka Random: %d\n", p);
  92.                     System.out.println("proc");
  93.                     noprocArray = new int[100];
  94.                     //tryCounter++; siapa tau
  95.                     System.out.println("RNGG!");
  96.                     System.exit(0);
  97.                 }
  98.                 else
  99.                 {
  100.                     System.out.printf("Angka Random: %d\n", p);
  101.                     System.out.println("noproc");
  102.                     tryCounter++;
  103.                     System.out.println("Scrubz, press Enter key to try again...");
  104.                     rngg = in.nextLine();
  105.                 }
  106.             }
  107.         }
  108.     }
  109.    
  110.     public static void main(String[] args){
  111.         PRD();
  112.     }
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement