
roc
Members-
Posts
10 -
Joined
-
Last visited
roc's Achievements

Seeker (1/7)
0
Reputation
-
I would like the Send("{ENTER}") to be at a specific time. How could I make this work. This is what I have tryed. Thank you Case Send ; Wait until required time $sReqTime = "23:59:59" ; 1 secs before midnight Do ; Wait 1 sec Sleep(1000) Until @HOUR & ":" & @MIN & ":" & @SEC = $sReqTime ; send Send("{ENTER}")
-
Thank you very much Spiff59. This is better then I was thinking. It is perfect. The people in this forum are great! Thank you everyone.
-
Thank you very much. Is there anyway I can make my $date1 time that I select the $sReqTime? So I may have some flexibility with when the script starts. Thank you again
-
I have been working on a program and have it almost done, thanks to help from this great comunity. I just have one more thing I need to add. I have made a script that will login to a website, navigate to the appropriate page and input a date in the field and press the enter button for me.why im asleep or not around. (Background- At my work we have to request leave online, there is very stiff competition sense we can only submit our leave one year in advance. So many people stay up to midnight to put in for leave a year out. I made a script to do it for me. I have everything working except for, I have added a date box where I can pick the time I would like the program to run at. I just can't figure out how to make the script wait until the time before it starts. Is there away to make a program wait or sleep until a specific time? Can someone lead me in the right direction? I have no idea what I’m doing. #include <ButtonConstants.au3> #include <DateTimeConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiDateTimePicker.au3> #include <IE.au3> #Region ### START Koda GUI section ### Form=c:\users\boss\desktop\form2.kxf $Form2 = GUICreate("ALR", 265, 245, 320, 253) GUISetIcon("D:\004.ico") $Button1 = GUICtrlCreateButton("&Get my leave", 94, 203, 75, 25, $WS_GROUP) GUIStartGroup() $Date2 = GUICtrlCreateDate("", 88, 16, 90, 21) $hDTP = GUICtrlGetHandle($Date2) _GUICtrlDTP_SetFormat($hDTP, "MM/dd/yyyy") $Label2 = GUICtrlCreateLabel("Date you would like leave", 72, 48, 126, 17) $Input1 = GUICtrlCreateInput("", 72, 136, 121, 21) ; password $Label1 = GUICtrlCreateLabel("Password", 104, 176, 50, 17) $Label3 = GUICtrlCreateLabel("Time to run script", 88, 104, 85, 17) $Date1 = GUICtrlCreateDate("23:59:45", 88, 72, 90, 21, BitOR($DTS_UPDOWN,$DTS_TIMEFORMAT,$WS_TABSTOP)) GUIStartGroup() GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ; pass date,password as parameters of function MyLeave(GUICtrlRead($Date2), GUICtrlRead($Input1)) EndSwitch WEnd Exit #cs ---------------------------------------------------------------------------- Author: Justin Script Function: ALR- Auto Leave Request start 14 seconds prior to the hour #ce ---------------------------------------------------------------------------- ; Script Start - Leave request code Func MyLeave($sDate, $sPassword) $sUsername = "myname" ;~ $sPassword = "my password" $sUrl = "https://website.com" $oIE = _IECreate($sUrl, 0, 1, 0, 1) Sleep(2000) $oHWND = _IEPropertyGet($oIE, "hwnd") WinSetState($oHWND, "", @SW_MAXIMIZE) $oForm = _IEFormGetCollection($oIE, 0) $oUsername = _IEFormElementGetObjByName($oForm, 'hprLogin$adUserName') $oPassword = _IEFormElementGetObjByName($oForm, "hprLogin$adPass") _IEFormElementSetValue($oUsername, $sUsername) _IEFormElementSetValue($oPassword, $sPassword) Sleep(500) MouseClick("left", 500, 500) Sleep(500) Send("{tab}") Send("{ENTER}") Sleep(6000) _IENavigate($oIE, "https://website.com") Sleep(4000) MouseClick("left", 400, 500) Sleep(200) ;~ $sDate = "06/29/2011" $oHWND = _IEPropertyGet($oIE, "hwnd") WinSetState($oHWND, "", @SW_MAXIMIZE) $oForm = _IEFormGetCollection($oIE, 0) $oDate1 = _IEFormElementGetObjByName($oForm, "date1") $oDate2 = _IEFormElementGetObjByName($oForm, "date2") _IEFormElementSetValue($oDate1, $sDate) _IEFormElementSetValue($oDate2, $sDate) Sleep(200) MouseClick("left", 500, 500) Sleep(200) Send("{ENTER}") EndFunc
-
Thank you guys very much for your help.
-
sorry I didnt know where to put the post.
-
I have made a script that will login to a website, navigate to the appropriate page and input a date in the field and press the enter button for me. (Background- At my work we have to request leave online, there is very stiff competition sense we can only submit our leave one year in advance. So many people stay up to midnight to put in for leave a year out. I made a script to do it for me. Now I want to get a GUI for it) I have made the GUI that allows me to select the date I want and to put in the password for the website. I just cant get the GUI and the script to work together. Can someone lead me in the right direction? I have no idea what I’m doing. I have included the script and the GUI bellow, Thank you for your time. GUI, #include <ButtonConstants.au3> #include <DateTimeConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\boss\desktop\form2.kxf $Form2 = GUICreate("ALR", 265, 245, 320, 253) GUISetIcon("D:\004.ico") $Button1 = GUICtrlCreateButton("&Get my leave", 94, 187, 75, 25, $WS_GROUP) GUIStartGroup() $Date2 = GUICtrlCreateDate("2010/06/21 17:58:58", 48, 32, 186, 21) $Label2 = GUICtrlCreateLabel("Date you would like leave", 72, 72, 126, 17) $Input1 = GUICtrlCreateInput("", 72, 120, 121, 21) $Label1 = GUICtrlCreateLabel("Password", 104, 152, 50, 17) GUIStartGroup() GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Script, #cs ---------------------------------------------------------------------------- Author: Justin Script Function: ALR- Auto Leave Request start 14 seconds prior to the hour #ce ---------------------------------------------------------------------------- ; Script Start - Leave request code #include<IE.au3> $sUsername = "My user name" $sPassword = "my password" $sUrl = "https://website.com" $oIE = _IECreate($sUrl, 0, 1, 0, 1) Sleep(2000) $oHWND = _IEPropertyGet($oIE, "hwnd") WinSetState($oHWND, "", @SW_MAXIMIZE) $oForm = _IEFormGetCollection($oIE, 0) $oUsername = _IEFormElementGetObjByName($oForm, 'hprLogin$adUserName') $oPassword = _IEFormElementGetObjByName($oForm, "hprLogin$adPass") _IEFormElementSetValue($oUsername, $sUsername) _IEFormElementSetValue($oPassword, $sPassword) Sleep(500) MouseClick( "left" , 500, 500 ) Sleep(500) Send("{tab}") Send("{ENTER}") Sleep(6000) _IENavigate ($oIE, "https://thewebsite.com") Sleep(4000) MouseClick( "left" , 400, 500 ) Sleep(200) #include<IE.au3> $sDate = "06/29/2011" $oHWND = _IEPropertyGet($oIE, "hwnd") WinSetState($oHWND, "", @SW_MAXIMIZE) $oForm = _IEFormGetCollection($oIE, 0) $oDate1 = _IEFormElementGetObjByName($oForm, "date1") $oDate2 = _IEFormElementGetObjByName($oForm, "date2") _IEFormElementSetValue($oDate1, $sDate) _IEFormElementSetValue($oDate2, $sDate) Sleep(200) MouseClick( "left" , 500, 500 ) Sleep(200) Send("{ENTER}")
-
Where I work we are only allowed to put in for leave 365 day in advance. So I made a little script that will login to the web site that we request leave from, and automaticly put in for leave for me. On some days there is great compition to get leave. Manny people stay up to midnight to put in for day off a year in advance. My script is getting my leave request in about 15 seconds after midnight I need it to hit the enter button at 12:00:00. I would like to get my script to hit the enter button at specific time like 12:00:00 midnight. I just dont know how to do that. any guidance would be helpful. Thank you ROC
-
I have completed my first script today. It is very simple. It opens internet explorer logs into a web site, navigates to a different page, inputs text into fields on a form, and then submits. Now what I would like to do is make a control panel where I can open a program, and can change the information that is imputed into the fields to be submitted in my script. Can some one please provide me with some direction and guidance with this. Thank you.
-
This is my first script and I need some help. I just want to be able to have the script open and login to the web site for me. this is what I have so far. I have change the user, password, and website to test. ; Script Start - Add your code below here #include <IE.au3> Local $oUser, $oPass, $oSubmit Local $sUser = "TEST" Local $sPass = "TEST" Local $url = "https://test.com/Login/" Local $oIE = _IECreate($url, 1) _IELoadWait($oIE) $oInputs = _IETagNameGetCollection($oIE, "input") for $oInput in $oInputs if $oInput.type = "text" And $oInput.name="hprLogin$adUserName" And $oInput.id="hprLogin_adUserName" And $oInput.size = "12" Then $oUser = $oInput if $oInput.type = "password" And $oInput.name="hprLogin$adPass" And $oInput.id="hprLogin_adPass" And $oInput.size = "12" Then $oPass = $oInput if $oInput.type = "submit" And $oInput.name="hprLogin$btnSubmit" And $oInput.value="Login" Then $oSubmit = $oInput if isObj($oUser) And isObj($oPass) And isObj($oSubmit) then exitloop Next $oUser.value = $sUser $oPass.value = $sPass _IEAction($oSubmit, "click") _IELoadWait($oIE) And the view source info I think this is all that will be needed. Thank you for your help. ; Script Start - Add your code below here #include <IE.au3> Local $oUser, $oPass, $oSubmit Local $sUser = "TEST" Local $sPass = "TEST" Local $url = "https://test.com/Login/" Local $oIE = _IECreate($url, 1) _IELoadWait($oIE) $oInputs = _IETagNameGetCollection($oIE, "input") for $oInput in $oInputs if $oInput.type = "text" And $oInput.name="hprLogin$adUserName" And $oInput.id="hprLogin_adUserName" And $oInput.size = "12" Then $oUser = $oInput if $oInput.type = "password" And $oInput.name="hprLogin$adPass" And $oInput.id="hprLogin_adPass" And $oInput.size = "12" Then $oPass = $oInput if $oInput.type = "submit" And $oInput.name="hprLogin$btnSubmit" And $oInput.value="Login" Then $oSubmit = $oInput if isObj($oUser) And isObj($oPass) And isObj($oSubmit) then exitloop Next $oUser.value = $sUser $oPass.value = $sPass _IEAction($oSubmit, "click") _IELoadWait($oIE)