Jump to content

How would I be able to return a randomly generated number within a specific range?


12 posts in this topic

Recommended Posts

Posted

I'm thinking of updating the BTD Battles hack to have random numbers generated for the mediallions so the values aren't so big. People have caught on :p I would use MSHook of course.

 

Basically, I would want the range of the number to be from 100-10000. Thanks :)

Posted (edited)
  On 9/10/2015 at 12:36 AM, Diversityy said:

So it would be like a random generated amount?

Yeah between a specific rangel

Updated by Guest
Posted (edited)

#include <stdlib.h>

//...
int r = arc4random_uniform(10000);

 

This would set it as a random number up to 10000.

Updated by Lethal
Posted
  On 9/10/2015 at 3:28 AM, Lethal said:

#include <stdlib.h>

//...

int r = arc4random_uniform(10000);

 

This would set it as a random number up to 10000.

I'll try tomarrow, thanks :)

Posted (edited)
  On 9/10/2015 at 3:44 AM, shmoo said:

I'll try tomarrow, thanks :)

 

<3 There is a method to set a minimum number but idk what it is. it's like 8 lines though.

Updated by Lethal
Posted (edited)

 

#include <stdlib.h>

...

int r = (rand() % 10000)+100;

This way it will always return values between 100 and 10000, this is the method without using the seed, I don't know how to use the seed in obj-c

Updated by DeathScripts
Posted (edited)
  On 9/10/2015 at 3:28 AM, Lethal said:

#include <stdlib.h>

//...

int r = arc4random_uniform(10000);

 

This would set it as a random number up to 10000.

Nice copy&paste ...

http://stackoverflow.com/questions/160890/generating-random-numbers-in-objective-c

 

 

But yes arc4random is the easiest way and doesn't need a seeder because it initializes itself

If you want a value from 100-10000 you would need

