Friday, January 10, 2025
spot_img

Making an AFK Calculator for Anime Fighters Simulator – Roblox Sport


Been enjoying Anime Fighers Simulator rather a lot currently and needed to make a calculator to work out the associated fee for in a single day afk opening.

That is what I’ve made 

 

The Sport “Anime Fighters Simulator” is a roblox sport just like a clicker sport like cookie clicker however based mostly on Anime and has some further playability as it’s not purely based mostly on clicking. I’ve performed this sport for over 6000 hours thus far and the competative streak in me has me enjoying far more than I ought to. One of many factor that I noticed individuals asking regularily in streams was how a lot wouldn’t it price to AFK open in world x. This seemed like a enjoyable factor to work on so I began making it as an online web page utilizing jquery and css bootstrap.

 

The very first thing I did was create all of the inputs wanted to work out what number of stars(fighters) you’ll be able to open. This consists of the quantity of stars you’ll be able to open directly, the sport passes you personal and the sport badges you’ve gotten for a world. Since completely different gamers can open completely different quantity this must be editable.

 

Subsequent I wanted to have the ability to set how a lot it prices to open so I added the inputs for prices. As with most clicker kind video games the quantity go up exponentially and are denoted by characters corresponding to B for billion and Q for quadrillion. To deal with this I created an array with all of the denoted characters

modLetters = " KMBTQEZYXWVU"  // modifiers for forex

With the inputs set for teh stars and the prices i wanted a approach for customers to set the world they wish to open. I then created the next desk with every world and their prices for stars:

World Title Star Price Token Price
Tremendous Island 80 21
Ninja Village 300 53
Loopy City 2.5k 227
Fruits Island 10k 593
Hero College 50k 1.8k
Walled Metropolis 250k 5.51k
Slayer Military 800k 12.3k
Ghoul City 3m 30.8k
Chimera Jungle 10m 71.1k
Digital Fortress 40m 185k
Empty Dimension 150m 464k
Cursed Excessive 500m 1.07m
XYZ Metropolis 1.5b 2.29m
9 Crimes island 5b 5.28m
Future Island 20b 13.8m
Fortunate Kingdom 80b 36m
Land Of Alchemy 250b 79.5m
Slimey Island 780b 174m
Flame Metropolis 2t 336m
Divine Colosseum 7t 800m
Kingdom Of 4 20t 1.65b
Icy Wastes 65t 3.75b
The Underworld 200t 8.17b
Psychic Metropolis 650t 18.5b
The Gap 2q 40.3b
Ninja Metropolis 6q 86.4b
Time Journey Tokyo 20q 199b
Orca Highway Jail 66q 455b
World Of Video games 220q 1.04t
30 TBC 0 0

The max open tokens are added right here in addition to the max open will probably be utilized in our outcomes too.

With all this set I created some code to work out the prices for the values enterd within the enter fields:

