[HELP] Hi - Bot help
HI,
Well, I'm making a bot for a browser game and I'm trying to shorten my code...
FOr example, I don't know why, I have to put this code in two seperated subs:
Can anyone tell me whats wrong? I have to put the part before the "sleep" in one sub, and them acctivate the other with a timer(ofc that I take the "sleep" when I use the timer)... the webpage needs some time to load the litlle window for me to sellect the world(thats why I need to wait/use timers)... Any ideas?
PS: this is the other Class (for the multithreding). Its pretty much the same as one that I saw in this forums (only some minor changes):
EDIT: I forgot to say that the sleep part works, cause it pops ups a message box, but it doesn't click the button for some reason... (Button inner Text is "Mundo 20")
Well, I'm making a bot for a browser game and I'm trying to shorten my code...
FOr example, I don't know why, I have to put this code in two seperated subs:
Code:
Public Sub LogIn()
Dim threadFreeze As System.Threading.Thread
Dim WithEvents threadFreezeMe As cFreezeME
WebBrowser1.Document.GetElementById("user").SetAttribute("value", "lala")
WebBrowser1.Document.GetElementById("password").SetAttribute("value", "lala")
WebBrowser1.Document.GetElementById("login_button").InvokeMember("click")
Dim threadFreezeMe As New cFreezeME
threadFreeze = New Threading.Thread(AddressOf threadFreezeMe.FreezeME)
threadFreeze.Start()
Dim elementList As HtmlElementCollection
Dim curElement As HtmlElement
elementList = WebBrowser1.Document.GetElementsByTagName("a")
For Each curElement In elementList
If curElement.GetAttribute("innerText").Equals("Mundo 20") Then
curElement.InvokeMember("click")
Next
End Sub
PS: this is the other Class (for the multithreding). Its pretty much the same as one that I saw in this forums (only some minor changes):
Code:
Public Class cFreezeME
Public Function FreezeME()
Threading.Thread.Sleep(5000)
Return MsgBox("Login done!")
End Function
End Class
EDIT: I forgot to say that the sleep part works, cause it pops ups a message box, but it doesn't click the button for some reason... (Button inner Text is "Mundo 20")


.