Jump to content

TheRauchster101

Active Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by TheRauchster101

  1. Thank you for the prompt responses. I currently have not had any requests for IPv6 addresses, as most end-users do not have an IPv6 yet, but that may come in the future. Worry about that then. IsValidIP looks like it would work for some of what I need. Probably can figure out something to base it on as far as what is a valid IP for the businesses I work with. Any suggestions on how to pull the timestamp as well? That's one of the harder ones, because the format changes so much. And if I'm off by even a minute, I could get the wrong person.
  2. Hello all, Part of my job is finding people who download files illegally, and I get a few hundred to a few thousand emails a day regarding this. I've been trying to build an automatic script for a while on this, but am running into problems grabbing an IP address and timestamp from a variety of different formats on emails. Any suggestions on how to grab information from an email that changes depending on who is sending it? Sometimes the information looks like: Timestamp: 2015-03-18 21:50:13 North American Eastern Time Unauthorized IP Address: 184.177.x.x Other times the information might be like: (I need to grab the first IP, but not the second) 2015-03-17 19:54:16.589158 IP (tos 0x0, ttl 241, id 40294, offset 0, flags [none], proto UDP (17), length 1427) 66.210.x.x.161 > 31.186.x.x.3389: UDP, length 1399 And other times, it might be: > <TimeStamp>2015-03-28T19:30:11.23Z</TimeStamp> > <IP_Address>67.202.x.x</IP_Address> I have written code that can grab IP from a specific format, but I'd like to make a universal that can find the information no matter what it is surrounded by, rather than having to put in new code each time I get a new format.
  3. Currently I have a working script, but I'd like to add one last tweak to make it perfect so that it's usable while I work on other things. I am trying to monitor and track the error count of a specific cable in our system. Our tracking system only takes a count every 15 minutes, and I need more specific data, so I'm creating a program that will use my remote terminal session with PuTTY to automatically send the command every 5 seconds. Global $WndHan, $SendCount, $SleepCount, $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "End") HotKeySet("+!d", "PullInfo") ; Shift-Alt-d Opt("WinTitleMatchMode", 2) $SendCount = 0 $SleepCount = 5 While 1 Sleep (500) ToolTip ("Waiting for Start-up command. Shift+Alt+D" & @LF & "Pause/Break to Pause" & @LF & "Escape to Exit" & @LF & "Created by Adam Rauch", 5, 5) WEnd Func PullInfo() WinWait ("Shawnee, OK - PuTTY", "") ToolTip ("Waiting for Window to Activate" & @LF & "Escape to Exit" & @LF & "Created by Adam Rauch", 5, 5) $WndHan = WinGetHandle("Shawnee, OK - PuTTY", "") If @error Then MsgBox(65552, "", "An error occurred when trying to retrieve the window handle of Notepad.") Exit Else ControlSend ($WndHan,"", "", "show int cable 5/0/14{ENTER}") $SendCount = $SendCount + 1 Tooltip ("Window Handle is " & $WndHan & " - Sending command, Time #" & $SendCount & @LF & "Escape to Exit" & @LF & "Created by Adam Rauch", 5, 5) Call ("SleepCount") EndIf EndFunc Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip("Script is Paused" & @LF & "Pause/Break to Resume" & @LF & "Escape to Exit" & @LF & "Created by Adam Rauch", 5, 5) WEnd ToolTip("") EndFunc Func End() Exit EndFunc Func SleepCount() If $SleepCount > 1 Then ToolTip ("Window Handle is " & $WndHan & " - Waiting " & $SleepCount & " seconds before sending next command." & @LF & "Have currently sent " & $SendCount & " commands." & @LF & "Escape to Exit" & @LF & "Created by Adam Rauch", 5, 5) $SleepCount = $SleepCount - 1 Sleep (1000) Call ("SleepCount") ElseIf $SleepCount = 1 Then ToolTip ("Waiting " & $SleepCount & " seconds before sending next command." & @LF & "Have currently sent " & $SendCount & " commands." & @LF & "Escape to Exit" & @LF & "Created by Adam Rauch", 5, 5) Sleep (1000) $SleepCount = 5 Call ("PullInfo") EndIf EndFunc This code works fine, the problem is not with that. I pull the window handle just fine, and the program attempts to send to the PuTTY window, but I think a feature of PuTTY is that it doesn't send commands without being the active window. Anyone have prior experience with this program and know a workaround?
  4. Okay, I think I have found an answer, though it's probably not the best way to do it, as long as it works, I don't care. Does this look like an acceptable recursion avoidance procedure while keeping the script to continuously loop? Global $Starting=0 HotKeySet("{INS}", "Starting") While 1=1 If $Starting=0 Then Sleep(500) ElseIf $Starting=1 Then $Starting=2 Call("PixelCheck") ElseIf $Starting=2 Then Call("Start") EndIf WEnd Func Starting() $Starting=1 EndFunc Where Func PixelCheck() is my one time only script that takes the snapshot of the installation window to compare against for future reference against errors, and Func Start() is the starting function of the installation procedure? I've also removed any possible loops back to "Start", making sure it's called nowhere else in the script. Does this make sense to others?
  5. Yup. Now the script stops at whatever number I have set for the limit. Which is good in one way, because I don't have a recursive error. But the original concept was to be able to continue to perform installations until the program was manually stopped. Is there some way to get AutoIT to continuously do a script for a over-the-weekend project? Because I'm tired of going into work in the morning and seeing this error.
  6. Woah dude... That is some cool code. Yeah, I know how nub that makes me sound, because you probably wrote that in 2 minutes, and probably not even in SciTe. I'll try working that into the script, and see how that goes.
  7. I actually have it written longhand as: $RunCounter=$RunCounter+1 Later on in the script, under a different call function. But yes, the $RunCounter is increasing with each consecutive run like it should. And yet again, this is still going on another test run where $RunCounter is currently at 7. --EDIT-- Alrighty, I figured out why that was doing what it was doing. I had made a change in a #included script too, but hadn't saved it when I compiled the main file. So now it's stopped when $RunCounter = 5. So, now the question is. How do I automatically restart it without user input?
  8. Alrighty.... I've rewritten the code to look like this. HotKeySet("{INS}", "First") Func First() While $RunCounter<5 If $Starting=True Then $Starting=False Call("Start") ElseIf $Starting=False Then Call("Launch") EndIf WEnd EndFunc Since I only want Start to run once, and Launch is the real looping point. I removed all references to Launch being called from any function as well, just to make sure that it can't loop outside of the While. But what I don't understand is this. Shouldn't that snippet of code END once $RunCounter is 5? Because I just tested it, and it's still going at $RunCounter = 10.... Obviously I don't understand something. I'm not complaining as I actually WANT it to keep looping. But I like to understand my script too.
  9. Awesome. I will give it a try and let you know. If it works, is there a thanks or rep button I can click to +1 you?
  10. Alrighty, that makes sense. However, a quick monkey wrench being thrown in is that the script is activated by a HotKeySet, which calls a function that starts the entire thing. I.E: HotKeySet("{INS}", "Start") Where Start calls everything else, and eventually loops back to Start.
  11. Alrighty, it's been a while since I looked at this, and while I have a bit more knowledge in the AutoIT language now, I'm still getting stuck with the recursion error. After reviewing the code, I removed all occurrences of any Func calling itself, and it is still giving me recursion errors at random time periods. I believe it's as Manadal says: On another note, this also causes recursion limits: Obviously way more complex than that, as I actually have about 50 different functions called, but the overall effect generated is a loop. So, my question is, how do I break the loop and return to the main part of the script, then re-activate the start of the loop? I have a counter built in already that counts the number of full complete loops the program has made, ingeniously named $Counter. Since the recursion error seems to happen after 250+ repeats, I can make the script stop at 200, but have no clue how to make it re-launch itself so that it can keep going. And, are there other sites beyond the AutoIT forums that work with this sort of stuff? I'm willing to learn, but I'm struggling with some concepts. Like Return is one that I get but don't get at the same time.
  12. Perhaps I should try to better explain it. I'd like to have the file that is given to people for their own modification to be fully edit-able and read-able. I'd like the three files that it #includes to be encrypted in some manner, so that they can't be read. So far every method of compiling, compressing, encrypting, obfuscating or anything else that I has tried has failed. Either it fails to read that the files are even there, or it misreads the data. The best I can do is set them for Hidden/Read-Only and hope that people don't have show hidden files on their computers. I'd like a better method of securing the data if it's at all possible.
  13. Okay, google'd it, installed it, and while I can see uses for it, it's not quite what I was hoping for. I'd like some method of encryption on a file that is being used in an #include. While Obfuscator works fine for a full completed file, I still need people able to read the file they are editing that uses the (hopefully encrpyted) included files.
  14. I already have a user.ini that connects to a GUI via IniRead and IniWrite. But I can't foresee every change that a user might want to make to the installation procedures, so I was wanting to have a blank file with the main parts that people might want to change. But since the blank file needs the three included .au3 files in order to compile properly, I was hoping to keep those private. I have no idea what this Obfuscator is, details? *Googles while he waits.*
  15. I have a small program that I've built that I want to be able to release to users so that they can customize certain aspects of it, while not having total and complete access to the source code. Right now the files being included are: #include "Variable.au3" #include "Error.au3" #include "Command.au3" Since this is easily visible in the top of the custom dummy file for user modification, I was wondering if AutoIT had the ability to read archived files. I used an old trick to put those three files into a .zip file, and archive them into a picture (logo.jpg) that can be placed inconspicuously within the folder. Is there anyway to use #include / FileRead / FileOpen / FileInstall or any other command to have the dummy.au3 file read the archived .au3's within the compressed folder within the picture?
  16. Alright that might be what I'm looking for... What I currently have going is along the lines of: #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GuiComboBoxEx.au3> #include <IE.au3> FileInstall("donate.gif", "donate.gif") $Form1 = GUICreate("Prog Name", 400, 470, 200, 125) $Button3 = GUICtrlCreateButton("Donate", 170, 434, 65, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $Pic = GUICtrlCreatePic("donate.gif", 170, 434, 65, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button3 _IECreate ("https://www.paypal.com", 1, 1, 0) EndSwitch WEnd I've obviously taken out large chunk of the code that weren't relevant (the entire GUI is 700 lines) But this should be the most relevant parts. What happens currently is "kinda" acceptable. The picture appears at first, and then when you hover over it, it turns into the button which then leads to Paypal when clicked. -------EDIT------- Got it working. Though now it has weird red edging around the picture. I can live with that though, unless you know of a way to fix it, of course. Thank you very much picea892. Please let me know if there is any way to +1 Rep or officially thank you through these forums.
  17. Duh, I hadn't even thought of that. Let me give it a quick try.
  18. Thanks for the attempted help, but I already have a "button" linked to the website. Perhaps I should have explained more clearly. I'd like to have this image in the bottom of the GUI, AND have it linked to the donation page for my email address through Paypal. I already know how to get the picture in there, and actually have it in position already. I just have no clue how to hyperlink it to a specific address, as I can't seem to make it clickable.
  19. I've been using the Koda Form designer for a while now to create my own GUI, and it's working pretty good. But something I can't seem to find is a HTML link functionality. What I'd like to do is include a PayPal donate button in the GUI, but I'm not sure how to go about doing this. Anyone have a starting point?
  20. I've spent the last 2 weeks creating a program for my place of business, so to automate an installation script with a single hotkey press. After finishing it and compiling it, it works beautifully on 6 of the computers here. But the last one refuses to run it properly. The tray icon appears, as if it's running, but the hotkey press never does anything. The first thing that's supposed to happen once the hotkey is pressed, is to produce a tooltip. The user reports that there is no tooltip. I can verify that he is launching the program correctly, using all appropriate permissions. And that the program works as intended on every other computer. dim $Exit, $Start, $Pause, $IniFile, $CurrentDir SetButtons() Global $Paused HotKeySet($Pause, "TogglePause") HotKeySet($Start, "Start") HotKeySet($Exit, "Exit") $CurrentDir=@WorkingDir & "\" $IniFile=$CurrentDir & "Settings.ini" While 1=1 Sleep(500) WEnd Func SetButtons() If FileExists ( $IniFile ) Then $Start=IniRead ( $IniFile, "Hotkeys", "start", "{INS}" ) $Pause=IniRead ( $IniFile, "Hotkeys", "pause", "{Pause}" ) $Exit=IniRead ( $IniFile, "Hotkeys", "exit", "{END}") Else $Start="{INS}" $Pause="{Pause}" $Exit="{END}" EndIf EndFunc Func Start() ToolTip("Automation has started. Please press the Pause/Break button to pause, and End to exit.", 50, 50) From there the code just goes through the automation process. I cannot for the life of me figure out why the program launches for him, but the hotkey press never activates the script.
  21. Well, I can send the entire code to a person if they want to look it over, but I doubt the entire thing would fit in a forum post here, as it's well over 25000 characters and nearly 900 lines.
  22. That why I put in the $XCounter - which is a Variable set at 36. The timer is set at 5000 (5 seconds) so that after 3 minutes (3 min = 180 seconds = 36*5). Each time it runs through and fails the pixel check, it should subtract one from the $XCounter. Once the $Xcounter hits 0 - It calls the error and exit functions. So, while there is a loop, it's not infinite. Should only happen for those 3 minutes. That was my intent in that section anyway. Have I done something wrong?
  23. Well, the pixelcheck isn't a recursive problem, but I don't know that many other ways around writing it. I'll admit I'm still a beginner level coder. While my coding can impressed the uninformed, to an expert I'm sure it'll look like child's play. I do want the program to loop if certain conditions are met, and I guess that is the problem. It functions fine for upwards of 3-4 hours. But extensive periods of use have always resulted in this error. If someone is willing to look at my code and let me know of another solution for writing it, I'd be happy to learn from a pro. It's far too big to paste into here. Here's a snippet of the code where the error seems to appear most frequently, though. Func 1() If $XCounter > 0 Then Sleep($XTime) $XCounter = $XCounter - 1 $PixelCheck1 = PixelGetColor($PixelCheck1X,$BCPixelCheck1Y) $PixelCheck2 = PixelGetColor($PixelCheck2X,$BCPixelCheck2Y) $PixelCheck3 = PixelGetColor($PixelCheck3X,$BCPixelCheck3Y) If $PixelCheck1 = 0 AND $PixelCheck2 = 0 AND $PixelCheck3 = 0 Then $XCounter = 36 Call("2") Else Call("1") EndIf Else $XCounter = 36 Call("Error") Call("Forfeit") Call("Exit") EndIf EndFunc Functions and variables are renamed, but you get the idea. And yes eventually the "2" function will loop through about 20 other functions then end back up at "1".
  24. Thanks for the responses. The line I quoted is the line error that it gave me in the error message box. Is there a way to trace where the recursive error is coming from. That particular PixelCheck I have limited to only run once every 5 seconds for 300 seconds total, which is why having the error code there doesn't make sense.
  25. After creating a large program, I'm getting a recursion level exceeded error. I know that this means I have a logical loop in the function, but the line that it's giving me the error for doesn't make sense: If $BCPixelCheck1 = 0 AND $BCPixelCheck2 = 0 AND $BCPixelCheck3 = 0 Then I was wondering how to implement a some sort of trace into the program to see where the code is actually looping, and method's to bypass it, as I want it to loop if certain circumstances are met.
×
×
  • Create New...