Darkorbit - Vb 2010 - Login

02/18/2017 23:01 ramicek43#1
Hi guys.
At first sorry for my english.
I want to share my login code for Darkorbit in Visual Studio 2010.
You will need:
2x - TextBox
1x - Button
1x - WebBrowser

When form load it navigate webbrowser to darkorbit. -
Quote:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebBrowser1.Navigate("http://www.darkorbit.com")
End Sub
This ll login you to darkorbit bot when you write username and password into TextBoxes.
Quote:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Document.GetElementById("bgcdw_login_f orm_username").SetAttribute("Value", TextBox1.Text)
WebBrowser1.Document.GetElementById("bgcdw_login_f orm_password").SetAttribute("Value", TextBox2.Text)

Dim allelements As HtmlElementCollection = WebBrowser1.Document.All

For Each webpageelement As HtmlElement In allelements

If webpageelement.GetAttribute("value") = "Login" Then

webpageelement.InvokeMember("click")

End If

Next
End Sub
IF YOU WANT ANY UPGRADES OR BETTER THINGS LIKE SKYLAB, AUCTION, ETC JUST TELL ME:-)
:mofo:
02/18/2017 23:13 jorg*#2
This shouldnt be here but in the coding section.
Correct me if im wrong...
02/18/2017 23:20 ramicek43#3
Ye you are right. i missed :-D

Im actually new so.
02/19/2017 01:01 Freshek#4
Thanks for sharing, but why do you use crap webbrowser? Use WebRequests.
02/19/2017 02:41 ~Demetrio~#5
Quote:
Originally Posted by ramicek43 View Post
Hi guys.
At first sorry for my english.
I want to:
Sharing too! :D

02/19/2017 12:08 Freshek#6
Quote:
Originally Posted by ~Demetrio~ View Post
Sharing too! :D

Code:
if (url.StartsWith("http"))
        {
            return "wrong";
        }
Why not just throw an exception after login error? Or put an event like OnLoginFailure. Also I think Regex would be better solution in find_str_from_to2.

Edit:
why do you use this.? It's not Java.

Code:
if (url.Equals("/indexInternal.es?action=internalStart"))
Use == operator.

Please improve your code using by tips. ;)
02/19/2017 12:20 ramicek43#7
Nver used WebRequest
i Thought that is more easy for begginers.
02/19/2017 17:45 ~Demetrio~#8
Quote:
Originally Posted by Freshek View Post
Code:
if (url.StartsWith("http"))
        {
            return "wrong";
        }
Why not just throw an exception after login error? Or put an event like OnLoginFailure. Also I think Regex would be better solution in find_str_from_to2.

Edit:
why do you use this.? It's not Java.

Code:
if (url.Equals("/indexInternal.es?action=internalStart"))
Use == operator.

Please improve your code using by tips. ;)

HAHAHAHA always Criticizing another jobs! :D

since is not my code i don't care , it's reflector. i just wanted to help to him.
02/19/2017 18:11 manulaiko3.0#9
Quote:
Originally Posted by Freshek View Post
Code:
if (url.StartsWith("http"))
        {
            return "wrong";
        }
Why not just throw an exception after login error? Or put an event like OnLoginFailure. Also I think Regex would be better solution in find_str_from_to2.

Edit:
why do you use this.? It's not Java.

Code:
if (url.Equals("/indexInternal.es?action=internalStart"))
Use == operator.

Please improve your code using by tips. ;)
Why you talking shit about other's code? It's as easy as ignoring the thread when you see in the name vb 2010
02/19/2017 18:37 orys#10
Code:
Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
WebBrowser1.Navigate("http://www.darkorbit.com/")
    End Sub

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

        Try
            WebBrowser1.Document.GetElementById("bgcdw_login_form_username").SetAttribute("value", textbox1.Text)
            WebBrowser1.Document.GetElementById("bgcdw_login_form_password").SetAttribute("value", textbox2.Text)
            For Each p As HtmlElement In WebBrowser1.Document.GetElementsByTagName("input")
                If p.GetAttribute("type") = "submit" Then
                    p.InvokeMember("click")


                End If
            Next
        Catch ex As Exception
            MsgBox("Error: " & ex.Message, MsgBoxStyle.Critical)
        End Try
    End Sub