return arc4random() % 100) +10000;
Updated by castix

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Our picks

    • Disney Solitaire v1.1.0 [ +7 Cheats ] Auto Win
      Modded/Hacked App: Disney Solitaire By SuperPlay LTD
      Bundle ID: com.superplaystudios.disneysolitairedreams
      iTunes Store Link: https://apps.apple.com/ph/app/disney-solitaire/id6475757306?uo=4
       

      🤩 Hack Features

      - Coins [ Win Match ]

      - Task [ No Need Star ]

      - Stars

      - Undo

      - Wild Card

      - Free Ticket

      - Auto Win
      • 11 replies
    • Disney Solitaire v1.1.0 [ +7 Jailed ] Auto Win
      Modded/Hacked App: Disney Solitaire By SuperPlay LTD
      Bundle ID: com.superplaystudios.disneysolitairedreams
      iTunes Store Link: https://apps.apple.com/ph/app/disney-solitaire/id6475757306?uo=4


      🤩 Hack Features

      - Coins [ Win Match ]

      - Task [ No Need Star ]

      - Stars

      - Undo

      - Wild Card

      - Free Ticket

      - Auto Win
      • 13 replies
    • Eternium Cheats v1.35.10 +11
      Modded/Hacked App: Eternium By Making Fun, Inc.
      Bundle ID: com.makingfun.mageandminions
      iTunes Store Link: https://apps.apple.com/us/app/eternium/id579931356?uo=4

       

      📌 Mod Requirements

      - Jailbroken iPhone or iPad.
      - iGameGod / Filza / iMazing.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak (from Sileo, Cydia or Zebra).

       

      🤩 Hack Features

      - 5K Gems When Completed Stage
      - Infinite Gold
      - Infinite Cosmetic
      - Infinite Yellow Stone
      - Multiply Attack (Linked with Enemy)
      - No Skills Cooldown
      - No Consumable Cooldown
      - Multiply Attack Speed
      - Instant Regen Health
      - Always Crit
      - Material Drops (When you killed an Enemy it will drop materials for crafts)



      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/194526-eternium-cheats-v13355-6/
      • 58 replies
    • Ace Fishing: Wild Catch v9.7.0 +4 Cheats
      Modded/Hacked App: Ace Fishing: Wild Catch By Com2uS Corp.
      Bundle ID: com.com2us.acefishing.normal.freefull.apple.global.ios.universal
      iTunes Store Link: https://apps.apple.com/us/app/ace-fishing-wild-catch/id694972182?uo=4


      Hack Features:
      - No Line Break
      - Set Tension Gauge [ 1 = low, 2 = center, 3 = high ]
      - Set Fish HP
      - Set Damage


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 407 replies
    • Poker Hero - Joker Legend v1.8.0 [ +6 Cheats ] Easy Win
      Modded/Hacked App: Poker Hero - Joker Legend By Gemini Network
      Bundle ID: com.gemini.dash.deck
      iTunes Store Link: https://apps.apple.com/us/app/poker-hero-joker-legend/id6498983199?uo=4


      Hack Features:
      - Energy Freeze 

      - ATK Power [ Choose 1 Card Only Win Battle ]

      - Spell Power 

      - Always FullHouse [ Select Any Cards ]

      - Always Flush [ Select Any Cards ]

      - Always Straight [ Select Any Cards ]


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Like
      • 63 replies
    • Poker Hero - Joker Legend v1.8.0 [ +6 Jailed ] Easy Win
      Modded/Hacked App: Poker Hero - Joker Legend By Gemini Network
      Bundle ID: com.gemini.dash.deck
      iTunes Store Link: https://apps.apple.com/us/app/poker-hero-joker-legend/id6498983199?uo=4



      Hack Features:

      - Energy Freeze 

      - ATK Power [ Choose 1 Card Only Win Battle ]

      - Spell Power 

      - Always FullHouse [ Select Any Cards ]

      - Always Flush [ Select Any Cards ]

      - Always Straight [ Select Any Cards ]


      Jailbreak required hack(s): https://iosgods.com/forum/5-game-cheats-hack-requests/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 26 replies
    • Yukon: Family Adventure v1.57.1 [ +4++ Cheats ] Everything Unlimited
      Modded/Hacked App: Yukon: Family Adventure By Enixan Europe Limited
      Bundle ID: com.enixan.yukon.family.adventure
      iTunes Store Link: https://apps.apple.com/us/app/yukon-family-adventure/id6455041311?uo=4


      🤩 Hack Features

      - Gems

      - Energy

      - Items

      - EXP
      • 10 replies
    • Yukon: Family Adventure v1.57.1 [ +4++ Jailed ] Everything Unlimited
      Modded/Hacked App: Yukon: Family Adventure By Enixan Europe Limited
      Bundle ID: com.enixan.yukon.family.adventure
      iTunes Store Link: https://apps.apple.com/us/app/yukon-family-adventure/id6455041311?uo=4


      🤩 Hack Features

      - Gems

      - Energy

      - Items

      - EXP
      • 12 replies
    • Car Simulator 2 Cheats v1.55.7 +2
      Modded/Hacked App: Car Simulator 2 by Pavel Gavrilyuk
      Bundle ID: com.oppanagames.car.simulator
      iTunes Store Link: https://apps.apple.com/us/app/car-simulator-2/id1456091972?uo=4&at=1010lce4


      Hack Features:
      - Infinite Coins
      - Free iAP (Use with LocaliAPPStore or iOSGods iAP)
       

      iOS Hack Download Link: https://iosgods.com/topic/119157-arm64-car-simulator-2-cheats-all-versions-2/
      • 109 replies
    • The Seven Deadly Sins Cheats v2.77.0 +5
      Modded/Hacked App: The Seven Deadly Sins by Netmarble Corporation
      Bundle ID: com.netmarble.nanagb
      iTunes Store Link: https://apps.apple.com/us/app/the-seven-deadly-sins/id1475440231?uo=4&at=1010lce4


      Hack Features:
      - God Mode
      - OHK
      - Infinite MP


      iOS Hack Download Link: https://iosgods.com/topic/131686-arm64-the-seven-deadly-sins-cheats-v117-3/
        • Like
      • 2,038 replies
    • Kritika: The White Knights v5.14.2 +3 [God Mode & Damage Multiplier]
      Modded/Hacked App: Kritika: The White Knights By GAMEVIL Inc.
      Bundle ID: com.gamevil.kritikam.ios.apple.global.normal
      iTunes Store Link: https://itunes.apple.com/us/app/kritika-the-white-knights/id865958296
       

      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iFile / Filza / iFunBox / iTools or any other file managers for iOS.
      - Cydia Substrate or Substitute.
      - PreferenceLoader (from Cydia or Sileo).


      Hack Features:
      - God Mode Works Everywhere
      - Set Damage Multiplier - Do not set it too high, you will get kicked out if you do.
      - No Skill Cooldown 

      All features are unlinked!
      • 1,981 replies
    • Injustice: Gods Among Us v3.5 +6++ Jailed Cheats [Unlimited Currencies + More]
      Modded/Hacked App: Injustice: Gods Among Us by Warner Bros. Entertainment
      Bundle ID: com.wb.Injustice.Brawler2013
      iTunes Store Link: https://itunes.apple.com/us/app/injustice-gods-among-us/id575658129?mt=8&uo=4&at=1010lce4


      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Cydia Impactor.
      - A Computer Running Windows/Mac/Linux.


      Hack Features:
      - Unlimited Currencies - Earn some to receive an unlimited amount of that specific currency.
      - Unlimited Stamina - Will increase instead of decrease.
      - Godmode
      - One-Hit Kill
      - Max Player Level - Play a battle with that specific character to get it max level.
      - Anti-Ban - Untested. Might be useless since the game's old now, and I wasn't banned testing this hack without this enabled anyway.
      • 1,971 replies
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines