|
-
Feb 20th, 2005, 05:40 AM
#1
Thread Starter
Addicted Member
Looping
Im doing this
VB Code:
Private Sub Command7_Click()
popo = 0
Do Until popo = (Text1.Text)
Inet1.Execute "http://google.com"
Loop
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?
-
Feb 20th, 2005, 05:57 AM
#2
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.
-
Feb 20th, 2005, 06:01 AM
#3
Thread Starter
Addicted Member
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?
-
Feb 20th, 2005, 06:24 AM
#4
Addicted Member
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
-
Feb 20th, 2005, 06:29 AM
#5
Thread Starter
Addicted Member
Re: Looping
I do have a timer that adds + 1 to popo
VB Code:
Private Sub Timer1_Timer()
If Inet1.Execute = "http://google.com" Then
popo = popo + 1
End If
End Sub
But its that i get a error on
VB Code:
Private Sub Command7_Click()
popo = 0
[U][I][B]Do Until popo = (Text1.Text)[/B][/I][/U]
Inet1.Execute "http://google.com"
Loop
End Sub
I get error on the bolded , italiced , underlined (lol) part of the code.
Are we alive or just breathing?
-
Feb 20th, 2005, 06:31 AM
#6
Addicted Member
Re: Looping
maybe you just need to get rid of the brackets on the text1.text ?
-
Feb 20th, 2005, 06:37 AM
#7
Re: Looping
 Originally Posted by Piller
Im doing this
VB Code:
Private Sub Command7_Click()
popo = 0
Do Until popo = (Text1.Text)
Inet1.Execute "http://google.com"
Loop
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!!!
-
Feb 20th, 2005, 06:37 AM
#8
Thread Starter
Addicted Member
Re: Looping
I still got a error when i did
VB Code:
Private Sub Command7_Click()
popo = 0
Do Until popo = Text1.Text
Inet1.Execute "http://google.com"
Loop
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:
Private Sub Command7_Click()
popo = 0
Do Until popo = (Text1.Text)
Inet1.Execute "http://lifehit.com/slot.php?gameplay=Play+Slots"
Loop
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?
-
Feb 20th, 2005, 08:30 AM
#9
Frenzied Member
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?
-
Feb 20th, 2005, 08:46 AM
#10
Re: Looping
Try This:
VB Code:
Private Sub Command7_Click()
popo = 0
Text1.Text = 10 'Need this since "" does not equal 0
Do Until popo = Int(Text1.Text)
DoEvents 'Don't forget to DoEvents!!!
Inet1.Execute "http://google.com"
popo = popo + 1 'Need this since the loop would be infinite otherwise.
Loop
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.
Last edited by Jacob Roman; Feb 20th, 2005 at 08:50 AM.
-
Feb 20th, 2005, 08:54 AM
#11
Addicted Member
Re: Looping
Use this
Do Until popo = Val(Text1.Text)
I guess this will solve the problem.
-
Feb 20th, 2005, 09:06 AM
#12
Re: Looping
 Originally Posted by pbuddy_8
Use this
Do Until popo = Val(Text1.Text)
I guess this will solve the problem.
That works too
-
Feb 20th, 2005, 09:29 AM
#13
Ex-Super Mod'rater
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.

-
Feb 20th, 2005, 06:34 PM
#14
Thread Starter
Addicted Member
Re: Looping
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|