Hey guys! I want to build a program similar to a "view bot". This bot is not for YouTube. I tried using text boxes but that requires to much time. This was the original code (timer 1 had an interval of 5 seconds and timer 2 an interval of 10 seconds):
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate(TextBox1.Text)
Timer1.Start()
Timer2.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Timer1.Stop()
WebBrowser1.Navigate(TextBox2.Text)
End Sub
Private Sub Timer2_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Timer2.Stop()
WebBrowser1.Navigate(TextBox3.Text)
End Sub
What code could I use that would go to the links in a rich text box, line after line every 5 seconds?
(May 12, 2022 10:16 AM)Goku Wrote: Doesn't change the fact that a human sperm is as human as we are.
You could use the .Lines property in RichTextBox.
You could then get your URL with .Lines(0), .Lines(1), etc. on every timer tick.
what code could I use so that I don't have to manually retype .Lines(1) .Lines(2) .Lines(3)...
something like navigate to RichTextBox1 line 1 wait 5 sec then +1 (next line) everytime
(May 12, 2022 10:16 AM)Goku Wrote: Doesn't change the fact that a human sperm is as human as we are.
(Mar 26, 2014 08:57 PM)DBots Wrote: You could use the .Lines property in RichTextBox.
You could then get your URL with .Lines(0), .Lines(1), etc. on every timer tick.
TextBox also have lines property 😊
I made a new form with a RichTextBox, a WebBrowser and a Button.
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate(RichTextBox1.Lines(1))
End Sub
In the RichTextBox I put:
www.google.com
www.yahoo.com
I try to run the program but instead of going to line 1 of the text it skips to the end. Can anyone help me?
(May 12, 2022 10:16 AM)Goku Wrote: Doesn't change the fact that a human sperm is as human as we are.
Make an array that holds the URL's (Not hard to load them from a *.txt) and use it that way. I would scold over the use of a webbrowser, however, I'm not exactly sober enough to judge whether it's permitted here.
fuck.
![[Image: wyEbCMi.png]](https://i.imgur.com/wyEbCMi.png)
Not trying to be a dick, It just comes naturally.
Do you want it to continuously loop through the links or just once each?
(Mar 26, 2014 10:39 PM)Only3 Wrote: TextBox also have lines property 😊
(Mar 26, 2014 08:40 PM)Vipеr Wrote: What code could I use that would go to the links in a rich text box, line after line every 5 seconds?
Either or. Just trying to answer his question.
Mar 27, 2014 08:47 AM
(This post was last modified: Mar 27, 2014 08:48 AM by wizardwizard.)
This would work, however instead of every 5 seconds you may want to check if docuiment is completed.
Code For x As Integer = 0 To 5
WebBrowser1.Navigate(TextBox1.Lines(x))
System.Threading.Thread.Sleep(5000)
Next
Mar 27, 2014 06:32 PM
(This post was last modified: Mar 27, 2014 06:34 PM by Vipеr.)
Basically what I want to do is have a RichTextBox with a bunch of links, for example:
www.google.com
www.yahoo.com
When I press a button I want the WebBrowser goes to the first link which is google.com, then the second link yahoo.com but between every website it waits 5 seconds. So it would be: webbrowser navigates to google.com, waits 5sec, navigate to yahoo.com, wait 5sec...
I don't want it to loop, just goes through the list once then it stop.
Doesn't the System.Threading.Sleep(5000) stop the entire program and not just the webbrowser? That would just do the same as skipping to the last link but with a 5sec delay after the button is pushed.
(May 12, 2022 10:16 AM)Goku Wrote: Doesn't change the fact that a human sperm is as human as we are.
(Mar 27, 2014 06:32 PM)Vipеr Wrote: Basically what I want to do is have a RichTextBox with a bunch of links, for example:
www.google.com
www.yahoo.com
When I press a button I want the WebBrowser goes to the first link which is google.com, then the second link yahoo.com but between every website it waits 5 seconds. So it would be: webbrowser navigates to google.com, waits 5sec, navigate to yahoo.com, wait 5sec...
I don't want it to loop, just goes through the list once then it stop.
Doesn't the System.Threading.Sleep(5000) stop the entire program and not just the webbrowser? That would just do the same as skipping to the last link but with a 5sec delay after the button is pushed.
Code For i As integer = 0 To RichTextBox1.Lines.Length - 1
WebBrowser1.navigate(RichTextBox1.Lines(i))
Threading.thread.sleep(5000)
Next
Msgbox("done")
Typed on my phone
Mar 28, 2014 07:12 AM
(This post was last modified: Mar 28, 2014 07:13 AM by wizardwizard.)
(Mar 28, 2014 01:00 AM)BloodVulture Wrote: Code For i As integer = 0 To RichTextBox1.Lines.Length - 1
WebBrowser1.navigate(RichTextBox1.Lines(i))
Threading.thread.sleep(5000)
Next
Msgbox("done")
Typed on my phone
Thats what I gave.
(Mar 27, 2014 06:32 PM)Vipеr Wrote: Basically what I want to do is have a RichTextBox with a bunch of links, for example:
www.google.com
www.yahoo.com
When I press a button I want the WebBrowser goes to the first link which is google.com, then the second link yahoo.com but between every website it waits 5 seconds. So it would be: webbrowser navigates to google.com, waits 5sec, navigate to yahoo.com, wait 5sec...
I don't want it to loop, just goes through the list once then it stop.
Doesn't the System.Threading.Sleep(5000) stop the entire program and not just the webbrowser? That would just do the same as skipping to the last link but with a 5sec delay after the button is pushed.
Well thats why you should use a document completed instead of a wait. AndAlso what I gave naiivgates all of them. Are you sure you are starting the count at 0?
(Mar 28, 2014 07:12 AM)wizardwizard Wrote: Thats what I gave.
Well thats why you should use a document completed instead of a wait. AndAlso what I gave naiivgates all of them. Are you sure you are starting the count at 0?
You gave a set number, 5. I did it so it works with any number of lines.
Hmm. I used the code you gave me and did the following:
New Form, added RichTextBox, Button and a WebBrowser.
Went into the codding for the button and put:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
For i As Integer = 0 To RichTextBox1.Lines.Length - 1
WebBrowser1.Navigate(RichTextBox1.Lines(i))
Threading.Thread.Sleep(5000)
Next
MsgBox("done")
End Sub
When I ran the program and pressed the button, the program just waited then displayed the last link. I was wondering if you could give me a code where it would show each page in the webbrowser. So far it's all white, a msgbox pops up saying done then the last link shows. Thx, cheers!
(May 12, 2022 10:16 AM)Goku Wrote: Doesn't change the fact that a human sperm is as human as we are.
(Mar 28, 2014 10:54 AM)Vipеr Wrote: Hmm. I used the code you gave me and did the following:
New Form, added RichTextBox, Button and a WebBrowser.
Went into the codding for the button and put:
PHP Code
<?php Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click For i As Integer = 0 To RichTextBox1.Lines.Length - 1 WebBrowser1.Navigate(RichTextBox1.Lines(i)) Threading.Thread.Sleep(5000) Next MsgBox("done") End Sub
When I ran the program and pressed the button, the program just waited then displayed the last link. I was wondering if you could give me a code where it would show each page in the webbrowser. So far it's all white, a msgbox pops up saying done then the last link shows. Thx, cheers! (please use PHP or code tags)
This is because you are sending way to much to the web browser before it is done loading.
You will need to check if the web browser is done loading.
|