1.

Solve : log in bot??

Answer»

i hope i do this right XD

I want to make a script that will can log into my account and then logout/close IE, then make a loop so it will repeat itself :3
But i'm pretty new with this, and i can only make a script that will open IE and log me into the account :3

set a = createobject("wscript.shell")
a.run "inset URL here"
wscript.sleep (5000)
a.sendkeys ("inset username")
a.sendkeys chr(9)
wscript.sleep (2000)
a.sendkeys ("inset Password")
a.sendkeys "{Enter}"
call msgbox("all done :3")
wscript.quit
This may help. Sendkeys can be useful in limited circumstances, but sometime it's easier to create an object (Internet Explorer) and use it's built-in properties and methods.

Code: [Select]Set a = createobject("wscript.shell")
Set IE = CreateObject("InternetExplorer.Application")

For i = 1 To 3
IE.Navigate "inset URL here"
Do Until IE.ReadyState = 4
WScript.Sleep 1000
Loop
IE.Visible = True

WScript.sleep (5000)
a.sendkeys ("inset username")
a.sendkeys chr(9)
WScript.sleep (2000)
a.sendkeys ("inset Password")
a.sendkeys "{Enter}"
WScript.Sleep 2000
a.SendKeys "%{F4}"
Call msgbox("all done : " & i)
WScript.Sleep 2000
Next

IE.Quit
wscript.quit

Good luck. use a tool like wget/curl to do internet automation, like getting web pages and doing basic authentication etc... you don't have to worry about which browser to use and other dependencies (eg slow IE opening etc ).thanks but there seems to be an ERROR in the script >>
my plan was to make an logincounter raise but it seems harder than i thoughtQuote from: cookiemonster on September 20, 2010, 02:46:05 AM

thanks but there seems to be an error in the script >>
my plan was to make an logincounter raise but it seems harder than i thought

Could you be more specific. What is the exact error message you're getting? If it's a logic error please EXPLAIN. The logincounter is the i variable which iterates sequentially from ONE to three and controls how may TIMES the loop is executed (3). It is also displayed in the msgbox while the loop is active.

I cannot reproduce any errors, but perhaps if we knew the URL, it would help determine how the site is navigated. There is a VBScript object alternative to using IE.

Let us know.


Discussion

No Comment Found