End Class
02/19/2017 19:10 Freshek#11
Quote:
Originally Posted by manulaiko3.0 View Post
Why you talking shit about other's code? It's as easy as ignoring the thread when you see in the name vb 2010
Someone might just use this code in his project. I just gave him few tips how can he improve it. What's bad in it?
02/20/2017 00:00 YatoDev#12
Quote:
Originally Posted by jorg* View Post
This shouldnt be here but in the coding section.
Correct me if im wrong...
This thread should not exist in any ssection

Quote:
Originally Posted by Freshek View Post
Why not just throw an exception after login error? Or put an event like OnLoginFailure. Also I think Regex would be better solution in find_str_from_to2.

Edit:
why do you use this.? It's not Java.

Code:
if (url.Equals("/indexInternal.es?action=internalStart"))
Use == operator.

Please improve your code using by tips. ;)
I feel the abuse of event's here.

Also this url.Equals might be some weird compiler optimisation or just his crappy decompiler.

There are valid use cases to not use the == operator

Quote:
Originally Posted by ramicek43 View Post
SNIP
I also want to share some knowledge with you :)

Visual Basic is the programming language.
Visual Studio is the "IDE".
2010 is the edition of this "IDE".

It's not VB 2010. It is Visual Basic code produced in Visual Studio 2010 and probably you are compiling with the Visual Basic .Net 3.5 compiler

Quote:
Originally Posted by Freshek View Post
Someone might just use this code in his project. I just gave him few tips how can he improve it. What's bad in it?
No one should ever use ANY code provided in this thread
02/20/2017 18:18 ramicek43#13
Whats going on here..
i just tried to help begginers in VB
It is the most simple way i think so.
02/20/2017 19:27 manulaiko3.0#14
Quote:
Originally Posted by ramicek43 View Post
Whats going on here..
i just tried to help begginers in VB
It is the most simple way i think so.
You did nothing wrong, is just that there are people that whatever you do, they will try to find a flaw on it and tell you a better way.
When coding it's more obvious, not only in this section, but everywhere. Have you ever seen someone talk shit about a programming language? Generally Java is most hated one, Saying that java is nice because it works on all platforms is like saying that anal sex is fine because it works on all genres or I hate java because it's fucking slow, stupid crap, how many people do you think that actually hate a language because they have their own reason? 5? maybe 6? Rest are just talking shit because someone smarter than them said it so they try to look smarter. Me for example, I hate C# because of Micro$oft and its stupid one-line fixers that only leads to spaghetti code, yes, just for that, the rest is an over actuation of myself trying to look smarter because I try to point fails at someone else.

That's basically how the thing works here (or anywhere else). Once you see things like this you should ignore it and keep doing what you think it's the best.
02/21/2017 12:13 ramicek43#15
Quote:
Originally Posted by manulaiko3.0 View Post
You did nothing wrong, is just that there are people that whatever you do, they will try to find a flaw on it and tell you a better way.
When coding it's more obvious, not only in this section, but everywhere. Have you ever seen someone talk shit about a programming language? Generally Java is most hated one, Saying that java is nice because it works on all platforms is like saying that anal sex is fine because it works on all genres or I hate java because it's fucking slow, stupid crap, how many people do you think that actually hate a language because they have their own reason? 5? maybe 6? Rest are just talking shit because someone smarter than them said it so they try to look smarter. Me for example, I hate C# because of Micro$oft and its stupid one-line fixers that only leads to spaghetti code, yes, just for that, the rest is an over actuation of myself trying to look smarter because I try to point fails at someone else.

That's basically how the thing works here (or anywhere else). Once you see things like this you should ignore it and keep doing what you think it's the best.

yep i can see that..
I`m going to ignore them:-D

And the reason why I'm posting this is because i want to create dark orbit bot that do everything and this is CORE if someone want 2.
Everything means- betting on auction, skylab, upgrades and etc. I can do everything except Killing npc, boxing and etc.. I'm trying to find easy way like it is in CANDY BOT.
Still nothing so if someone have advice for me.
Would be great.
And again sorry for my english :mofo: