Jump to content

Rogue5099

Active Members
  • Posts

    429
  • Joined

  • Last visited

  • Days Won

    2

Rogue5099 last won the day on December 15 2013

Rogue5099 had the most liked content!

Recent Profile Visitors

603 profile views

Rogue5099's Achievements

  1. @t0nZ This looks great. Glad I could be inspiring with the previous information tool. I know it was really outdated and needed an upgrade.
  2. should of played around a bit more before posting... Answer: [+]\d{4}
  3. I'm trying to figure out how to use a regular expression to find "+" and number above 1000
  4. Thank you so much this gave me the initial push I needed. I can go from here. Thanks again!
  5. I'm having trouble with an algorithm. There is 7 25 hour days in a cycle (7*25*60*60), 5 hour segments each cycle (5*60*60). Very first start of this cycle is 2014/01/15 10:00:00 UTC If I have GUICtrlCreateMonthCal and I select a day, I want to calculate when the cycle starts, ends and each segment within the cycle. I'm EST so that's also a 5 hour difference from UTC. All I have is the easy GUI and drawing a mind blank... #include <GUIConstants.au3> #include <Date.au3> Global $UTC = "2014/01/15 10:00:00" $GUI = GUICreate("Cycles", 499, 437, 193, 126) $Calander = GUICtrlCreateMonthCal(_NowCalc(), 16, 96, 226, 161) GUICtrlCreateGroup("Current Cycle", 16, 264, 225, 137) GUICtrlCreateLabel("Cycle Start:", 48, 296, 58, 17) GUICtrlCreateLabel("Next Checkpoint:", 24, 328, 86, 17) GUICtrlCreateLabel("Cycle End:", 48, 360, 55, 17) $CurrentCycle = GUICtrlCreateInput("", 112, 296, 113, 21, 0x0801) $CurrentCycleStart = GUICtrlCreateInput("", 112, 328, 113, 21, 0x0801) $CurrentCycleEnd = GUICtrlCreateInput("", 112, 360, 113, 21, 0x0801) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("Predicted Cycle", 256, 80, 225, 321) GUICtrlCreateLabel("Cycle Start:", 264, 112, 58, 17) GUICtrlCreateLabel("Checkpoint:", 264, 144, 61, 17) GUICtrlCreateLabel("Checkpoint:", 264, 176, 61, 17) GUICtrlCreateLabel("Checkpoint:", 264, 208, 61, 17) GUICtrlCreateLabel("Checkpoint:", 264, 240, 61, 17) GUICtrlCreateLabel("Checkpoint:", 264, 272, 61, 17) GUICtrlCreateLabel("Cycle End:", 264, 304, 55, 17) $CycleStart = GUICtrlCreateInput("", 336, 112, 121, 21, 0x0801) $Checkpoint1 = GUICtrlCreateInput("", 336, 144, 121, 21, 0x0801) $Checkpoint2 = GUICtrlCreateInput("", 336, 176, 121, 21, 0x0801) $Checkpoint3 = GUICtrlCreateInput("", 336, 208, 121, 21, 0x0801) $Checkpoint4 = GUICtrlCreateInput("", 336, 240, 121, 21, 0x0801) $Checkpoint5 = GUICtrlCreateInput("", 336, 272, 121, 21, 0x0801) $CycleEnd = GUICtrlCreateInput("", 336, 304, 121, 21, 0x0801) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) Do $msg = GUIGetMsg() If $msg = $Calander Then _Update(GUICtrlRead($Calander)) Until $msg = $GUI_EVENT_CLOSE Func _Update($Date) MsgBox(0, "", $Date) EndFunc
  6. I have a page that I would like to refresh, wait for it to finish refreshing (F5), then continue script. Can I do this without creating the page in AutoIt? Page is up, I activate the page, refresh page, continue script, then it minimizes. I can do all this but waiting for the page to load im using a sleep command which could vary depending on the loading.
  7. I'm still at a loss here. I've tried several ways to get this to no avail.
  8. With the following code I want to read the system defrag status to a GUI. I have UAC disabled on my PC and I am able to get the results. When I run this on other PC's it says they don't have the correct privileges. $iPID = Run(@ComSpec & ' /C defrag ' & @HomeDrive & ' /a /v', "", @SW_HIDE, $STDOUT_CHILD) I have #RequireAdmin at the begining of my script but this still does not pass on to a sub-process. I don't mind UAC interrupting and asking for permission. Even tried RunAs() but each computer's Password is different if even non existent. I see how to open cmd by clicking start menu, typing cmd, right clicking Command Prompt, clicking Run As Admin does work but how do I tell CMD that through AutoIt? (This is not for a network just several local computers.) I just want to run the above line in Admin CMD and have UAC prompt if needed.
  9. >_IniString worked great for my application. Thanks for all the input. I'll check out DXRW4E's UDF and see if it is faster.
  10. I am checking a current version from an .ini file uploaded to a cloud. Right now I am downloading the file doing an INIRead then deleting the file. InetGet("link", @TempDir & "\ProgramVersionCheck.ini", 3) $NewVersion = IniRead(@TempDir & "\ProgramVersionCheck.ini", "ProgramName", "version", "") FileDelete(@TempDir & "\ProgramVersionCheck.ini") So instead of downloading the file I wanted to use _INetGetSource() to avoid writing a temp file. This is what I get: [ProgramName1] version=x.x.x.x [ProgramName2] version=x.x.x.x What I've coded so far to read ProgramName1's version is below and it works: #include <Inet.au3> $Source = _INetGetSource('link') $New = StringTrimLeft($Source, StringInStr($Source, "=")) $NewVersion = StringStripWS(StringStripCR(StringTrimRight($New, StringLen($New) - StringInStr($New, "[") + 1)), 8) Wondering if there would be a better way accomplish this than all the string edits or if this is an effective way.
  11. Edit: StringRegExpReplace not StringRegExp Sorry With the following code: #include <ScreenCapture.au3> DirCreate(@ScriptDir & "\SS\") For $i = 9 To 10 Local $sOutput = StringRegExpReplace("Screen" & $i & ".jpg", "([a-zA-Z]+)(\d{1})(\..+)", "${1}00$2$3") ConsoleWrite($sOutput & @CRLF) ;~ If Not FileExists(@ScriptDir & "\SS\" & $sOutput) Then ;~ _ScreenCapture_Capture(@ScriptDir & "\SS\" & $sOutput) ;~ ExitLoop ;~ EndIf Next I can get it to output, Screen009.jpg Screen10.jpg But I would like: Screen009.jpg Screen010.jpg and if in 100's I would like, Screen100.jpg so on. Also would there be a better way to execute this than checking 1 to 999? Lets say program was restarted at Screen500.jpg it would start at 500 and next time start at 501 within program? Below is what I thought of while typing the question above but there might be a better solution to this as well. #include <ScreenCapture.au3> $LastScreen = _ScreenSave(9) MsgBox(), "Test", "Last Screen .jpg saved was " & $LastScreen) Func _ScreenSave($iLastScreen) Local $iLastScreen, $sOutput DirCreate(@ScriptDir & "\SS\") For $i = $iLastScreen To 10 $sOutput = StringRegExpReplace("Screen" & $i & ".jpg", "([a-zA-Z]+)(\d{1})(\..+)", "${1}00$2$3") If Not FileExists(@ScriptDir & "\SS\" & $sOutput) Then _ScreenCapture_Capture(@ScriptDir & "\SS\" & $sOutput) Return $i EndIf Next EndFunc
  12. I just create my aligned buttons through For loop. I added variables to be able to change space and amount of buttons. Below is just an example for vertical but could easily be changed to horizonal #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 200, 200) Global $Button[1], $spacer = 16, $buttons = 10 For $i = 0 to $buttons $Button[$i] = GUICtrlCreateButton("Button " & $i, 10, $i*$spacer, -1, 15) ReDim $Button[UBound($Button)+1] Next Global Const $ctrl_offset = $Button[1] - $Button[0] GUISetState(@SW_SHOW) Do $msg = GUIGetMsg() Switch $msg Case $Button[0] To $Button[$buttons] $x = Abs(($msg - $Button[0]) / $ctrl_offset) MsgBox(0, "Test", "Button " & $x & " was clicked") EndSwitch Until $msg = $GUI_EVENT_CLOSE GUIDelete($hGUI) Exit
  13. I figured it out: ShellExecute(@ScriptDir & "\Test.exe", "Test.txt") If $CmdLineRaw <> "" Then Local $sFile = $CmdLineRaw Else Local $sFile = FileOpenDialog('Select File', @DesktopDir, 'Text File (*.txt)', 1) EndIf of course shellexecute will be in another script opening up test.exe
  14. I want to start a script with this: ShellExecute(Test.exe C:ExampleTest.txt) and have it save C:ExampleTest.txt to a variable if started with just Test.exe then $sFile = FileOpenDialog('Select File', @DesktopDir, 'Text File (*.txt)', 1)
×
×
  • Create New...