Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › [Solved]Random number help

[Solved]Random number help

Posts 1–6 of 6 · Page 1 of 1
PO
poneboy00
[Solved]Random number help
I created two different random numbers but both of them always generate the same number, and I don't know whats going on, any help would be appreciated. My VB teacher at school helped me with this but I forgot what he did.
#1 · edited 16y ago · 16y ago
mnpeepno2
mnpeepno2
make sure the 1st number is SMALLER than the 2nd number by at least two.
#2 · 16y ago
NextGen1
NextGen1
2 things,

One is, What are you talking about Mneep?

Second,

Problem with VB is when you generate a random number, you are generating Psuedo Random, Meaning both numbers will be the same, and both numbers will generate the same numbers from start to finish, no real random

To avoid this

part one :

Each number should have different Values

Rnd(1) * 4 + 1
Rnd(1) * 4 + 2

The pplus at the end will change the values and make them different, Now how to prvent the Psuedo Random outcome is alittle more tricky,

One way is to use a label that is attached to a timer,

Timer1 event

Label1.text = label1.text + 1


then you call your random numbers elsewhere

rnd(1) * 5 + label1.text
rnd(1) * 4 + Label1.text


or (and my favorite) is to generate a number based off your current system.diagnostics
Cpu speed, that number is always fluctuating allowing more random numbers


Hope this helps
#3 · 16y ago
Invidus
Invidus
Quote Originally Posted by NextGen1 View Post
2 things,

One is, What are you talking about Mneep?

Second,

Problem with VB is when you generate a random number, you are generating Psuedo Random, Meaning both numbers will be the same, and both numbers will generate the same numbers from start to finish, no real random

To avoid this

part one :

Each number should have different Values

Rnd(1) * 4 + 1
Rnd(1) * 4 + 2

The pplus at the end will change the values and make them different, Now how to prvent the Psuedo Random outcome is alittle more tricky,

One way is to use a label that is attached to a timer,

Timer1 event

Label1.text = label1.text + 1


then you call your random numbers elsewhere

rnd(1) * 5 + label1.text
rnd(1) * 4 + Label1.text


or (and my favorite) is to generate a number based off your current system.diagnostics
Cpu speed, that number is always fluctuating allowing more random numbers


Hope this helps
Oh wow NextGen. I didn't cop a word of that.. Except the bit about the plus =P. Your such a brainiac =P
#4 · 16y ago
MJLover
MJLover
Here is another solution:

Dim x As New Random
'Generates a random number between 1 to 100
x.Next(1, 100)

Hope this helps !!
#5 · 16y ago
NextGen1
NextGen1
Code:
 Private Function Randomizer(ByVal Startn As Integer, ByVal Endn As Integer) As Integer
        Dim nRandom As Integer
        Randomize()
        nRandom = iStart + (Rnd() * (Endn - Startn))
        Return nRandom
    End Function


#6 · 16y ago
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

  • [Help]Random Number[Solved]By tremaster in Visual Basic Programming
    5Last post 16y ago
  • [TuT]Generate Random NumberBy Iamazn1 in Visual Basic Programming
    1Last post 16y ago
  • [Question] Random number below a set numberBy That0n3Guy in C++/C Programming
    4Last post 16y ago
  • Fill with random numbers between 0-12By ppl2pass in Visual Basic Programming
    13Last post 16y ago
  • Random Number GeneratorBy Iam"iDude" in Visual Basic Programming
    5Last post 18y ago

Tags for this Thread

None