Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Eyeke LamboSquad
- // @namespace anonDeveloper
- // @description This script will automagically blah blah blah
- // @include https://app.cryptoblades.io/*
- // ==/UserScript==
- var type = [".int",".str",".dex",".pwr",".cha"]
- var url = new URL(window.location.href);
- var oracle = 10333333333333333;
- var fight = 0;
- function winRate(){
- var m, hpow, epow, wele, hele, weles, rollhero, rollenemy, enemyele;
- var wbonus = 0;
- var wpow = 1;
- var trait = 1;
- for(k = 0; k < document.querySelector(".bonus-power").children.length; k++){
- var bonus = document.querySelector(".bonus-power").children[k].innerText;
- bonus = parseInt(bonus.substring(0, bonus.length-3));
- if(k == 0){wbonus = wbonus + (bonus * 15);}
- else if(k == 1){wbonus = wbonus + (bonus * 30);}
- else if(k == 2){wbonus = wbonus + (bonus * 60);}
- }
- if(url == "https://app.cryptoblades.io/#/combat" && document.querySelector("#gtag-link-others") != null){
- weles = document.querySelector(".trait").firstChild.className.trim();
- hele = document.querySelector(".name.bold.character-name").lastChild.classList[0].trim();
- hpow = document.querySelector(".subtext.subtext-stats").children[3].innerText.trim();
- hpow = parseInt(hpow.replace(',','').replace(/\s/g, ''));
- for (j = 0; j < type.length; j++){
- var divs = document.querySelectorAll(type[j]), i
- for (i = 0; i < divs.length; ++i) {
- var stat = divs[i].innerText.trim();
- var ele = stat.substring(0, 3);
- stat = parseInt(stat.substring(stat.length - 3, stat.length));
- if(ele = "CHA"){wele = "lightning-icon";}
- else if(ele = "INT"){wele = "water-icon";}
- else if(ele = "DEX"){wele = "earth-icon";}
- else if(ele = "STR"){wele = "fire-icon";}
- if(hele == wele){
- wpow = wpow + stat * 0.002675;
- }
- else if(ele == "PWR"){
- wpow = wpow + stat * 0.002575;
- }
- else{
- wpow = wpow + stat * 0.0025;
- }
- }
- }
- if(hele == weles){
- trait += 0.075;
- }
- var enemy = document.querySelectorAll(".enemy-character")
- for (i = 0; i < enemy.length; ++i) {
- var traitbonus = 0;
- enemyele = enemy[i].children[0].firstElementChild.className.trim();
- epow = enemy[i].children[2].innerText.trim();
- epow = parseInt(epow.substring(0, epow.length - 6));
- if(hele == "lightning-icon" && enemyele == "water-icon"){traitbonus = 0.075;}
- else if(hele == "water-icon" && enemyele == "fire-icon"){traitbonus = 0.075;}
- else if(hele == "fire-icon" && enemyele == "earth-icon"){traitbonus = 0.075;}
- else if(hele == "earth-icon" && enemyele == "lightning-icon"){traitbonus = 0.075;}
- else if(hele == "lightning-icon" && enemyele == "earth-icon"){traitbonus = -0.075;}
- else if(hele == "water-icon" && enemyele == "lightning-icon"){traitbonus = -0.075;}
- else if(hele == "fire-icon" && enemyele == "water-icon"){traitbonus = -0.075;}
- else if(hele == "earth-icon" && enemyele == "fire-icon"){traitbonus = -0.075;}
- function roll(min, max) {
- return min = Math.ceil(min),
- max = Math.floor(max),
- Math.floor(Math.random() * (max - min + 1)) + min
- }
- var basedmg = hpow * wpow + wbonus;
- var minhero = Math.round(basedmg * 0.9 * (trait + traitbonus));
- var maxhero = Math.round(basedmg * 1.1 * (trait + traitbonus));
- rollenemy = epow;
- var usd = 1000000000000000000 / oracle;
- var reward = ((0.0539 * 4.3) / usd) + ((0.08 * 4.3) / usd) * (Math.sqrt(epow/1000));
- var minenemy = Math.round(rollenemy * 0.9);
- var maxenemy = Math.round(rollenemy * 1.1);
- var j = 0;
- for (let t = 0; t < 500; t++){
- rollhero = roll(basedmg * 0.9, basedmg * 1.1) * (trait + traitbonus)
- rollenemy = roll(minenemy, maxenemy);
- if(rollhero >= rollenemy){
- j++;
- }
- }
- console.log(minhero + " & " + maxhero)
- // console.log(basedmg)
- var winrate = (j / 500 * 100).toFixed(2);
- enemy[i].parentElement.children[1].innerText = "Winrate : " + winrate + "%";
- enemy[i].parentElement.children[2].children[0].innerText = "MinHero: " + minhero + " MaxEnemy: " + maxenemy;
- // div.innerText = "Hero roll : " + minhero + " - " + maxhero;
- // div2.innerText = "Enemy roll : " + minenemy + " - " + maxenemy;
- }
- if(document.querySelector(".roll") != null && fight == 0){
- playSound();
- fight = 1;
- }
- else if(document.querySelector(".roll") == null && fight == 1){
- fight = 0;
- }
- }
- }
- var playSound = (function beep() {
- var snd = new Audio("https://media.geeksforgeeks.org/wp-content/uploads/20190531135120/beep.mp3");
- return function() {
- snd.play();
- }
- })();
- var timer = setInterval(winRate, 5000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement