Jump to content

Can someone make a script for me?


Hedin_jr
 Share

Recommended Posts

Hi!

I cant code autoit but I want to use the program because it creates an exe. file that I can use on diffrent computers.

Can someone plese make a script for me? Its a simple taks i should perform.

I want to launch Internet Explorer.

Then go to a specific webadress.

Then log with a username and a password that appears when the webadress is entered.

After loggin in and the webpage is loaded I want to go to a specific link on a framed website.

After klicking on that link I want to press a button in a nother frame.

When you do that a new window opens and in that window I want to

press a button and wait 10 sek. and then press another button and wait 10 sek.

Then all internet windows should close.

The script is for restaring my parents router.

The dont know how to do it so I want to automate it for them.

Hope someone can help me with this.

/ Erik

Link to comment
Share on other sites

need some more details. Do you have comcast\netscape\netzero\etc. What does the title bar say exactly say and the site?

The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Link to comment
Share on other sites

need some more details. Do you have comcast\netscape\netzero\etc. What does the title bar say exactly say and the site?

Adress to type in the webadress field: 192.168.1.1

I have Internet Explorer browser and the titlebar after login in says: http://192.168.1.1 - Microsoft Internet Explorer

That kind of stuff can I change/complement later by my self if you can help me with the other stuff.

Thanx for your help.

// Hedin

Link to comment
Share on other sites

Hi!

I cant code autoit but I want to use the program because it creates an exe. file that I can use on diffrent computers.

Can someone plese make a script for me? Its a simple taks i should perform.

I want to launch Internet Explorer.

Then go to a specific webadress.

Then log with a username and a password that appears when the webadress is entered.

After loggin in and the webpage is loaded I want to go to a specific link on a framed website.

After klicking on that link I want to press a button in a nother frame.

When you do that a new window opens and in that window I want to

press a button and wait 10 sek. and then press another button and wait 10 sek.

Then all internet windows should close.

The script is for restaring my parents router.

The dont know how to do it so I want to automate it for them.

Hope someone can help me with this.

/ Erik

The help file shall set you free. Read it!

[quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD()

Link to comment
Share on other sites

Sorry for a stupid q, but did you mean the help file in the program?

Would be greatful if someone could help me anyway...

// Hedin

Yes. That file list every 'command' that you need to know to write your script. All you have to do is research it.

[quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD()

Link to comment
Share on other sites

If you want to reboot the Router, would it not be more simple to have them switch it off, wait 30sec then turn it back on?

Anyway if you know the BASIC language, then you can use Autoit.

Use the Autoit Window info tool to get the info you need from IE or which ever browser you are using.

Have Fun! :o

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

Food for thought: forums like this have a kind of problem-solving meritocracy prestige system. It's pretigious to solve someone else's task if the task has merit and if they haven't succeeded in doing it themself, but what if they don't try?

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

Food for thought: forums like this have a kind of problem-solving meritocracy prestige system. It's pretigious to solve someone else's task if the task has merit and if they haven't succeeded in doing it themself, but what if they don't try?

I've tried to solve it and I can make it through the login but then I'm stuck.

I don't know any programming but HTML.

They can go and turn the router off manually but they have to go out and go 50 meters, go in to

my garage and then push the off button. They dont want to do that...

// Hedin

Link to comment
Share on other sites

Many routers have a tool program for updating their firmware; a side-effect of flashing the firmware is that the router reboots. You could just send the same firmware binary every time you want to reboot. There's an unknown amount of peril in flashing you firmware however often this might be, but the process would be simpler to automate than navigating the links in a browser...

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

Well. Here is what I got right now. It's not pretty, it's not much of programming

skills but it does the job. Can anyone help me make it better and with better code?

-->

$var = "192.168.1.1"

run("C:\Program\Internet Explorer\iexplore.exe " & $var)

WinWaitActive("Ansluta till 192.168.1.1")

Send("username")

Send("{TAB}")

Send("password")

Send("{ENTER}")

WinWaitActive("http://192.168.1.1/cgi-bin/index.html")

Sleep(50)

Send("{TAB}")

Sleep(500)

Send("http://192.168.1.1/cgi-bin/maintenance_status.html")

Sleep(2000)

Send("{ENTER}")

Sleep(3000)

Send("{TAB}")

Sleep(50)

Send("{TAB}")

Sleep(50)

Send("{TAB}")

Sleep(50)

Send("{TAB}")

Sleep(50)

Send("{TAB}")

Sleep(50)

Send("{ENTER}")

Sleep(5000)

Send("{TAB}")

Sleep(50)

Send("{TAB}")

Sleep(50)

Send("{TAB}")

Sleep(50)

Send("{TAB}")

Sleep(50)

Send("{TAB}")

Sleep(50)

Send("{ENTER}")

Sleep(10000)

WinKill ( "Connection Status")

Link to comment
Share on other sites

You might try skipping a few steps by starting out with this page:

$var = "http://192.168.1.1/cgi-bin/maintenance_status.html"

If you can determine the "web address" of the link that you are tabbing to, then you might be able to skip to that link instead.

If you can stand to read this rather long post:

http://www.autoitscript.com/forum/index.php?showtopic=14395

it might show you how to improve your "tabbing"...

...or it might just put you to sleep.

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

You might try skipping a few steps by starting out with this page:

$var = "http://192.168.1.1/cgi-bin/maintenance_status.html"

If you can determine the "web address" of the link that you are tabbing to, then you might be able to skip to that link instead.

If you can stand to read this rather long post:

http://www.autoitscript.com/forum/index.php?showtopic=14395

it might show you how to improve your "tabbing"...

...or it might just put you to sleep.

Thanx for you answer. It didn't come to my mind that I could ask for that

adress at once. I thought I had to go through the "startpage" to get the

login to work. I must try to do that. Maybe it will say that login is needed...

// Hedin

Link to comment
Share on other sites

I found this code on that page:

Do; This loop repeats the code between the Do and Until lines.

Send("{TAB}")

Sleep(50); <<Slows the loop down, change the speed here.

Until WinExists("Sign in to Yahoo", "std_lib")

; See the notes at the end of the script.

Does it tab until it finds a link named "Sign in to Yahoo"? what does the std_lib stand for?

Link to comment
Share on other sites

I found this code on that page:

Do; This loop repeats the code between the Do and Until lines.

Send("{TAB}")

Sleep(50); <<Slows the loop down, change the speed here.

Until WinExists("Sign in to Yahoo", "std_lib")

; See the notes at the end of the script.

Does it tab until it finds a link named "Sign in to Yahoo"? what does the std_lib stand for?

That loop "tabs around" until a window exists with the partial title of "Sign in to Yahoo" and text in that window of "std_lib". [When I say "text in that window" - it happens to be text within IE's status bar in the lower left part of IE's window.]

You should be able to see this if you will:

1) Turn "ON" the Status Bar within IE - if it is OFF. (From the IE Menu bar, select "View". If there is already a check mark to the left of the term "Status Bar", then consider it to be "ON". If there is no check by the term "Status Bar", then click on "Status Bar" to toggle the check mark.)

2) Manually go to mail.yahoo.com.

3) Manually "tab around" and notice the text that appears in IE's status bar* --- "std_lib" is just one small part of a link that appears in the status bar - it is unique to that link - no other link on that page has "std_lib" in it... I hope.

*You might need the AutoIt Window Info tool to see all of the info in the status bar.

When AutoIt "sees" a window with that title and that status bar text - it knows to stop "tabbing" - per that loop. [Normally, I would use the entire link in my code as the window text, but long lines of code do not post well to the forum. In the "Yahoo code" that I referenced, I was not looking for the link to click on; I was just using it as a reference to tab back up to a field. I pointed you there in case you come to a link in your scripting quest that does not allow direct access - meaning you must go to one web page and "click on a link" to get to another web page.] Not to sound too arrogant, but if you will pour over each line of that post, I think that you will learn most of what you need in order to write your current script - if not, post back.

Like I said in that rather long post that I referenced, you can slow that loop down, run that code and you will see the text change in the status bar. That is what I keyed off of.

Hope this helps

@Others,

Before I get flamed - I know about StatusbarGetText and I mention it in the post I referenced. I also discuss AutoItSetOption("WinDetectHiddenText", 1) and IE.au3. Its not that Im not paranoid it is just that everyone is out to get me. :-)

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

@Others,

Before I get flamed - I know about StatusbarGetText and I mention it in the post I referenced. I also discuss AutoItSetOption("WinDetectHiddenText", 1) and IE.au3. Its not that Im not paranoid it is just that everyone is out to get me. :-)

:o I think you rocked! If some one run their mouth at you we will all have to gaing up and go ninja on them! :geek: And then bonk them on the head!! ;)

[quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD()

Link to comment
Share on other sites

...go ninja on them!

You humor and emoticons made me smile, however I really should clarify that I really did not expect to be flamed. The "Others" here have been nothing but helpful and most tolerant of my self-taught and unprofessional coding methods. It was just my way of telling the "Others" (who might not have read thru my ramblings in the long referenced post) that I did not suggest StatusbarGetText for a reason and that I did discuss the hidden text issue needed to deal with a hidden IE status bar.

IE.au3 is still the best way to go... there would not have to be any windows showing, the IE.au3 method can know when each page has "loaded". It is quick, clean, reliable and over the head of some new scripters.

Getting flamed and being paranoid was just a joke. :-)

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...