Jump to content

jacobraccuia

Active Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by jacobraccuia

  1. Thank you! It worked perfectly. I didn't know of this function.
  2. I simply want to set $var to ctrl-v $var = "^v" obviously doesn't work. I've checked the help file but couldn't find anything. thanks!
  3. Thanks everyone for help. I got it to work with this: $file = FileOpen("test.txt", 0) ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file, 1) If $line = "end" Then Exitloop ;code WinActivate("test - Notepad") WinWaitActive("test - Notepad") Send("^s") $file = FileOpen("test.txt", 0) Wend
  4. Hi, thanks for some more input! I was away on break. As for now, I'm going to keep using notepad because it's very easy to work from [or so I find]. In response to JohnOne, I don't understand what @scriptdir is, per say. What do I need to do to get it to work. [simply coyping what you wrote and putting it into my script was not enough].
  5. Check my post above - I have that added, and it still does not work. Also, thanks so much for continuing to help - both of you
  6. I added the command above wend and continueloop, but it still didn't work. Adding the If - Then statement did not work either. I have: $line = FileReadLine("Untitled - Notepad", 1) While 1 $line = FileReadLine("Untitled - Notepad", 1) If $line == "end" Then Exit ;script If <this> Then <that> $line = FileReadLine("Untitled - Notepad", 1) ContinueLoop EndIF ;more script $line = FileReadLine("Untitled - Notepad", 1) wend This one doesn't work either $line = FileReadLine("Untitled - Notepad", 1) While $line <> "end" ;script If <this> Then <that> $line = FileReadLine("Untitled - Notepad", 1) ContinueLoop EndIF ;more script $line = FileReadLine("Untitled - Notepad", 1) wend
  7. So using ContinueLoop instead of Exit fixed that problem. Thanks John! However, when "end" was the only thing in notepad, it still continued the script. I have $line = FileReadLine("Untitled - Notepad", 1) While $line <> "end" <script> wend In Notepad, it looks like this: 128.164.213.98 3/8 9:31 NeoSploit 128.164.214.112 3/8 9:45 NeoSploit end
  8. Yes, I was able to get that to work. I used $line = FileReadLine("Untitled - Notepad", 1) While $line <> end <script> wend However, I have an if, then statement. If this statement applies, how do I get the loop to continue after the EndIF command? If the IF scenario never occurs, the loop works perfectly. Otherwise, it ends after the Exit Endif
  9. As of right now, I have her send me something that looks like this (in an email): 128.164.181.175 3/5 9:14 Koobface 128.164.87.212 3/6 13:45 trojan inst.exe 128.164.181.188 3/8 3:38 malicious PDF grabbing malware 128.164.214.36 3/7 22:07 malicious PDF grabbing malware 128.164.213.193 3/8 9:48 trojan 128.164.149.154 3/8 11:16 NeoSploit 128.164.157.197 3/8 10:50 NeoSploit 128.164.213.98 3/8 9:31 NeoSploit 128.164.214.112 3/8 9:45 NeoSploit end I put it into notepad and the script reads from there. Also, I have it paste the ticket number with each IP address in wordpad. [lol] I'm going to be working on your first post right now. thanks!
  10. Thank you so much. I will have a look at this and see what I can do My boss sends me that information [the IP, time & date], etc, and I put it into notepad so the script can take the information from there.
  11. I apologize for an unintentional bump, but my problem has changed. It seems as if the #include <IE.au3> causes an error with any loop statement. (Do, While, etc) Said error is always: C:\Program Files\AutoIt3\Include\IE.au3 (194) : ==> "Do" statement has no matching "Until" statement.: Func _IECreate($s_Url = "about:blank", $f_tryAttach = 0, $f_visible = 1, $f_wait = 1, $f_takeFocus = 1) If I remove #inclue <IE.au3> the script runs fine. However... I need that there. thanks
  12. This totally isn't addressing your problem, but I was very enthused when I found out that instead of sendind {tab}{tab}{tab} you can send it in one command. Send("{tab}{tab}{tab}{tab}") = Send("{tab 4}")
  13. I'll post the entire section. I know it's not coded very well; using tab to navigate, etc, but it works. Do Send("{f2}") Send("Security") Send("{Tab}") Send("{Tab}") Send("Host") Send("{Tab}") Send("Compromised") Send("{Tab}") ;~ Finds the first IP address and copies it into Remedy WinActivate("Untitled - Notepad") WinWaitActive("Untitled - Notepad") Send("{up 50}") Send("{left 25}") Send("{shiftdown}") Send("{down}") Send("{left}") Send("{shiftup}") Send("^x") Send("{Delete}") WinActivate("Remedy User - [Help Desk Case (New)]") WinWaitActive("Remedy User - [Help Desk Case (New)]") Send("^v") send(" - compromised machine") Send("{Tab 2}") send("{enter}") Send("{Tab 10}") Send("^v") Send("{Tab 34}") Send("compromised as of ") ;~ Continues and finds the time & date WinActivate("Untitled - Notepad") WinWaitActive("Untitled - Notepad") Send("{shiftdown}") Send("{down}") Send("{left}") Send("{shiftup}") Send("^x") Send("{Delete}") WinActivate("Remedy User - [Help Desk Case (New)]") WinWaitActive("Remedy User - [Help Desk Case (New)]") Send("^v") Send("{enter}") ;~ Continues and finds the reason why Send("event - machine is hacked and backdoored - ") WinActivate("Untitled - Notepad") WinWaitActive("Untitled - Notepad") Send("{shiftdown}") Send("{down}") Send("{left}") Send("{shiftup}") Send("^x") Send("{Delete}") WinActivate("Remedy User - [Help Desk Case (New)]") WinWaitActive("Remedy User - [Help Desk Case (New)]") Send("^v") Send("{enter}") Send("remediation - rebuild machine") Send("{enter}") Send("DHCP") Send("{Enter}") Send("{Tab 10}") Send("{Shiftdown}") Send("{left 20}") Send("{Shiftup}") Send("^c") Send("{left}") ;~ Tech Eng Network to the Group+. CHANGE BACK WHEN DONE!!!!!!!!!!!!!!!!!!!!!!!!!!!! Send("{Tab 12}") Send("{Enter}") Send("iiii") Send("{Enter}") Send("{Tab}") Send("Sara Laughlin") ;~ "Please Disable Connection" to Activity. MouseClick ( "left", 145, 320 ) Send("{Tab}") Send("Please disable connection") Send("{Shiftdown}") Send("{Tab}") Send("{Shiftup}") Send("{Shiftdown}") Send("{Left}") Send("{Shiftup}") Send("{Tab 43}") WinActivate("Document - WordPad") Send("^v") Send(" - ") ;Runs IE and looks up the IP address & sends all of the information into Notepad. If there isn't any information, it will finish the script for you.#include <IE.au3> #include <IE.au3> $oIE = _IECreate ("http://www.dhcp.gwu.edu/cgi-bin/tech_page.cgi") WinWaitActive("IPS Tech Page - Windows Internet Explorer") Send("{Tab 24}") Send("^v") Send("{Enter}") WinWaitActive("Tech DB Search - Windows Internet Explorer") $sText = _IEBodyReadText ($oIE) ;this command searches for the words "no lease found" and if they are present, it closes IE If StringInStr($sText, "No Lease Found") Then WinClose("Tech DB Search - Windows Internet Explorer") WinActivate("Remedy User - [Help Desk Case (New)]") WinWaitActive("Remedy User - [Help Desk Case (New)]") Send("{Tab}") Send("unknown") Send("{Enter}") $answer = MsgBox(4, "Attention", "Do you want to save and continue? Click No if you want to pause the script until you save.") If $answer = 7 Then Exit EndIf Send("{CTRLDOWN}") Send("{Enter}") Send("{CTRLUP}") Sleep("3") WinWaitActive("AR System User - Note") Send("{Enter}") Sleep("3") WinWaitActive("Remedy User - [Help Desk Case (Modify)]") Send("{Shiftdown}") Send("{Tab 7}") Send("{SHIFTUP}") Send("{Shiftdown}") Send("{Left 7}") Send("{SHIFTUP}") Send("^c") WinActivate("Document - WordPad") WinWaitActive("Document - WordPad") Send("^v") Send("{Enter}") Exit Endif _IELinkClickByIndex ($oIE, 0) WinWaitActive("DB Search - Windows Internet Explorer") _IELinkClickByIndex ($oIE, 0) WinWaitActive("View DB Entry - Windows Internet Explorer") Send("^a") Send("^c") WinClose("View DB Entry - Windows Internet Explorer") Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("^v") ;~ ; Copies all information and places it under DHCP Send("{Backspace 29}") Send("{up 50}") Send("{Shiftdown}") Send("{down 13}") Send("{Shiftup}") Send("{Backspace}") Send("{Delete 1}") Send("^a") Send("^c") WinActivate("Remedy User - [Help Desk Case (New)]") WinWaitActive("Remedy User - [Help Desk Case (New)]") Send("^v") ; Finds MAC Address and pastes it into Remedy WinActivate("Untitled - Notepad") WinWaitActive("Untitled - Notepad") Send("{up 50}") Send("{down 2}") Send("{right 4}") Send("{Shiftdown}") Send("{right 12}") Send("{Shiftup}") Send("^c") WinActivate("Remedy User - [Help Desk Case (New)]") WinWaitActive("Remedy User - [Help Desk Case (New)]") Send("{Tab 11}") Send("^v") Send("{Shiftdown}") Send("{tab 13}") Send("{Shiftup}") ;~ ; ;Program closes with the username selected. All that is left is selecting the apropriate user, if any, and saving. WinActivate("Untitled - Notepad") WinWaitActive("Untitled - Notepad") Send("{Backspace 45}") Send("{Delete 8}") Send("{Shiftdown}") Send("{down}") Send("{Shiftup}") Send("{left}") Send("{Backspace}") Send("{Shiftdown}") Send("{left 16}") Send("{Shiftup}") Send("^c") WinClose("Untitled - Notepad") WinWaitActive("Notepad") Send("{Right}") Send("{Enter}") WinActivate("Remedy User - [Help Desk Case (New)]") WinWaitActive("Remedy User - [Help Desk Case (New)]") Send("^v") Send("{Enter}") WinWaitActive("Remedy User - [Help Desk Case (New)]") Sleep("3") $answer = MsgBox(4, "Attention", "Do you want to save and continue? Click No if you want to pause the script until you save.") If $answer = 7 Then Exit EndIf Send("{CTRLDOWN}") Send("{Enter}") Send("{CTRLUP}") Sleep("3") WinWaitActive("AR System User - Note") Send("{Enter}") Sleep("3") WinWaitActive("Remedy User - [Help Desk Case (Modify)]") Send("{Shiftdown}") Send("{Tab 7}") Send("{SHIFTUP}") Send("{Shiftdown}") Send("{Left 7}") Send("{SHIFTUP}") Send("^c") WinActivate("Document - WordPad") WinWaitActive("Document - WordPad") Send("^v") Send("{Enter}") WinActivate("Remedy User - [Help Desk Case (Modify)]") Send("{f2}") WinWaitActive("Confirm Save Request") Send("{Tab 2}") Send("{Enter}") Until $line = FileReadLine("Untitled - Notepad") If @error = -1 Then ExitLoop If $line = "end" Then ExitLoop I hope this is understandable! This is my error: C:\Program Files\AutoIt3\Include\IE.au3 (194) : ==> "Do" statement has no matching "Until" statement.: Func _IECreate($s_Url = "about:blank", $f_tryAttach = 0, $f_visible = 1, $f_wait = 1, $f_takeFocus = 1) It seems that loops do not work with IECreate.. I tried to do a similar command with While/Wend and still had no luck
  14. It tells me that my Do statement has no matching Until statement, although both are definitely present. Could it have something to do with If Then statements that will exit the script if a certain condition holds true? thanks
  15. Hello I wish for my script to loop until the only information in notepad reads "end" ------------- The script takes three lines of information each time it is ran. The notepad file may look like this 124.264.32.4 3/2 3:20 virus 165.357.135.321 3/3 12:50 virus 128.164.143.24 3/3 14:20 trojan automator end I want the script to loop so it takes all of the information until the only thing left is "end". I do not know how to write an expression to state this. I hope this isn't too confusing; thanks so very much!
  16. Yes, thank you so much! I removed the first StringInStr command "tech DB search results" and just had the No Lease Found part, and it worked perfectly! I don't really know what it means, but thank you!
  17. So this link thing is very cool. I don't know how to set it up with an If then though. If "link 0" exists, I want it to continue If not, then I want it to follow instructions. Essentially, if the link is present, it goes. If the link isn't present, it stays. Thanks, i hope you can help, cause I have no idea! One idea I had was $sText = _IEBodyReadText ($oIE) If $stext = ???? Then Exit If the page says "Tech DB Search Results for (random IP here) No Lease Found" I need it to Exit, but I don't know to set that equation Thanks!
  18. I didn't know that. I will switch over to IE and see what I can get done and then post back!
  19. I see that this can get me some information regarding the page, although nothing seems specific to detecting links, etc. And even if it detects the link, how do I make it choose what to do? Edit: not to mention I would rather not use IE...
  20. I have created a wonderful program to help my company out at work. One part of it goes to a website and types in an IP address. Occasionally there is information that is needed to grab. Sometimes there isn't. I originally had a message box pop up w/ an if then. If there was information you would click yes, and it would take the information. If there wasn't you click no and it does something else. I want to automate this! Either by detecting a link on the page, or comparing page sizes. I have no idea where to start. Any ideas? thanks! Jacob
  21. The visible text tab is completely empty. I also need to do what I mentioned above multiple times. I'm going to try to set it up so it pastes the entire page into notepad and works from there, until I get a better solution. Thanks though, and I'm still looking for help!
  22. I need to select certain text on this page and copy it somewhere else.. I originally planned on using controlclick with coords to a certain point, then having the script hold shift and click down to select the text. I can't get the controlclick to work, however. Here is the page I wish to select text from http://img148.imageshack.us/i/webpageinfo.png/ I need to select all of the text in both boxes. It is simple text and can't be tabbed to.. On WindowInfo, this is what I get wherever I move the mouse [with different coords] http://img251.imageshack.us/i/windowinfo.png/ These are the different ControlClick commands I have tried: ControlClick ("View DB Entry - Mozilla Firefox", "", [, 2 [, 400 [, 60 ]]] ) ControlClick ("View DB Entry - Mozilla Firefox", "", [CLASS:MozillaWindowClass; INSTANCE:5] [, 2 [, 400 [, 60 ]]] ) ControlClick ("View DB Entry - Mozilla Firefox", "", [CLASS:MozillaWindowClass; INSTANCE:5]) Can someone please tell me what I'm doing wrong? THANKS! sorry I'm a noob
  23. What class would I put if I want it to send to where it last ended off. Using notepad as an example, I'm typing in notepad, run the script, and I want it to paste where I left off
  24. I got it using $value = inputbox("IP Address", "Please type in an IP Address and click OK") ClipPut($value) $bak = ClipGet() Send("^v") thanks!
  25. I am creating a simple macro to help me do some work. I need to create an input box, and when I type in the information and click okay, it pastes the information at the designated line in the program. Essentially, if I open notepad and then run the script, I should be able to type in information, click enter, and see the text appear in notepad. This is really basic, I know! Right now, I just have - $text = InputBox("IP Address", "Please type in an IP Address and click OK") Thanks so much, I really appreciate any help!
×
×
  • Create New...