The Botting Network


 
NEW GUIDELINES BEING ENFORCED
IRC CHAT: irc.thebotnet.com #thebotnet Web Connect:(mibbit)(java)

Go Back   The Botting Network > The Botting Sector > Programming

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

 

Thread Tools Display Modes
Old 02-07-2010, 05:47 AM   #1 (permalink)
Subscriber
GPT Earnings: $0.45
 
Ghst's Avatar
 
Join Date: Nov 2009
Posts: 73
Reputation: 0
Default Swagbucks Auto Login Problems

I'm using visual Basics 2008 Express, I have this code on the "Go" Button of My mainform. The program shows this error: "Object reference not set to an instance of an object." Here is the code I'm trying to get to work.The code stops on the line that is underlined. I really need help getting my app to Log in. (Hell I can't get it to fill the text boxes)


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

WebBrowser1.Navigate(ComboBox1.Text)

WebBrowser1.Document.GetElementById("emailAddress" ).SetAttribute("type", login.Text)
WebBrowser1.Document.GetElementById("pswd").SetAtt ribute("type", login.Text)
WebBrowser1.Document.GetElementById("btn_login").I nvokeMember("click")

End Sub
__________________


"If at first you do succeed, try not to look astonished"

Ghst is offline   Reply With Quote
Old 02-07-2010, 06:44 AM   #2 (permalink)
Regular Member
 
waldo's Avatar
 
Join Date: Jan 2010
Posts: 43
Default

This should work:

PHP Code:
 Private Sub Button1_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles Button1.Click
        WebBrowser1
.Navigate(ComboBox1.Text)
    
End Sub

    
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As ObjectByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgsHandles WebBrowser1.DocumentCompleted
        WebBrowser1
.Document.GetElementById("emailAddress").SetAttribute("type"login.Text)
        
WebBrowser1.Document.GetElementById("pswd").SetAttribute("type"login.Text)
        
WebBrowser1.Document.GetElementById("btn_login").InvokeMember("click")
    
End Sub 
It will wait for the webbrowser to fully loaded before it send all those value.
waldo is offline   Reply With Quote
Old 02-07-2010, 08:57 AM   #3 (permalink)
Subscriber
GPT Earnings: $0.45
 
Ghst's Avatar
 
Join Date: Nov 2009
Posts: 73
Reputation: 0
Default Still Waiting

Thanks for your Time Waldo. Ok I tried the code under webbrowser1.Documents Complete. and No Dice. It navigates to the page then It just sits there. Could it be that the constantly changing Notice in the center of the page is not allowing the page to become inactive? Anyway Thanks for the help I sure need it. Oh this time it didn't flag any lines of code.Also I am running in debug mode in cast that may have something to do with it.
__________________

"If at first you do succeed, try not to look astonished"


Last edited by Ghst; 02-07-2010 at 09:02 AM.
Ghst is offline   Reply With Quote
Old 02-07-2010, 04:12 PM   #4 (permalink)
Regular Member
 
waldo's Avatar
 
Join Date: Jan 2010
Posts: 43
Default

Check this area of code:

PHP Code:
WebBrowser1.Document.GetElementById("emailAddress").SetAttribute("type"login.Text)
        
WebBrowser1.Document.GetElementById("pswd").SetAttribute("type"login.Text)
        
WebBrowser1.Document.GetElementById("btn_login").InvokeMember("click"
Tell me if you still stuck (I can give the correct code now. But if you want to learn, do it yourself first).
waldo is offline   Reply With Quote
Old 02-07-2010, 09:06 PM   #5 (permalink)
Subscriber
GPT Earnings: $0.45
 
Ghst's Avatar
 
Join Date: Nov 2009
Posts: 73
Reputation: 0
Default Ok I give

Waldo, I have tried all my reasonable options. I even tried this:



HTML Code:
 Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        WebBrowser1.Navigate(ComboBox1.Text)

        WebBrowser1.Document.GetElementById("emailAddress").SetAttribute("type", login.Text)
        WebBrowser1.Document.GetElementById("pswd").SetAttribute("type", login.Text)
        WebBrowser1.Document.GetElementById("btn_login").InvokeMember("click")
    End Sub
That causes quite a disturbance when it navigated to the website. Every thing started flickering and flashing But it still wouldn't fill those textboxes with the proper content.Also I found out that the Id=emailAddress should be Id=emailAddressLocal As seen In this source code of the login Box.

HTML Code:
<form name="frmLogIn-tbar" id="signInBoxLocal" method="post" action="/?cmd=sb-login&amp;from=/?cmd=home">
                        
                            <label class="loginLabel">Email Address or Swag Name:</label>
                            <input gtbfieldid="5" title="Enter your email address" name="emailAddress" id="emailAddressLocal" class="loginInput" onkeypress="return enterLoginTBLocal(event);" type="text">
                            <label class="loginLabel">Password</label>
                            <input title="Enter your password" name="pswd" id="pswdLocal" class="loginInput" onkeypress="return enterLoginTBLocal(event);" type="password">
                            <img src="/content/swagbucks-com/images/fbLogin_button.jpg" onclick="initFacebook(TBFCCallback);" class="btn-login" style="float: left; margin-right: 4px;" id="foo96"><img src="/content/swagbucks-com/images/login_button.jpg" onclick="logInTBLocal();" class="btn-login" style="float: left;"><div class="clear"></div>

                            <a href="#" onclick="sendEmailTBLocal(); return false" class="emailPass">Email Password</a>
                            <input name="persist" id="persistLocal" checked="checked" onkeypress="return enterLoginTBLocal(event);" class="persistBox" onchange="prettyCheckbox('persist',this)" type="checkbox">
                            <label for="persistLocal" class="persistLabel">Remember Me</label>
                            <div class="clear"></div> 
Ok please show me what I'm doing wrong. Thanks
__________________

"If at first you do succeed, try not to look astonished"

Ghst is offline   Reply With Quote
Old 02-07-2010, 10:01 PM   #6 (permalink)
Regular Member
 
waldo's Avatar
 
Join Date: Jan 2010
Posts: 43
Default

1. As you already noticed, the ids are: emailAddressLocal and pswdLocal.
2. So here are the code to fill the content of the textbox:
PHP Code:
WebBrowser1.Document.GetElementById("emailAddressLocal").SetAttribute("value"TextBox1.Text)
        
WebBrowser1.Document.GetElementById("pswdLocal").SetAttribute("value"TextBox2.Text
Do notice that there are 2 textbox there.

3. To send click is a little bit tricky as they use image as a button. But here you go:
PHP Code:
'collect all <img> tag name
        Dim elemCollec As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("img")
        '
iterate each <imgfound to look for unique string of the button
        
For Each tagname As HtmlElement In elemCollec
            Dim ctrlname 
As String tagname.GetAttribute("src").ToString   'get atribute with src
            If ctrlname.Equals("http://www.swagbucks.com/content/swagbucks-com/images/login_button.jpg") Then '
match with the buttin image
                tagname
.InvokeMember("click")   invoke click
            End 
If
        
Next 

The code above should work. Tell me if you need further help.
waldo is offline   Reply With Quote
Old 02-08-2010, 05:03 PM   #7 (permalink)
Subscriber
GPT Earnings: $0.45
 
Ghst's Avatar
 
Join Date: Nov 2009
Posts: 73
Reputation: 0
Default

I still can't get this to work. The login info is not being sent to the pages login form.What to do?
__________________

"If at first you do succeed, try not to look astonished"

Ghst is offline   Reply With Quote
Old 02-08-2010, 05:27 PM   #8 (permalink)
Regular Member
 
waldo's Avatar
 
Join Date: Jan 2010
Posts: 43
Default

Quote:
Originally Posted by Ghst View Post
I still can't get this to work. The login info is not being sent to the pages login form.What to do?
Show me your code.
waldo is offline   Reply With Quote
Old 02-08-2010, 07:11 PM   #9 (permalink)
Subscriber
GPT Earnings: $0.45
 
Ghst's Avatar
 
Join Date: Nov 2009
Posts: 73
Reputation: 0
Default

Here is all my code:

HTML Code:
Private Sub lblPass_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub


    Private Sub btnGet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGet.Click

        login.Show()

    End Sub

    Private Sub txtUser_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)


    End Sub

    Private Sub SwaggerLee1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        
    End Sub



    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        WebBrowser1.Navigate(ComboBox1.Text)

    End Sub


    Private Sub lblUser_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblUser.Click

    End Sub

    Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
       WebBrowser1.Document.GetElementById("emailAddressLocal").SetAttribute("value", lblUser.Text)
        WebBrowser1.Document.GetElementById("pswdLocal").SetAttribute("value", lblPass.Text)
                WebBrowser1.Document.GetElementById("btn_login").InvokeMember("click")
        'collect all <img> tag name
        Dim elemCollec As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("img")
        'iterate each <img> found to look for unique string of the button
        For Each tagname As HtmlElement In elemCollec
            Dim ctrlname As String = tagname.GetAttribute("src").ToString   'get atribute with src
            If ctrlname.Equals("http://www.swagbucks.com/content/swagbucks-com/images/login_button.jpg") Then 'match with the buttin image
                tagname.InvokeMember("click")
            End If
        Next
    End Sub


    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

    End Sub

    Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

    End Sub
       
End Class
I also tried ti add webbrowser1.Navigate.(signInBoxLocal) Between the "document complete" and the "webbrowser Get elements" commands. This intered the signinBoxLocal text into Swaggs search and it did a search for "signinBoxLocal" but still no login. Notice that I don't have TextBox1 and TextBox2 in my code because They haven't been declared. My lblUser = My.Username in my login text file.
__________________

"If at first you do succeed, try not to look astonished"

Ghst is offline   Reply With Quote
Old 02-09-2010, 01:58 AM   #10 (permalink)
Regular Member
 
waldo's Avatar
 
Join Date: Jan 2010
Posts: 43
Default

The only thing that I changed from your code was removing this line:

PHP Code:
WebBrowser1.Document.GetElementById("btn_login").InvokeMember("click"
The url that I used:
Code:
http://www.swagbucks.com
After I clicked button1, it navigate to the URL, and after finished loading, it send the username and password from the lblUser.Txt and lblPass.Txt. Then it click the login button.

Here is the full code:
PHP Code:
Private Sub Button1_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles Button1.Click
        WebBrowser1
.Navigate(ComboBox1.Text)
    
End Sub

    
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.ObjectByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgsHandles WebBrowser1.DocumentCompleted
        WebBrowser1
.Document.GetElementById("emailAddressLocal").SetAttribute("value"lblUser.Text)
        
WebBrowser1.Document.GetElementById("pswdLocal").SetAttribute("value"lblPass.Text)
        
'WebBrowser1.Document.GetElementById("btn_login").InvokeMember("click")
        '
collect all <imgtag name
        Dim elemCollec 
As HtmlElementCollection WebBrowser1.Document.GetElementsByTagName("img")
        
'iterate each <img> found to look for unique string of the button
        For Each tagname As HtmlElement In elemCollec
            Dim ctrlname As String = tagname.GetAttribute("src").ToString   '
get atribute with src
            
If ctrlname.Equals("http://www.swagbucks.com/content/swagbucks-com/images/login_button.jpg"Then match with the buttin image
                tagname
.InvokeMember("click")
            
End If
        
Next
    End Sub 
waldo is offline   Reply With Quote
Old 02-09-2010, 06:01 PM   #11 (permalink)
Subscriber
GPT Earnings: $0.45
 
Ghst's Avatar
 
Join Date: Nov 2009
Posts: 73
Reputation: 0
Default Well Now I have Half of it!

Ok I had to do a lot of finagling To get the code to this point. Surprisingly it was Your (waldo) button click code that helped me get both username and password to load into the site's text boxes. But I lack the code to click the login Button. any way here is the code so far.


HTML Code:
 Private username, password As String

    Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted

        Login(username, password)

    End Sub





    Private Sub Login(ByVal username As String, ByVal password As String)

        Dim theElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("Input")

        For Each curElement As HtmlElement In theElementCollection
            Dim controlName As String = curElement.GetAttribute("id").ToString
            If controlName = "emailAddressLocal" Then
                curElement.SetAttribute("Value", lblUser.Text)
            ElseIf controlName = "pswdLocal" Then
                curElement.SetAttribute("Value", lblPass.Text)
            End If
        Next
    End Sub
Is there any way to add another "If" for the invoke click?
__________________

"If at first you do succeed, try not to look astonished"

Ghst is offline   Reply With Quote
Old 02-09-2010, 06:36 PM   #12 (permalink)
Regular Member
 
waldo's Avatar
 
Join Date: Jan 2010
Posts: 43
Default

Quote:
Originally Posted by Ghst View Post
Is there any way to add another "If" for the invoke click?
Do you meant this?
PHP Code:
 Dim elemCollec As HtmlElementCollection WebBrowser1.Document.GetElementsByTagName("img")
        
'iterate each <img> found to look for unique string of the button
        For Each tagname As HtmlElement In elemCollec
            Dim ctrlname As String = tagname.GetAttribute("src").ToString   '
get atribute with src
            
If ctrlname.Equals("http://www.swagbucks.com/content/swagbucks-com/images/login_button.jpg")  Then match with the button image
                tagname
.InvokeMember("click")
            
End If
        
Next 
That code search for <img> tag and the loop will look for the image source and when it found, it invokes the click.
__________________
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
waldo is offline   Reply With Quote
Old 02-09-2010, 08:10 PM   #13 (permalink)
Subscriber
GPT Earnings: $0.45
 
Ghst's Avatar
 
Join Date: Nov 2009
Posts: 73
Reputation: 0
Default

I'm curious about this
Quote:
GetAttribute("src").ToString
What is "scr" when I tried the code as you posted it kept opening up 3 more windows to login to twitter, facebook and Yahoo Search. Then It would ask me my login info and start hitting me with several error messages. but I could tell that the button click was happening only repeatedly.Causing the windows that I closed to reopean. Anyway I think that your button click code has to be modified to get it to work. I'm gettin excited cause I can now see my username and pass in the boxes I just gotta figure how to send that click to the Button. Thanks So much for your helping me with this!
__________________

"If at first you do succeed, try not to look astonished"

Ghst is offline   Reply With Quote
Old 02-09-2010, 08:18 PM   #14 (permalink)
Regular Member
 
waldo's Avatar
 
Join Date: Jan 2010
Posts: 43
Default

That code is specifically for swagbucks login page since they use image as a button.

If it use normal button like twitter, then you can use any method that can be found in this section.
__________________
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
waldo is offline   Reply With Quote
Old 02-25-2010, 08:39 PM   #15 (permalink)
Subscriber
GPT Earnings: $0.45
 
Ghst's Avatar
 
Join Date: Nov 2009
Posts: 73
Reputation: 0
Default

Absolutely everything that I have tried has failed miserably in auto clicking the login button. Are there any suggestions?
__________________

"If at first you do succeed, try not to look astonished"

Ghst is offline   Reply With Quote
Old 02-27-2010, 09:15 AM   #16 (permalink)
Subscriber
GPT Earnings: $0.45
 
Ghst's Avatar
 
Join Date: Nov 2009
Posts: 73
Reputation: 0
Default

Here is the code that I'm trying to get to click the login Button. I've tried everything, That I can think of. I sure can use some help! There is a btn1 btnLogin that I've also tried from the source code but still no dice. Please HELP!



HTML Code:
        For Each curElement As HtmlElement In theWElementCollection
            Dim controlName As String = curElement.GetAttribute(" tagname").ToString
            If controlName = "frmLogIn-tbar" Then
                WebBrowser1.Document.GetElementById("btn1 btnlogin").InvokeMember("click")
            End If
        Next

        System.Threading.Thread.Sleep(1000)
__________________

"If at first you do succeed, try not to look astonished"

Ghst is offline   Reply With Quote
Old 02-27-2010, 12:25 PM   #17 (permalink)
Bot Leecher
 
Join Date: Feb 2010
Posts: 15
Reputation: 0
Default Swagbucks Login

http://thebotnet.com/third-party-bot...r-bots-in.html

With that post I was able to auto logon to swagbucks only problem is when I get to the successful logon page I get a ton of java script errors making it practically useless.
alkmie is offline   Reply With Quote
Old 03-05-2010, 05:31 PM   #18 (permalink)
Subscriber
GPT Earnings: $0.45
 
Ghst's Avatar
 
Join Date: Nov 2009
Posts: 73
Reputation: 0
Default I got it!

I finally have a auto logger! The solution was a simple one line of code added to the bottom of:


F
HTML Code:
or Each curElement As HtmlElement In theElementCollection
            Dim controlName As String = curElement.GetAttribute("id").ToString
            If controlName = "emailAddressLocal" Then
                curElement.SetAttribute("Value", lblUser.Text)
            ElseIf controlName = "pswdLocal" Then
                curElement.SetAttribute("Value", lblPass.Text)
            End If
        Next
No src image callin or href It is so simple even Ghst can do it!
__________________

"If at first you do succeed, try not to look astonished"

Ghst is offline   Reply With Quote
Old 03-06-2010, 10:13 AM   #19 (permalink)
Bot Leecher
 
Join Date: Feb 2010
Posts: 15
Reputation: 0
Default

CONGRAT!!!!! I know how frustrating the whole trial and error programming can be. And thanks for sharing the code also.

Just out of curiosity how are you going to get around the captchas? Sence they have updated ive only seen it happen one time so maybe it wont be a big deal.

I was thinking bout looking for the swagbuck pic after ever search and if it finds it stop searching and ding the user.

*Edit Can you plz post the full code?

This is what I have its add the user names but no click
Code:
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click

        Dim theElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("Input")

        WebBrowser1.Document.GetElementById("emailAddressLocal").SetAttribute("value", My.Settings.User)
        WebBrowser1.Document.GetElementById("pswdLocal").SetAttribute("value", My.Settings.Pass)
        'WebBrowser1.Document.GetElementById("btn_login").InvokeMember("click")
        'collect all <img> tag name
        Dim elemCollec As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("img")
        'iterate each <img> found to look for unique string of the button
        For Each curElement As HtmlElement In theElementCollection
            Dim controlName As String = curElement.GetAttribute(" tagname").ToString
            If controlName = "frmLogIn-tbar" Then
                WebBrowser1.Document.GetElementById("btn1 btnlogin").InvokeMember("click")
            End If
        Next

    End Sub

Last edited by alkmie; 03-06-2010 at 10:51 AM.
alkmie is offline   Reply With Quote
Old 03-06-2010, 01:50 PM   #20 (permalink)
Subscriber
GPT Earnings: $0.45
 
Ghst's Avatar
 
Join Date: Nov 2009
Posts: 73
Reputation: 0
Default

Here is the code that I worked my arse off to get! look at the invokemember click statement. It took several weeks to get this one line right.


HTML Code:
 Dim theWElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("Input")
        For Each curElement As HtmlElement In theWElementCollection
            Dim controlName As String = curElement.GetAttribute("id").ToString
            If controlName = "emailAddressLocal" Then
                curElement.SetAttribute("Value", lblUser.Text)
            ElseIf controlName = "pswdLocal" Then
                curElement.SetAttribute("Value", lblPass.Text)
                System.Threading.Thread.Sleep(3000)
                WebBrowser1.Document.InvokeScript("logInTBLocal")
            End If
Hope this Helps Giv Rep if this logs you on!
__________________

"If at first you do succeed, try not to look astonished"


Last edited by Ghst; 03-06-2010 at 01:52 PM.
Ghst is offline   Reply With Quote
Reply

Tags
auto, login, problems, swagbucks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Bot Problems Sidekick Bot Resources and Exploiting discussions. 6 12-25-2009 12:26 AM
[VB 08] No-Id Auto Login Help BotwiththeBest Programming 13 12-15-2009 02:51 PM
Lockerz - Grease Monkey - Auto Redemption / Auto Dailies / Auto Login Script 3roken Lockerz 21 12-07-2009 12:15 PM
Lockerz - Grease Monkey - Auto Dailies / Auto Login PTZ Script 3roken Lockerz 3 12-05-2009 01:36 PM


All times are GMT -7. The time now is 10:30 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.5.0 RC2
The Botting Network, ©2009