Jump to content

[Help] V.B. 2008


avatar

Recommended Posts

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

//.....

}

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Dear friends, September 24 at 19:00 (UTC +3) will be available access for our test server. UTC+3 - exact time now - Time.is During beta test will be available OBT Manager (NPC Eva) in Giran with all necessary items for test. We run 7signs in 1h cycle and Oly 24/7 Server setup on Beta same, like will be on server start On Beta will be restrictions for skill enchant lvl: 15 max for 2nd profession, 7 for 3rd profession Talent Tree avaible only Tier 1 (Same like will be on first Olympiad cycle on live server) We strongly recommend visiting beta. Check the concept of the server before it start. View the NPC Buffer, Shop, Services. We will be shutting down the public test server on September 23! So as not to mislead new players on Dex, whitch one is beta for seasonal server. After the season server opens, the Public Test Server will be available again. - Olympiad EVENT ON BETA TEST   GiveAway on Beta! On Beta launch day, we make 7 giveaways From 19:00 till 02:00. Each hour, new giveaway with 5 winer places. Each hour you need make new registartion if you want participate. To participate on Giveaway you need speak with NPC Ahuron in Giran Town and make registartion. On 20:00, 21:00, 22:00, 23:00, 00:00, 01:00 and 02:00 Ahuron will announce Winers! And palyers recive special item. If you will be offline on this momment, you will not get prize! Winers will recive on same account (on first character) scrolls for 7days Premium status on server start! You can activate this scroll on any time, its will give you 7 days Premium, or if you already have Premium it will add 7 days to it. Also, all who visit Beta and will be online at less 1 hour, will get small gift on server start. Pack with useful potions that for sure help you on start. We need this, to be sure you prepear you game client and ready to start    How to Connect on Beta! For participation in our Open Beta you can use your old Master Accounts(web account). But you need to create new Game Account fore NEW Interlude x25 server on your Control Panel. If you don't play in our project before - register new Master Account Download links: Updater Full Game Client (torrent) Full Game Client (direct link)   If you download Full Game Client - just unzip it, run updater choose NEW server, click on Full Check, than after update - click Start. if you already have our game client - Run updater choose NEW server and click Update. /data/attachments/4/4520-75a004e5c687b6c439c89513218f4743.jpg Join in our Discord Chanel - Join the Lineage2Dex Support Discord Server! Here you can find all important news, guides, communicate with other players and admins. Don't forget, Open Beta test is TEST server, so please make maximum test before opening, check classes that u plan to play, check shops, mobs etc. Don't just stay in the Towns enchanting weapons  Have a fun!  
    • Nice coincidence that since these links were posted, that forum getting ddosed.
  • Topics

×
×
  • Create New...