Jump to content

NTBM

Active Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by NTBM

  1. Thankyou for your response. i had searched and found lots of pages but not that one, thankyou. if it helps, the important part is Data3 = {a hidden field value that is random with each page load} so i assume that the web enabled device is parsing the three variables to the script before submitting them. Form Data from web device <form NAME="Form1" ACTION="/tgi/page1.tgi" METHOD="post"> <center> <table NAME="myTable" ALIGN="center" CELLPADDING="10" WIDTH="96%" CELLSPACING="0"> <tr ALIGN="left" VALIGN="top"> <td COLSPAN="2"><font SIZE="2" FACE= "Arial, Helvetica, sans-serif">Please enter Data1 &amp; Data2.</font></td></tr> <tr ALIGN="left" VALIGN="top"> <td><font FACE="Verdana,Arial"><font SIZE="-1">Data1</font></font></td> <td><input TYPE="text" NAME="Data1" VALUE="" SIZE="32" MAXLENGTH="32"></td></tr> <tr ALIGN="left" VALIGN="top"> <td HEIGHT="46"><font FACE="Verdana,Arial"><font SIZE= "-1">Data2</font></font></td> <td HEIGHT="46"><input TYPE="text" NAME="Data2" VALUE="" SIZE="32" MAXLENGTH="32"></td></tr> <tr ALIGN="left" VALIGN="top"> <td></td> <td> <p ALIGN="center"><input ONCLICK="calcResponse(); return false;" TYPE="Submit" NAME="Submitbtn" VALUE=" OK "> <input TYPE="button" NAME="Cancel" VALUE=" Cancel " ONCLICK= "data1.value='';data1.value=''"> </p></td></tr></table></center> <input TYPE="hidden" NAME="Challenge" VALUE= "hS0r...."> <input TYPE="hidden" NAME="Response" VALUE=""> </form> The Value of <input TYPE="hidden" NAME="Challenge"..> is random and but i can get it using winhttp Having next to no working knowledge of java script or MD5, what i am trying to figure out is if simply adding them all together and then creating an MD5 hex hash will give an answer that the web page will accept, or do i need (if possible) to parse it to the java script of the page?
  2. I have a site that requires a valid md5 checksum to be given back to it in a form post, I am trying to utilize winhttp to pass the form data but need assistance with the md5 checksum. The page source code:- <script LANGUAGE="javascript" SRC="/md5.js" TYPE="text/javascript"> </script> <script LANGUAGE="javascript" TYPE="text/javascript"> function calcResponse() { str = Data1.value + Data2.value + Data3.value; Response.value = hex_md5(str); document.data.submit(); } </script> Is there a way that I can generate the required md5 to pass back in a _WinHttpSimpleFormFill command? Regards
  3. I am trying to write an app to auto login to a website and then send commands to it. The website is an internal to an ip controlled relay box (allows switching devices on/off via website) i have done it with a gui that calls an ie session however this is ugle and would like to do it outside of ie. here is the html of the login screen <title>IP Family</title> <center> <p align="left"><font color="#0033ff" size="5" face="Verdana, Arial, Helvetica, sans-serif"><em><strong><font size="4">Aviosys Inc.</font></strong></em></font></p> <p align="left"><font size="+1" face="Georgia,Arial"><font color="#0000ff" size="+2" face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#000000" size="4" face="Arial"><b>Welcom to IP Family WebControl</b></font></strong></font></font></p> <table border="0" width="392" bgColor="#dfdfdf" align="left"> <tbody><tr> <td noWrap=""> <form method="post" name="login" action="/tgi/login.tgi"> <center> <table cellSpacing="0" cellPadding="10" width="96%" align="center" NAME="myTable"> <tbody><tr vAlign="top" align="left"> <td colSpan="2"><font size="2" face="Arial, Helvetica, sans-serif">Please enter User name &amp; Password. (maximum = 8)</font></td></tr> <tr vAlign="top" align="left"> <td><font face="Verdana,Arial"><font size="-1">User Name</font></font></td> <td><input name="Username" maxLength="32" value="admin" size="32" type="text"></td></tr> <tr vAlign="top" align="left"> <td height="46"><font face="Verdana,Arial"><font size="-1">Password</font></font></td> <td height="46"><input name="Password" maxLength="32" value="" size="32" type="password"></td></tr> <tr vAlign="top" align="left"> <td></td> <td> <p align="center"><input onclick="calcResponse(); return false;" name="Submitbtn" value="&#9; OK&#9; " type="Submit"> <input onclick="document.login.Username.value='';document.login.Password.value=''" name="Cancel" value=" Cancel " type="button"> </p></td></tr></tbody></table></center> <input name="Challenge" value="k7n....." type="hidden"> <input name="Response" value="" type="hidden"> </form></td></tr> <tr> <td> <p align="right"><a href="http://www.aviosys.com" target="_blank">www.aviosys.com</a></p></td></tr></tbody></table> </center> and here is the code i have so far <snip> this results in a failed login screen, which i think is due to the shallange field but am unsure where to go from here? Any advise would be great. Cheers
  4. Yeah thats what i thought. never used it either, about to post a question on it..... ahhhhh my head hurts
  5. sorry Admiral, your post wasnt there when i started to type my reetraction due to my brain freeze. no the user needs to enter in an IP (if changed from default) the script then controls a web interface to a ip relay device to switch lights on and off. but maybe you can give me some idea of an alternative. currently i am controlling it via ie as per $oIE = ObjCreate("Shell.Explorer.2") ;Turn 4 on, and 3 off $oIE.navigate("http://" & GUICtrlRead($I_IP) & "/SetIO?p64=1+p63=0") $xCounter = 0 Do $xCounter = $xCounter + 1 if $xCounter = 11 then $oIE.navigate("http://" & GUICtrlRead($I_IP) & "/SetIO?p64=0+p63=0") MsgBox(0,"Error","Red xCounter=" & $xCounter & @CR & "http://" & GUICtrlRead($I_IP) & "/SetIO?p64=1+p63=0") Exit EndIf $body = _IETagNameGetCollection($oIE, "body", 0) $Check = StringInStr($body.innerText, "64=1") if $Check > 0 Then $Check = StringInStr($body.innerText, "63=0") EndIf Sleep(200) Until $Check > 0 as you can see this passes a username and password to the page (dont care about security). Then it looks at the page for the reponse. IE by default now days does not allow passing of user I would like to do this without relying on IE. Any idea's?
  6. My bad feeling a little foolish. Just realized that i wasnt reading the value, was mearly displying the context.id Msgbox should have been msgbox(0, "IP", GUICtrlRead($I_IP)) sorry for wasting your time
  7. This seems so simple but i cannot find an answer in either the forum or help file. i am creating a Gui that has an input box which displays a default IP address, however when i reference the variable i get returned a different value. see $Label6 = GUICtrlCreateLabel("IP Address", 34, 160, 55, 17) $I_IP = GUICtrlCreateInput("10.0.0.2", 96, 160, 121, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### MsgBox(0,"IP", String($I_IP)) Obviously there are more gui lines above this but what i have put above has no missing lines (so that you can see that the variable is not getting re-valued anywhere). When i run this the msgbox says the value is "16" What am i missing ? Cheers guys.
  8. i am trying to get the current date and time of a selected email. This will be used later for saving it out to a .msg file. i have the script below that will list all the receivedtime for messages in the inbox, but what i am trying to achieve is to switch to outlook (dont care what folder the user is in) and get the timestamp for the item that is selected on their screen. Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",1) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) #include <date.au3> #include <IE.au3> WinWait("Outlook","") If Not WinActive("Outlook","") Then WinActivate("Outlook","") WinWaitActive("Outlook","") Global $olFolderInbox = 6, $sSender = "anyone@anywhere.net.au", $sSubjectSTOP = "sSENTRY STOP", $sSubjectSTART = "sSENTRY START", _ $sSTime, $sSFlag, $receive $o_Outlook = ObjCreate("Outlook.Application") $oNameSpace = $o_Outlook.GetNameSpace("MAPI") $oInbox = $oNameSpace.GetDefaultFolder($olFolderInbox) $oItems = $oInbox.Items For $oItem In $oItems $receive = $oItem.ReceivedTime MsgBox(0,'',"The Date is:" & $receive) Next
  9. i just found this http://www.autoitscript.com/forum/index.php?showtopic=42455&st=0&p=315776&hl=keysequence&fromsearch=1&#entry315776 which does come close however it appears that the script terminates after the first occurance of the sequence and i cant see why. also this may be difficult to adapt as i have many key sequences that i want to trigger.
  10. I used to use a program called automate (unisys) to perform most of my auto functions, then i discovered autoit. i still use automate only to launch scripts from hotkeys and also key sequences. i would like to replace this with a simple always running script in the backbround that would do the same thing. Hotkeys no problem using the HotKeySet function however we use a lot of keysequence controls, can i do this? example the user may be in an application and type "{space}tok{space}" the script would then automatically fire and cut that text out and replace it with "{space}tesked ok with client{space}". i have looked at the _IsPressed function however it seems to only work for a single key, so i thought i could loop it to store the last 10 keys then run a find with in that for the triggers, however i am thinking that this would cause a significant performance issue as you keep capturing every key and then sending them back to the screen...... any thoughts on how i could do this. Cheers in advance.
  11. Just to clarify are you asking, to look at a given directory and then copy any and all exe files to another given directory. Then look at the destination directory and execute any exe file that is located in it? This should be possible. But am unsure if this is what you mean
  12. Sorry guys, feeling a bit stupid now....... it was that the window title was just "Scans" not "p:\scans" Will shrink away now..
  13. I need to open explorer at a given directory and have it maximized. i have tried Run("explorer p:\scans") WinSetState("p:\scans", "", @SW_MAXIMIZE) but this doesnt work, What am i missing? All comment appreciated.
  14. Thanks guys. i did know it could be done. but was pretty sure it was to GUI's but it is allways worth asking.
  15. I have a script that opens a scanned graphic and then asks for a file number. i want the inputbox to stay on top but the user can click on the program behind to rotate the doc as required, to stop the user from having to alt tab (or mouse) back to the question. i have tried searching for this but i dont even know ehat it would be called ("stay on top"). ------------------Part of code------------------------------------------- WinWait("Microsoft Office Document Imaging","",5) If Not WinActive("Microsoft Office Document Imaging","") Then WinActivate("Microsoft Office Document Imaging","") WinWaitActive("Microsoft Office Document Imaging","",5) If Not WinActive("Microsoft Office Document Imaging","")Then MsgBox(4096,"ERROR","Please report error #2 to Andrew or Ben" &@CR&"This message will disapear in 10 seconds",10) Exit EndIf WinActivate("job number","") BlockInput(0) $jobnum=InputBox("Job number", "What is the Job Number") ------------------End of part------------------------------------------- Any assistance appreciated.
  16. This question interests me as i have allways used the sleep as well. but on some older systems they take longer to do something so you end up having to sleep for the maximum time to allow older systems time. eg send("abcdefghijklmnopqrstuvwxyz.. blah blah blah....") sleep(10000)
  17. what i am trying to do is cut some text from the body of an email and then paste it back with text: at the beginning of each line. Smoken led me in the direction of stringreplace which does a good job (just doesnt get it right) The code i am using is CODEsend("^a") send("^c") $Body = ClipGet() ;find replace $Body = StringReplace($Body, @CR , @CR & "Text:") $Body = "Text:" & $Body ClipPut($Body) send("^a") send("{DEL}") send("^v") The problem is i still end up with a carriage return after each text: bit. i can do this via sendkey with outlokk by doing a find and replace with paragraph markers. So what the hell is a paragraph marker, if you dont know, do you know if there is a way that i can get a string typed out in ascii codes so that i can see what the hell it is that i should be searching for and replacing.
  18. i have solved this with the following CODE#include <misc.au3> _Singleton('sms.exe', 0) Do ;Insert code here ;Delete the email that you just processed in the code until StatusbarGetText("Inbox") = "0 items" Thankyou all for your help
  19. i am populating a variable with a bunch of text, What i want to do is find any carriage returns and replace them with " @cr & "Newline:" basically so wend i send the variale to notepad each line starts with the text "newline:" any idea's ? Currently i have my script pasting the variable to a word doc and then useing the word doc find/replace function to do the job, but as you can imagine that is a lot of send's and slows the whole process up a lot.
  20. These dont work CODE#include <misc.au3> ;If _Singleton('sms.exe', 1) = 0 Then ; Do ; Sleep(100) ; Until _Singleton('sms.exe', 1)=1 ;EndIf While _Singleton('sms.exe', 1) = 0 sleep(100) MsgBox(0,"singlton value", _Singleton('sms.exe', 1)) WEnd ;If UBound(ProcessList(@sms)) - 1 >= 2 Then ; Do ; Sleep(100) ; Until UBound(ProcessList(@sms)) - 1 = 1 ;EndIf MsgBox (0,"Good","good to go") Exit above is the code for three differant attempts at the same thing. Compile this to a exe called sms.exe and then start the two instances of the exe. the first will complet to the good to go message the second one forever stays in the loop, even after the first instance has finnished and gone.
  21. So jsut to clarify the line of script would look like if _Singleton("test\test",1) = 0 Then Blah Blah Blah ............ is that correct?
  22. OK so then i would have to have a script run a second script: ie outlook start fire.exe which in turn looks for send.exe running and if not running then it would launch send.exe otherwise it will sleep until it can. It can t be within the one exe as then it is looking for itself, which of course will allways be there. If this is correct then i will give it a go.
  23. What i have is an outo it script that deals with email alerts that arive at a particular machine. 1. outlokk has a rule set to start an exe when it receives a new email 2. my Exe goes to the first email (the one it just received and then steps through and forwards the email to a specefic email, alters the subject, Prepends some info to the body, and then at the end it deletes the email. The problem is quite often due to the equipment that send it the alert emails, it will receive two (or more) emails at the same time. so you end up with a situation where one script has not completed when the next one starts so it upsets the whole process. What i want to do is check for other instances and wait until they finnish and then run in turn. My thought was this ;little script to ensure only one process at a time #Include<Array.au3> ;Find out number of sms.exe PID's and assign it to variable $sms_pids $sms_pids = ProcessList("testsms.exe") ;Get the number of running sms.exe's and strip last one off because it is this instance $number_of_pids = $sms_pids[0][0] $extra_pids = $number_of_pids ;wait for the pids to close (except this instance) If $number_of_pids > 0.1 Then $count=1 While $count < $extra_pids MsgBox(0,"Waiting","im waiting the count is "& $count,1) ProcessWaitClose($sms_pids[$count][1]) $count=$count+1 WEnd EndIf ;-------------------------------------------------------------------------- MsgBox(0,"go","im good to go") Exit Obviously there is other stuff after the exit and in production the msgboxes are stripped out. This works fine if i test it by double clicking the exe twice to get two instances. However when outlook fires the multiples it doesnt work because they seem to fire off so fast that they are both waiting for each other. (I end up with two instances both in the waiting state) Any ideas? For your referance below is the code that appears after the top part which as i said forwards the email to an SMS provider that then SMS's the info to my mobile phone, (so sorry i have cut and replaced parts that list my account details. --------------------Start------------------------------------ ; Script Start - Add your code below here Opt("WinWaitDelay",100) Opt("SendKeyDelay", 50) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) If Not WinActive("Inbox - Microsoft Outlook","") Then WinActivate("Inbox - Microsoft Outlook","") WinWaitActive("Inbox - Microsoft Outlook","") sleep(5000) ;goto first email in inbox Send("{PGUP}") sleep(1000) ;Forward email to SMS gateway send("{CTRLDOWN}f{CTRLUP}") sleep(5000) send("xyz@domain.com ") sleep(1000) send("{TAB}{TAB}") sleep(1000) ;send("{DEL}{DEL}{DEL}{DEL}{DEL}") send("{DEL 5}") sleep(1000) send("61") sleep(1000) send("{ctrldown}a{CTRLUP}") sleep(1000) send("{ctrldown}c{CTRLUP}") sleep(1000) Send("{TAB}") sleep(1000) send("{SHIFTDOWN}{DOWN 8}{SHIFTUP}") sleep(1000) send("{DEL}") sleep(1000) send("{CTRLDOWN}f") send("{CTRLUP}") sleep(1000) WinWait("Find and Replace","") If Not WinActive("Find and Replace","") Then WinActivate("Find and Replace","") WinWaitActive("Find and Replace","") sleep(1000) send("!m") sleep(1000) Send("{ALTDOWN}p") send("{ALTUP}") sleep(1000) send("!e") sleep(1000) send("p") sleep(1000) send(@TAB) sleep(1000) send("!e") sleep(1000) send("p") sleep(1000) send("text:") sleep(1000) send("{ALTDOWN}a") send("{ALTUP}") sleep(1000) WinWait("Microsoft Office Word","") If Not WinActive("Microsoft Office Word","") Then WinActivate("Microsoft Office Word","") WinWaitActive("Microsoft Office Word","") Send("{ENTER}") sleep(1000) WinWait("Find and Replace","") If Not WinActive("Find and Replace","") Then WinActivate("Find and Replace","") WinWaitActive("Find and Replace","") Send("{ESC}") sleep(1000) Send("api_id: xxxxxx"& @cr &"User: xxxxxxx"& @cr &"password: xxxxx"& @cr &"to:{ctrldown}v") send("{ctrlup}") send(" "& @cr &"text:") send("!s") sleep(5000) ;send reply to inform message sent send("{CTRLDOWN}r{CTRLUP}") sleep(5000) ;send("{shiftdown}") send("+{tab}") ;send("{shiftup}") sleep(1000) send("{DEL 2}") send("SMS sent to") send("{tab}") Opt("SendKeyDelay", 15) send("Message sent") sleep(1000) send("!s") sleep(5000) ;Delete original message send("{DEL}") ---------------------------END-------------------------------
  24. darn there you go googling and making me look silly OK so here is the answer i went through your google solution and whilst it related to win98 i gave it a go, but as i suspected it did not resolve my issue. But the word Google did. it made me think perhaps it wasnt an autoIT issue so i tried opening a differant chm file and the same symptoms occured. so with a little google and a bit of trial and error. regsvr32 hhctrl.ocx regsvr32 itss regsvr32 Urlmon.dll regsvr32 Shdocvw.dll regsvr32 Oleaut32.dll regsvr32 Actxprxy.dll regsvr32 Mshtml.dll regsvr32 Shell32.dll and a referance site http://forum.sysinternals.com/forum_posts....=1&get=last Thanks for your help.
×
×
  • Create New...