programer Posted March 17, 2011 Share Posted March 17, 2011 Hello, I´m new at AutoIt and program languages, and I have to make a script to log in to a site and click a button. And it has to do that in a hidden way, so nobody in front of the computer could see the script running. I´ve tried some things, but still have problems =( BlockInput (1) SplashTextOn("", "", 1440, 900, 0, 0, 0) I used SplashTextOn to hide the CMD.EXE window. Ugly! is there a better way to do that? Opt("WinTitleMatchMode", 2) run("C:\windows\system32\cmd.exe /c taskkill /f /im firefox.exe") WinWaitClose("C:\WINDOWS\system32\cmd.exe","") Taskkill to avoid other Firefox instances running, that could make a tab bar appear, or other problems. SplashTextOn("", "", 1440, 31, 0, 872, 0) To hide the taskbar, so nobody can see I will run FF. Very ugly. Any better way? Sleep(200) run("C:\Program Files\Mozilla Firefox\firefox.exe http://www.autoitscript.com/forum/") WinWaitActive("Mozilla Firefox","") WinSetTrans("Mozilla Firefox", "",1) WinSetTrans to make FF window invisible. Sleep(6000) Sleep to make sure the webpage has loaded. But sometimes it´s not enought, and the script continues before the page is loaded. WinActivate("AutoIt Forums - Mozilla Firefox","") WinSetState("AutoIt Forums - Mozilla Firefox","", @SW_MAXIMIZE) WinWaitActive("AutoIt Forums - Mozilla Firefox","") Send("{TAB}{TAB}{TAB}{TAB}{ENTER}") Sleep(4000) Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}USERNAME{TAB}PASSWORD{ENTER}") Sleep(3000) SplashOff() WinSetTrans("Mozilla", "",255) BlockInput (0) Before trying TAB and ENTER commands, I tried MouseClick, but I had a problem: people would see the mouse point "walking" on the screen! Well, more than the problems I said before, the biggest problem is: sometimes it works, sometimes not, because the the TAB command puts the cursor in the wrong field. =( Does anyone can help me? Here goes the entire code, if anyone could test it for me (without blockinput and killtask firefox parts) Thank you all! PS: i havent started working in the "time" part (run the script in a specific daytime). I accept sugestions too. I need to make the script run Firefox on Mondays, Wednesdays and Fridays, at 3:00PM ;BlockInput (1) SplashTextOn("", "", 1440, 900, 0, 0, 0) Opt("WinTitleMatchMode", 2) ;run("C:\windows\system32\cmd.exe /c taskkill /f /im firefox.exe") ;WinWaitClose("C:\WINDOWS\system32\cmd.exe","") SplashTextOn("", "", 1440, 31, 0, 872, 0) Sleep(200) run("C:\Program Files\Mozilla Firefox\firefox.exe http://www.autoitscript.com/forum/") WinWaitActive("Mozilla Firefox","") WinSetTrans("Mozilla Firefox", "",1) Sleep(6000) WinActivate("AutoIt Forums - Mozilla Firefox","") WinSetState("AutoIt Forums - Mozilla Firefox","", @SW_MAXIMIZE) WinWaitActive("AutoIt Forums - Mozilla Firefox","") Send("{TAB}{TAB}{TAB}{TAB}{ENTER}") Sleep(4000) Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}USERNAME{TAB}PASSWORD{ENTER}") Sleep(3000) SplashOff() WinSetTrans("Mozilla", "",255) BlockInput (0) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 17, 2011 Moderators Share Posted March 17, 2011 programer,And it has to do that in a hidden way, so nobody in front of the computer could see the script running.And why do you need the script to run like this? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
programer Posted March 17, 2011 Author Share Posted March 17, 2011 (edited) sorry...i had never joined a progamming/script forum, and as I said, I know nothing about programming and script.so, I don´t know how much people could consider a script "suspect".actually, u could ignore the "hidden" part. I just want it to work... may be "completely visible", if this is the only way.to answer your question: I dont want anyone to see that i´m logging in to a site, and that there is a acript that contains my password inside it and types my password. just for safety. but, as I said, this is not the main objetive. if I could make it work visible, it would be enough...programer,And why do you need the script to run like this? M23 Edited March 17, 2011 by programer Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 17, 2011 Moderators Share Posted March 17, 2011 programer, a acript that contains my password inside itDo you share this machine with anyone? Because if you do it is trivial to get your password and log in in your place. And it looks as if you want to automate your login here: run("C:\Program Files\Mozilla Firefox\firefox.exe http://www.autoitscript.com/forum/") so I suggest you read this before you go any further. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
programer Posted March 17, 2011 Author Share Posted March 17, 2011 programer, Do you share this machine with anyone? Because if you do it is trivial to get your password and log in in your place. And it looks as if you want to automate your login here: run("C:\Program Files\Mozilla Firefox\firefox.exe http://www.autoitscript.com/forum/") so I suggest you read this before you go any further. M23 In fact, in normal circunstances the machine is used only by me. But it´s in a room where someone could use it when i´m out (i´m at work). BUT these people don´t know much about computers, so I don´t think they could get my password this way. Well, if u could suggest a solution for this, I would be ok, but I think it´s not absolutely necessary right know. About the login automation, I am sorry for having not read the "Website abuse". I put the forum address in my script just as an example. Now I see that was the worst example I could use... Thank you. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 17, 2011 Moderators Share Posted March 17, 2011 programer,OK, let us start again as if none of the above existed. You want to code a script which logs you into a specific site using FireFox and you do not want anyone to see your password while this is going on.Is that a good description of your request?If so, then I suggest you use Stilgar's FF.au3 UDF which allows you to do lots of things with FireFox - if you have a certain plug-in (I do not use FireFox myself so I cannot be more specific). There is even a log-in function here. However, I repeat that putting your password into the script is NOT secure, although if you search the forum you will find a number of ways to make it as secure as possible within the encryption limits of AutoIt. I hope that helps.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now