defaultOpenPerHour = 1200   // what number of opens an be performed in an hour
        defaultMaxOpensPerHour = 40 // what number of max opens could be performed in a hour
        defaultSellRate = 0.25      // worth returned for promote (avg)
        timeEventMod = 1            // shops modifier for time occasion
        modLetters = " KMBTQEZYXWVU"  // modifiers for forex

        // helpful capabilities

        operate getCostOfSingleOpen(cps, opens) {
            return cps * opens;
        }

        operate getCostOfSingleMaxOpen(cps, invSpace) {
            return cps * invSpace * 0.5;
        }

        operate getCostOfHourOpens(cps, opens, gpass, fiftyk, fuseSell, vip) {
            if (vip == 2) {
                cps = cps * 0.75 // 25% low cost for VIP
            }

            fc = cps * opens * defaultOpenPerHour * gpass * fiftyk
            if (fuseSell == 2) {
                fc = fc * (1 - defaultSellRate)
            }
            return fc
        }

        operate getCostOfHourMaxOpen(cps, invSpace, fuseSell, vip) {

            if (vip == 2) {
                cps = cps * 0.75 // 25% low cost for VIP
            }

            fc = cps * (defaultMaxOpensPerHour * timeEventMod) * invSpace
            sellprice = 0
            if (fuseSell == 2) {
                sellprice = fc * defaultSellRate
            }
            return (fc * 0.5) - sellprice
        }

        operate convertToFormatted(worth, mod) {
            cmodpos = modLetters.indexOf(mod.toUpperCase())
            whereas (Math.ceil(Math.log10(worth + 1)) > 3) {
                cmodpos += 1 // transfer to subsequent modifier
                worth = worth * 0.001// divide val by 1000 to mve 3 locations down
            }

            return parseFloat(worth.toFixed(2)) + modLetters[cmodpos]
            //return worth.toPrecision(3) + modLetters[cmodpos];
        }

        operate populateCost(stringVal, maxStringVal) {
            price = costModConvert(stringVal)
            maxcost = costModConvert(maxStringVal)

            $("#inpcost").val(price[0])
            $("#inpmod").val(price[1])

            $("#inpMaxcost").val(maxcost[0])
            $("#maxmod").val(maxcost[1])

        }

        operate costModConvert(stringVal) {
            lastChar = stringVal.slice(stringVal.size - 1)
            if ($.isNumeric(lastChar)) {
                return [stringVal, ""]
            } else {
                return [stringVal.slice(0, stringVal.length - 1), lastChar]
            }
        }

        operate getOneHourMaxToken(cpmo) {
            return cpmo * 40
        }



        // reply to Clicks
        $("#getres").click on(operate (e) {
            price = $("#inpcost").val()
            mod = $("#inpmod").val()
            mcost = $("#inpMaxcost").val()
            mmod = $("#maxmod").val()
            openCount = $("#opensCount").val()
            invSpace = $("#invSpace").val()
            fuseSell = $("#inputGroupSelect01").val()   // 1 = fuse | 2 = Promote
            gPass = $("#inputGroupSelect02").val()      // 1 = None | 2 = Owned
            fiftyk = $("#inputGroupSelect03").val()     // 1 = None | 2 = Owned
            doMax = $("#inputGroupSelect04").val()      // 1 = Sure  | 2 = No
            vip = $("#inputGroupSelect05").val()        // 1 = No   | 2 = Sure

            res = getCostOfHourOpens(price, openCount, gPass, fiftyk, fuseSell, vip)
            mres = 0
            if (doMax == 1) {
                res += getCostOfHourMaxOpen(price, invSpace, fuseSell)
                mres = getOneHourMaxToken(mcost)
            }


            hour1 = convertToFormatted(res, mod)
            hour2 = convertToFormatted(res * 2, mod)
            hour3 = convertToFormatted(res * 3, mod)
            hour4 = convertToFormatted(res * 4, mod)
            hour5 = convertToFormatted(res * 5, mod)
            hour6 = convertToFormatted(res * 6, mod)
            hour7 = convertToFormatted(res * 7, mod)
            hour8 = convertToFormatted(res * 8, mod)
            hour24 = convertToFormatted(res * 24, mod)

            hourM1 = convertToFormatted(mres, mmod)
            hourM2 = convertToFormatted(mres * 2, mmod)
            hourM3 = convertToFormatted(mres * 3, mmod)
            hourM4 = convertToFormatted(mres * 4, mmod)
            hourM5 = convertToFormatted(mres * 5, mmod)
            hourM6 = convertToFormatted(mres * 6, mmod)
            hourM7 = convertToFormatted(mres * 7, mmod)
            hourM8 = convertToFormatted(mres * 8, mmod)
            hourM24 = convertToFormatted(mres * 24, mod)

            $("#resdisplay").html(hour1 + " for 1 hour  (" + hourM1 + " tokens)")
            $("#res2display").html(hour2 + " for two hours (" + hourM2 + " tokens)")
            $("#res3display").html(hour3 + " for 3 hours (" + hourM3 + " tokens)")
            $("#res4display").html(hour4 + " for 4 hours (" + hourM4 + " tokens)")
            $("#resd5isplay").html(hour5 + " for five hours (" + hourM5 + " tokens)")
            $("#res6display").html(hour6 + " for six hours (" + hourM6 + " tokens)")
            $("#res7display").html(hour7 + " for 7 hours (" + hourM7 + " tokens)")
            $("#res8display").html(hour8 + " for 8 hours (" + hourM8 + " tokens)")
            $("#res24display").html(hour24 + " for twenty-four hours (" + hourM24 + " tokens)")
        });

        $(".trworld").click on(operate () {
            ffs = $(this)
            costtd = ffs.discover("td.costtd").html()
            costMaxtd = ffs.discover("td.costMaxtd").html()
            worldName = ffs.discover("td.worldName").html()
            $("#data").html(worldName)
            populateCost(costtd, costMaxtd)
        });

        $(".badgeBut").click on(operate () {
            change ($(this).attr("data")) {
                case "test1":
                    if ($("#inputGroupSelect05").val() == "1") {
                        $("#inputGroupSelect05").val("2")
                    } else {
                        $("#inputGroupSelect05").val("1")
                    }

                    break;
                case "test2":

                    if ($("#inputGroupSelect02").val() == "1") {
                        $("#inputGroupSelect02").val("2")
                    } else {
                        $("#inputGroupSelect02").val("1")
                    }

                    break;
                case "test3": break;
                case "test4": break;
                case "test5": break;
                case "test6": break;
                case "test7":
                    turnOffAllTimeEventHighlights($(this))
                    if (timeEventMod == 2) {
                        timeEventMod = 1
                        $(this).discover(".clh").toggle()
                    } else {
                        timeEventMod = 2
                    }
                    break;
                case "test8":
                    turnOffAllTimeEventHighlights($(this))
                    if (timeEventMod == 3) {
                        timeEventMod = 1
                        $(this).discover(".clh").toggle()
                    } else {
                        timeEventMod = 3
                    }
                    break;
                case "test9":
                    turnOffAllTimeEventHighlights($(this))
                    if (timeEventMod == 4) {
                        timeEventMod = 1
                        $(this).discover(".clh").toggle()
                    } else {
                        timeEventMod = 4
                    }
                    break;
                case "test10":
                    turnOffAllTimeEventHighlights($(this))
                    if (timeEventMod == 5) {
                        timeEventMod = 1
                        $(this).discover(".clh").toggle()
                    } else {
                        timeEventMod = 5
                    }
                    break;
            }



            $(this).discover(".clh").toggle()
        });

        operate turnOffAllTimeEventHighlights(object) {
            badgebar = object.closest(".badgebar")
            badgebar.discover(".timeMod").toggle(false)
        }

This code is on the market on github right here incase you wish to make this your self in your server. Credit score is appreciated however not required 🙂

 

 

The publish Making an AFK Calculator for Anime Fighters Simulator – Roblox Sport appeared first on Sport Growth.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement -spot_img

Latest Articles