quick programming question (VERY quick!)

Discussion in 'World of SPAM' started by Fexxel, Jun 4, 2009.

  1. Fexxel

    Fexxel Level IV

    Joined:
    Jan 28, 2009
    Messages:
    959
    Likes Received:
    26
    Wondering if anyone had a random integer generator function for vb.net.
    I'm using:
    Code (Text):
    1.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         Timer1.Enabled = True
    3.         While Timer1.Enabled = True
    4.             SendKeys.Send(key1.Text)
    5.             Pause(minspeed.Text)
    6.             SendKeys.Send(key2.Text)
    7.             Pause(minspeed.Text)
    8.         End While
    9.     End Sub
    But I need to have the pause(___) be a random integer between minspeed.text and maxspeed.text
    Anyone? (VB.net)
    thanks,
    Fexxel
     
  2. tharoux

    tharoux Level IV

    Joined:
    Dec 30, 2006
    Messages:
    2,733
    Likes Received:
    126
    Location:
    In front of my PC, Montreal
    Timer1.Interval = ((Integer.Parse(MaxSpeed.Text) - Integer.Parse(MinSpeed.Text)) * Rnd() + Integer.Parse(MinSpeed.Text)) * 1000
     
    Fexxel likes this.
  3. Fexxel

    Fexxel Level IV

    Joined:
    Jan 28, 2009
    Messages:
    959
    Likes Received:
    26
    <3 you!!! Thank you so much Tharoux :-D
    +Rep'd