Jump to content

Recommended Posts

Posted

Ok i've got the code bellow for "Visual Basic 2008" but i want it to generate numbers from a list ".txt" ex. "NumberList.txt" "1, 2, 3, 4 - ,999999"

I dont want it to randomize nmbers !

Public Class Form1

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Timer1.Start()
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Timer1.Stop()
    End Sub

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Timer1.Interval = ("5000")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Timer1.Interval = ("2500")
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Timer1.Interval = ("1500")
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        SendKeys.Send(Int(Val(TextBox1.Text) * Rnd()))
        SendKeys.Send("{enter}")
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class

Posted

You mean you want it to read a .txt file with numbers?

Lets say the txt file contains this:

1
2
3
4
5
6

 

You want your program to read those numbers and post them line by line in a textbox or listbox?

Posted

for generating random numbers use RND (example: rnd() * 50000, output will be between 0 and 50000)

 

and for +1 all the time just use a simple loop for that (i just know it for C++,,, dont know atm for vb lol but you maybe will get my point :P)

 

for(unsigned int i = 0; i < 50000; i++)

{

//Here the numbers will go +1 till 50000

//out put will be:

// 0

// 1

// 2

// 3

// 4

//.....

}

Posted

for generating random numbers use RND (example: rnd() * 50000, output will be between 0 and 50000)

 

Yeah only this could generate real numbers too. (I got 33553.37 as random number)

The way to do it properly for integers is this:

Dim minimum_number As Integer = 1
       Dim maximum_number As Integer = 10
       Dim random_number As New Random
       MsgBox(random_number.Next(minimum_number, maximum_number))

or for a random number between 1 and 10 could be done easier

       Dim random_number As New Random
       MsgBox(random_number.Next(1, 10))

or for a function:

Function GenerateRandomNumber(ByVal minimum_number As Integer, ByVal maximum_number As Integer) As Integer
       Dim rnd As New Random : Return rnd.Next(minimum_number, maximum_number)
End Function

 

 

Posted

i dont want random numbers !! i want 1 to 9999999 but thx for help

correctly it 1-65535 as i rmb... or 2,147.... i dont rmb... :/

Posted

i dont want random numbers !! i want 1 to 9999999 but thx for help

You mean this?

For i = 1 to 9999999
'Do something here
next i

Posted

You mean this?

For i = 1 to 9999999
'Do something here
next i

maybe yes i'll try but can you correct the code for me ?

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


  • Posts

    • L2Elixir – Patch 4 Is Live!   We’re working non-stop, day and night, to deliver the best possible quality and bring back what made L2Elixir special. This project is built with passion, not shortcuts — for the old-school players who remember, and the new ones who want to experience it properly. Thank you for being part of the journey. Together, we’re making L2Elixir great again ❤️ The legends never fade.    ⚙️ General Enabled Class Change service (same class type only) ALT + B → Services → Character Development Enabled Shift + Click on Treasure Chests Players can now identify real chests (Adena, scroll drops) and use Key / Unlock Event deaths now cancel only debuffs, All self buffs are preserved, fixes issues with Root and similar effects Bladedancer class can now log in even when Max Clients (2) is reached. Since an active Bladedancer is not available for every damage dealer and some players tried to abuse this via VPN or a second PC, this feature was added to keep things fair. protections applies, requires testing!    🎒 Items Crystallizing enchanted items now gives the correct increased crystal amount (retail-like behavior) Removed Agathion Seal Bracelet: Rudolph from Santa rewards (Gracia Final item) Added Dualsword Craft Stamp into Milestone Exchange list    🧙 Skills Fixed Banish Undead lethal chance Hot Springs Malaria and similar effects now level up faster while being attacked
    • thats new SEO level tricks you know nothing of noob - bottom line: exposed.
    • Warning: This guy is a big scammer, trying to sell everything, advertising for servers etc. That's his mail address evgesha.nrnr@gmail.com , stay away!   @Atom @Celestine
    • Warning: This guy is a big scammer, trying to sell everything, advertising for servers etc. That's his mail address evgesha.nrnr@gmail.com , stay away! @Celestine @Atom
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock