Jump to content

Wait for key press


Aassdd
 Share

Recommended Posts

I'm making an auto login script for websites and since I'm using firefox which is not supported like ie...

Case $msg = $tray_logins_***
            ShellExecute("http://***/ucp.php?mode=login")
            WinWaitActive("***")
            Sleep(3000)
            Send("Username:{Tab}")
            Sleep(100)
            Send("username{Tab}password{Enter}")

I want to replace sleep(3000) with wait-for-key-press. How can I do this?

Link to comment
Share on other sites

So you are going to have your password in the script? Not wise. You are better off letting Firefox save your form history and passwords, at least then they will be encrypted. This way you can just navigate to the website and it will auto-login.

Link to comment
Share on other sites

Case $msg = $tray_logins_***
            ShellExecute("http://***/ucp.php?mode=login")
            WinWaitActive("***")
            while 1
                        if _ispressed("7B") then exitloop
                        sleep(200)      
            wend
            Send("Username:{Tab}")
            Sleep(100)
            Send("username{Tab}password{Enter}")

---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Link to comment
Share on other sites

Sorry but where can I find the hex keys?

If i'm right, and 97 = a then it doesn't work because nothing happens when I press a.

EDIT: I want space.

0x7B is F12

You might find this useful for key codes

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

So you are going to have your password in the script? Not wise. You are better off letting Firefox save your form history and passwords, at least then they will be encrypted. This way you can just navigate to the website and it will auto-login.

Off topic but, I like the picture on your 'empty' website. Are the snowflakes made using the snowflake udf posted at the end of last year? And just out of interest, is the picture one you took?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Off topic but, I like the picture on your 'empty' website. Are the snowflakes made using the snowflake udf posted at the end of last year? And just out of interest, is the picture one you took?

I sent you a PM

Link to comment
Share on other sites

Oops, I'm sorry.

When I opened the page I scrolled down (with the end key) to see the latest post. I read weaponx's post and then the previous post but didn't see the "0x7B is F12. You might find this useful for key codes" post.

PS: Thanks :D

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...