Results 1 to 14 of 14

Thread: Looping

  1. #1

    Thread Starter
    Addicted Member Piller's Avatar
    Join Date
    Oct 2004
    Location
    california
    Posts
    177

    Resolved Looping

    Im doing this
    VB Code:
    1. Private Sub Command7_Click()
    2. popo = 0
    3. Do Until popo = (Text1.Text)
    4. Inet1.Execute "http://google.com"
    5. Loop
    6. End Sub

    I want inet1 to execute that untill popo = what ever text1.text is , but i get a error on the Do Until part. What did i do wrong?
    Last edited by Piller; Feb 20th, 2005 at 06:34 PM.
    Are we alive or just breathing?

  2. #2
    Fanatic Member vbasicgirl's Avatar
    Join Date
    Jan 2004
    Location
    Manchester, UK
    Posts
    1,016

    Re: Looping

    are you trying to show google until a new url is typed in text1 ?, using a loop like that is going to eat up your cpu aswell, would you not be better using a timer ?

    casey.

  3. #3

    Thread Starter
    Addicted Member Piller's Avatar
    Join Date
    Oct 2004
    Location
    california
    Posts
    177

    Re: Looping

    Google isnt the real link im using , I just didnt want to post the link. What i want is that inet will execute the website untill what ever # in text1 is hit
    Example
    Text1.text = 10
    I would want inet to execute the website 10 times
    Are we alive or just breathing?

  4. #4
    Addicted Member Psychotic's Avatar
    Join Date
    May 2004
    Posts
    164

    Re: Looping

    you would have to add one to popo each time the loop ran otherwise it will stay at 0 and ur loop will last forever
    -Psychotic-

  5. #5

    Thread Starter
    Addicted Member Piller's Avatar
    Join Date
    Oct 2004
    Location
    california
    Posts
    177

    Re: Looping

    I do have a timer that adds + 1 to popo
    VB Code:
    1. Private Sub Timer1_Timer()
    2. If Inet1.Execute = "http://google.com" Then
    3. popo = popo + 1
    4. End If
    5. End Sub

    But its that i get a error on
    VB Code:
    1. Private Sub Command7_Click()
    2. popo = 0
    3. [U][I][B]Do Until popo = (Text1.Text)[/B][/I][/U]
    4. Inet1.Execute "http://google.com"
    5. Loop
    6. End Sub

    I get error on the bolded , italiced , underlined (lol) part of the code.
    Are we alive or just breathing?

  6. #6
    Addicted Member Psychotic's Avatar
    Join Date
    May 2004
    Posts
    164

    Re: Looping

    maybe you just need to get rid of the brackets on the text1.text ?
    -Psychotic-

  7. #7
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Looping

    Quote Originally Posted by Piller
    Im doing this
    VB Code:
    1. Private Sub Command7_Click()
    2. popo = 0
    3. Do Until popo = (Text1.Text)
    4. Inet1.Execute "http://google.com"
    5. Loop
    6. End Sub

    I want inet1 to execute that untill popo = what ever text1.text is , but i get a error on the Do Until part. What did i do wrong?
    Could you explain why you want to do, as this code will cause your program to repeatedly request the Google web site at a high freency in a very small amount of time and could be seen by them as a (DOS) denial of service attack!!!
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  8. #8

    Thread Starter
    Addicted Member Piller's Avatar
    Join Date
    Oct 2004
    Location
    california
    Posts
    177

    Re: Looping

    I still got a error when i did
    VB Code:
    1. Private Sub Command7_Click()
    2. popo = 0
    3. Do Until popo = Text1.Text
    4. Inet1.Execute "http://google.com"
    5. Loop
    6. End Sub

    I changed (text1.text) to text1.text , but still got error on same line.

    Didnt see ur post there visualad so i had to edit . Ill just post my code i have
    VB Code:
    1. Private Sub Command7_Click()
    2. popo = 0
    3. Do Until popo = (Text1.Text)
    4. Inet1.Execute "http://lifehit.com/slot.php?gameplay=Play+Slots"
    5. Loop
    6. End Sub

    Im not trying to do a DoS attack , its ment to be a sort of Auto Slot player for this website. I want inet1 to execute the link as much as text1 tells it to.
    Are we alive or just breathing?

  9. #9
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    Re: Looping

    It would help if you told us which error you get.

    Wouldn't a For i = 0 to text1.text loop be better if you want to execute the loop x times?

  10. #10
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: Looping

    Try This:

    VB Code:
    1. Private Sub Command7_Click()
    2.      
    3.      popo = 0
    4.      Text1.Text = 10 'Need this since "" does not equal 0
    5.      
    6.      Do Until popo = Int(Text1.Text)
    7.  
    8.           DoEvents 'Don't forget to DoEvents!!!
    9.      
    10.           Inet1.Execute "http://google.com"
    11.          
    12.           popo = popo + 1 'Need this since the loop would be infinite otherwise.
    13.      
    14.      Loop
    15.  
    16. End Sub

    The reason why you need the Int around Text1.Text is because I'm assuming popo is declared as an Integer or a Long, and you are waiting until popo equals a string! No wonder you get an error. A type mismatch I believe. So what I did was have you convert whatever is in Text1.Text into a numbered data type (Integer or Long). I also added another line of code since Text1.Text might be equaling "". And last but not least, you needed popo = popo + 1 cause your loop would be infinite then. So it's now like a For loop.

    You didn't need the Timer to add 1 to popo unless you are adding 1 ever someodd seconds.

  11. #11
    Addicted Member
    Join Date
    Feb 2005
    Posts
    168

    Re: Looping

    Use this
    Do Until popo = Val(Text1.Text)

    I guess this will solve the problem.

  12. #12
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: Looping

    Quote Originally Posted by pbuddy_8
    Use this
    Do Until popo = Val(Text1.Text)

    I guess this will solve the problem.
    That works too

  13. #13
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349

    Re: Looping

    Just to let you know the Game probably will check if the IP is the same lots of times and so they will either not count them or ban you from it.

    Not to mention if you do this lots (on the 100's or 1,000's level) then your ISP could get suspious of you launching DoS attacks and may not take the time to ask why .
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  14. #14

    Thread Starter
    Addicted Member Piller's Avatar
    Join Date
    Oct 2004
    Location
    california
    Posts
    177

    Re: Looping

    Quote Originally Posted by Electroman
    Just to let you know the Game probably will check if the IP is the same lots of times and so they will either not count them or ban you from it.

    Not to mention if you do this lots (on the 100's or 1,000's level) then your ISP could get suspious of you launching DoS attacks and may not take the time to ask why .

    Ya visualad told me it could be like a DoS attack , thank you guys for warning me , and you guys that helped me.
    Are we alive or just breathing?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width