![]() |
|
[.NET] Need help coding a bot in VB2010! - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] Need help coding a bot in VB2010! (/showthread.php?tid=4136983) Pages: Pages
1
2
|
* - Vipеr - Mar 28, 2014 What code can I use so that the program checks to see if the website is fully loaded, then changes? Btw thanks for the heads-up about the code tags, didn't think about it. * - chaddiablo - Mar 28, 2014 (Mar 28, 2014 01:16 PM)ViperCoder Wrote: What code can I use so that the program checks to see if the website is fully loaded, then changes? Btw thanks for the heads-up about the code tags, didn't think about it. Code Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompletedIf you need additional help LMK, I've already built multiple bots like this. PS. Don't use rich text box, if you want more lines on the text use 'ListBox' Ex: Code Listbox1.Items.Item(0)PS..PS... Don't use thread sleep. Create a timer event. Code Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompletedCode Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.TickYou get the point Chaddiablo * - ident - Mar 29, 2014 (Mar 28, 2014 09:12 PM)chaddiablo Wrote: i suggest you learn before trying to teach also. * - chaddiablo - Mar 29, 2014 (Mar 29, 2014 02:56 PM)ident Wrote: i suggest you learn before trying to teach also.It may be bad coding but, I've already made one with this method. * - BloodVulture - Mar 30, 2014 (Mar 28, 2014 01:16 PM)ViperCoder Wrote: What code can I use so that the program checks to see if the website is fully loaded, then changes? Btw thanks for the heads-up about the code tags, didn't think about it. Code Dim i As Integer = 0Typed from memory without testing, but that should continuously loop through the websites * - Vipеr - Mar 30, 2014 I tried out the code and it worked perfectly, thanks! Code Public Class Form1Now only if you could tell me how to make it wait 5 sec between each link and have it stop after it goes through all the links. Thanks for everyone's help! 🙂 * - BloodVulture - Mar 30, 2014 (Mar 30, 2014 12:49 PM)ViperCoder Wrote: I tried out the code and it worked perfectly, thanks! Code Public Class Form1That should work. I think. Still not tested :P * - ident - Mar 30, 2014 These threads are great. One more stupid idea after another. Use a Queue(Of string you bellends and the documentcompleted event. No timer or sleep ever needed. a previous example http://www.vbforums.com/showthread.php?757057-Coding-help!&p=4631607&viewfull=1#post4631607 * - iokio - Mar 31, 2014 i do this by declaring a global boolean... set to false. once the timer reaches 5 seconds i set the boolean to true. then i use a while loop that exits once i have looped through all the urls. (use a variable "count" to keep track of the number of urls i have visited.) inside the loop i have a if statement that checks if the boolean is true, (5 min have passed) if the boolean is true, i navigate too the next site and i increment the "count" variable. that's all u really need... keep in mind that you cant use the sleep, this will make the program non responsive and the website wont load. Always make sure the inside your loop you state: "application.doevents;". this will allow the program to load the website even when its in the loop. hope this helps :) |