Jump to content

RickB75

Active Members
  • Posts

    246
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by RickB75

  1. Thanks @abberration. I already have something similar in place exactly like that now for non payment. It's a empty txt file named Yes.txt. If I change it No.txt, the program stops and simply doesn't run it's course that day. My issue is, the main.exe and the update.exe don't run all day. They are set to run once per day at seperate times. Initially at setup and install, I did put logic in place for the main.exe to be able to create and write files in the script dir. Thats what it does on a daily basis. I was thinking I could do another update and add logic into the main.exe to download a seperate exe like your speaking about and have it run in the back ground and check my server every 5 mins to check a file name or something to trigger the main.exe to run. I haven't tried that yet ( downloading a seperate exe).
  2. Guys, I have an application that has been running for about 1 1/2 years now with a customer of mine. I have logic built into it to check for remote updates that I publish. It works. Everything works. I recently just did another update and it worked. My issue is I have to wait for the following day for the program to run to verify it in fact did update correctly. My update exe basically checks the file versions of the installed exe's and checks my server for those specific exes and if the file versions are diff, it downloads the newest version to the PC. It is set to do this via the Task Scheduler daily. My question is, how can I trigger a manual run?? I was thinking about trying to implement the Remote GMail script somewhere or somehow. That way, I could just send an email and it would fire off any of the exe's I tell it to regardless if it's the update exe or any of the other 3 I have in place. I'm trying to do this without bothering my customer. We do have great communication and a great relationship. I do realize I may simply have to write the script, compile it, call and have him to download and install it. I was just wondering if you guys had any pointers or ideas you could share. I don't even know if it's possible to. Just curious. Thanks for you help!! Any advice is always appreciated!!
  3. What my initial approach was is to loop through the array and grab each item in the determined positions and then compare them. It never crossed my mind to combine them and then compare them. Thank you both for your examples and insight. Both of them work. In this situation, @kylomas yours perfectly fitted into my main script with only minor edits to the main script. Thank you @AutoBert and @kylomas for chiming in and helping me!! It is very very much appreciated!!!
  4. I know this loop structure isn't correct. But I am trying Local $aTemp [0][2] Local $avArray[10][3] = [["1234A","a","2016"],["4321A","b","2016"],["2354B","c","2017"],["6524A","b","2016"],["1234A","a","2017"],["6524A","a","2016"],["1234A","b","2016"],["2354B","c","2017"],["5896A","b","2016"],["5469B","a","2017"]] _ArrayDisplay($avArray) For $i = 0 To UBound($avArray) - 1 MsgBox(0,'data ' & $i, $avArray[$i][0] & ' ' & $avArray[$i][2]) $index = _Arraysearch($aTemp,$avArray[$i][0]) If @error = 3 or 6 Then $aTemp[$i][0] = $avArray[$i][0] $aTemp[$i][1] = $avArray[$i][2] ElseIf $index >= 0 Then If $aTemp[0][1] <> $avArray[$i][2] Then $aTemp[0][0] = $avArray[$i][0] $aTemp[0][1] = $avArray[$i][2] EndIf EndIf Next _ArrayDisplay($aTemp)
  5. Guys, I'm kinda stumped on how to get the correct data from this array. What I need: I need to a unique array containing unique data from the items in position 0 and position 2. I know I can use _ArrayUnique but that is only for a single column. I need an array that basically unique using two identifiers. Column 0 and column 2. Can you guys help?? #include <Array.au3> #include <String.au3> Local $aTemp [0][2] Local $avArray[10][3] = [["1234A","a","2016"],["4321A","b","2016"],["2354B","c","2017"],["6524A","b","2016"],["1234A","a","2017"],["6524A","a","2016"],["1234A","b","2016"],["2354B","c","2017"],["5896A","b","2016"],["5469B","a","2017"]] _ArrayDisplay($avArray)
  6. just curious if you guys can chime in and help me with the structure of run command to get it to run correctly in CMD. Run (@ComSpec & " /c " & 'C:\Program Files (x86)\Windows Kits\8.0\bin\x64\signtool.exe sign /t http://timestamp.comodoca.com/rfc3161 /a ' & $sInputBoxAnswer,'',@SW_SHOW)
  7. Guys, I have a quick question. Can you help me structure the run command correctly to sign my exe's from an input box? I can sign them now directly from CMD and have been doing so for a while. When I compile the EXE, I have it set to sign after it's compiled. I'm trying to simplify the signing of the installer EXE . Here's what I have so far. While 1 #Region --- CodeWizard generated code Start --- ;InputBox features: Title=Yes, Prompt=Yes, Default Text=No, Width=400, Height=150 If Not IsDeclared("sInputBoxAnswer") Then Local $sInputBoxAnswer $sInputBoxAnswer = InputBox("Name and location of the file to be signed","Enter the full Location of the file to be signed!",""," ","400","150",Default,Default) Select Case @Error = 0 ;OK - The string returned is valid ;MsgBox features: Title=Yes, Text=Yes, Buttons=Yes and No, Icon=None If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(4,"The File To be signed.",$sInputBoxAnswer) Select Case $iMsgBoxAnswer = 6 ;Yes Run (@ComSpec & " /c " & 'C:\Program Files (x86)\Windows Kits\8.0\bin\x64\signtool.exe sign /t http://timestamp.comodoca.com/rfc3161 /a ' & $sInputBoxAnswer,'',@SW_SHOW) Case $iMsgBoxAnswer = 7 ;No ContinueCase EndSelect Case @Error = 1 ;The Cancel button was pushed Exit Case @Error = 3 ;The InputBox failed to open EndSelect #EndRegion --- CodeWizard generated code End --- WEnd
  8. @TheDcoder Thank you so much for replying to my question. I apologize for it taking so long for me replying back. Ended up having to take an unexpected trip out of town and then got covered up with work. I tried your suggestion and it works perfect. Once again, thank you for chiming in and helping!!!
  9. Guys, Just a quick question. When I run this the first time, it works like it suppose to. The issue is when I want to see another set of dates on a second run, I get an Array error "Array variable has incorrect number of subscripts or subscript dimension range exceeded" Do I need to do an Array delete function to get it to work to run multiple times? #include <Array.au3> #include <String.au3> #include <ButtonConstants.au3> #include <DateTimeConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1_1 = GUICreate("Form1", 863, 645, 192, 123) $Tab1 = GUICtrlCreateTab(8, 8, 841, 553, $TCS_FIXEDWIDTH) $Main = GUICtrlCreateTabItem("Main") $Date1 = GUICtrlCreateMonthCal(@YEAR &'/'&@MON &'/'& @MDAY, 142, 157, 249, 185) $Date2 = GUICtrlCreateMonthCal(@YEAR &'/'&@MON &'/'& @MDAY, 478, 157, 257, 185) $Label1 = GUICtrlCreateLabel("Start Date", 227, 125, 83, 28) GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("End Date", 563, 125, 82, 28) GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif") $go = GUICtrlCreateButton("Run", 568, 382, 99, 33) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $stop = GUICtrlCreateButton("Stop and Exit", 216, 382, 99, 33) GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlCreateTabItem("") $Progress1 = GUICtrlCreateProgress(8, 608, 390, 25) $Progress2 = GUICtrlCreateProgress(430, 609, 390, 25) $Label5 = GUICtrlCreateLabel("Main Progress", 8, 584, 74, 17) $Label6 = GUICtrlCreateLabel("Current Process Progress", 429, 589, 123, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $stop Exit Case $go $Date1 = GUICtrlRead($Date1) $Date2 = GUICtrlRead($Date2) ;GuiDelete($Form1) $Date1 = StringSplit($Date1,'/',2) $Date2 = StringSplit($Date2,'/',2) MsgBox(0,'Date',$Date1[0] & '/' & $Date1[1] & '/' & $Date1[2] & ' - ' & $Date2[0] & '/' & $Date2[1] & '/' & $Date2[2]) EndSwitch WEnd
  10. @BrewManNH That's all I had to do??? $aArray_Base[$i][3] = $aTemp1[$i] Something so simple. I've been sitting here trying all diff kinds of functions and could not get it to work. I think I'm equally embarrassed and mad at myself right now for not knowing better! LOL Thank you!!!
  11. Ok. First of all, thank you guys so much for your advice and help. It is truly very much appreciated. I'm always very humbled by everyone's willingness to offer help!!! I'm gonna try and put this together so everyone can understand what I'm trying to accomplish and show me a smarter / better way to accomplish my goal. Here is a example of my code that I have working now. What I would love to have is, instead of building the 2nd Temp array, I already have the additional column in the first array ($aArray_Base). I have the data that I want to insert into that first array ($aArray_Base) in the $aTemp1 array. How can I loop through the $aTemp1 array and Place "A" in the correct position ( [0][3] ), "B" in the next position ([1][3], and so on... #include <Array.au3> Local $aArray_Base[10][4] For $i = 0 To 9 For $j = 0 To 2 $aArray_Base[$i][$j] = $i & " - " & $j Next Next _ArrayDisplay($aArray_Base, "2D - Original") Local $aTemp1[11] = ['A','B','C','D','E','F','G','H','I','J','K'] _ArrayDisplay($aTemp1, "1D - Original") Local $aTemp2 [0][4] For $i = 0 To UBound($aArray_Base) -1 _ArrayAdd($aTemp2,$aArray_Base [$i][0] & '|' & $aArray_Base [$i][1] & '|' & $aArray_Base [$i][2] & '|' & $aTemp1 [$i],0,'|') Next _ArrayDisplay($aTemp2,"Revised Array with Col Added") Also, keep in mind for example purpose the $aTemp1 array is already built here. In my main script, I build $aTemp1 array via the loop. It's a simple 1D array with only 1 position in it.
  12. Well... I ended up building another array identical to my first array ($aTemp [0][4]) and named it $aTemp2 [0][4]. I'm populating it via the _ArrayAdd function at the end of my For To Loop using a ubound counter from the first array. It seems like an unnecessary additional step since the first array is already pre built with an empty column just sitting there. You have to basically build a string with delimiters and then split the string on the delimiters to insert into the array. Seems like there would be a function similar to _ArrayAdd that you could define the positions on where you want to add the data instead of at the end of the Array. I tried using _ArrayInsert but it is inserting an entire additional row. Maybe, I'm just using it wrong. Who Knows _ArrayAdd($aTemp2,$aTemp[$i][0] & "|" & $aTemp[$i][1] & "|" & $aTemp[$i][2] & "|" & $SecString[0],0,"|" )
  13. sorry for the late reply guys. Had dinner and kids homework to tend to As I run the script, I check for the Array structure with a 4th column built. I guess I was hoping to insert data through out the array as I'm looping through my main loop and use the positioning in my main loop for the positioning in the Array. I can build the seperate array and then Insert the data i guess. I just feel more comfortable to add to the array as I'm looping through it. my array structure is this. $aTemp [0][4]
  14. Guys, Been a while since I've been on here. I've ran into a stumbling block with a 2d array. Briefly, here's what I have. I've created a zero based 2d array with 4 columns total. I have a loop using items from the 3rd column to fetch items and populate the 4th column. As I'm looping through I would love to just write to that particular position / column in the array. I can build and display a 1d array with the data built and it looks perfect. I keep running into problems though trying to insert the data. I can use arrayadd and it only add's the data at the end of the array which I expected but for testing, It works. Just adds the data in the wrong position. I guess my question is, if you guys want to data from one array to a specific position in a diff array via a loop, how do you do this?? What function? Right now, I'm kinda lost.
  15. I just did a quick search for "Jenkins reporting" and it looks like a really cool tool @jdelaney. This is the first time I've heard of it. Just doing a quick read on the wiki, it looks like a pretty solid tool.
  16. Guys, I was just wondering how most of you guys are tracking the results of your scripts. I know alot of you guys measure how efficiently your scripts run and I'm sure your checking the console or writing this data into a log file. I'm wondering if any of you are measuring things like this over time? Hourly, Daily, Weekly, monthly, etc. and if your using a dashboard. I've been playing around with measuring by pushing data into Google Analytics via measurement protocol. I'm only sending Event data into GA so really I'm tracking single events for the most part. Daily Run times, number of processes particular scripts perform, etc... I did find a cool free reporting dashboard online called CYFE and you can basically send anything to them in the right format and build out a dashboard for it. With so many scripts that run and do diff things, I was just curious if you guys are measuring them. If you are using some sortof dashboard, do you mind sharing what your using.
  17. Adam, That works absolutely perfectly!! Thank you!
  18. Guys, Just a quick question. I've been Signing the complied exe after it was complied by opening CMD and typing in my all the criteria to run the signtool. Looking in the SciTE editor, I think I can do this in one motion as long as I put in the correct params in the Run After section of the Compiler. Is this a good method and can one of you guys give me a little help on inputing my criteria in that box if it is a good practice. This is what I input currently into CMD I do a cd c:\ Then I do one more cd to C:\Program Files (x86)\Windows Kits\8.0\bin\x64> . I'm sure I could do this in the first step. Just habit I guess. Once I'm here, I then input my params for signtool signtool sign /t http://timestamp.comodoca.com/rfc3161 /a C:\myfilelocation\myfile.exe
  19. I follow you now @tatoo236. @MuffinMan has a good example you can implement. You needed to add a loop into your script. What the example is doing is in loop and sleeping for 1 min until the magic hour of 7pm or 19:00. If you look in the help file, you will see that the _nowTime function with a paramater of 4 is converting the result to a 24hr format. In the example, make sure to change $TimeToReboot to $HourToReboot in the 'IF' statement. Just make sure to put MuffinMan's script above yours like below. Also, comment out the MsgBox or set a time option like this MsgBox (0,"","Rest of your program will run here at or after the specified hour",5) The MsgBox above will timeout after 5 seconds. #include <IE.au3> #include <AutoItConstants.au3> #include <Date.au3> $HourToReboot = 19 ; the hour you want router to be reset If StringLeft(_NowTime(4),2) < $HourToReboot Then Do Sleep(60000) ; wait a minute Until StringLeft(_NowTime(4),2) >= $HourToReboot EndIf MsgBox (0,"","Rest of your program will run here at or after the specified hour") If ProcessExists("uTorrent.exe") Then ProcessClose("utorrent.exe") EndIf Local $oIE, $oUN $oIE = _IECreate("192.168.1.1") _IELoadWait($oIE) $oUN = _IEGetObjById($oIE, "unLi") Send("USERNAME") Sleep(4000) Send("{TAB}") Send("PASSWORD") Send("{ENTER}") Send("{RWINDOWN}") Send("{UP}") Send("{RWINUP}") Sleep(10000) MouseClick("left",68,376) Sleep(2000) MouseClick("left",67,570) Sleep(6000) MouseClick("left",791,328) Sleep(1000) Send("{ENTER}") Sleep(105000) If ProcessExists("iexplore.exe") Then ProcessClose("iexplore.exe") EndIf Sleep(1000) Run("C:\Users\User\AppData\Roaming\uTorrent\uTorrent.exe")
  20. Have you tried Windows Task Scheduler and starting your script at 7:00pm? I don't know what "Windows Tasker" is. If what you mean is Windows Task Scheduler, is your PC set to lock windows after a certain amount of time? Are you saying you tried rebooting your modem at 7pm using windows task scheduler or tried running your script using task scheduler? Your script is using active windows it looks like and if your screen is locked when the script starts then it will pretty much fail. Does your script work when the PC is unlocked and not in sleep mode?
  21. This was my test script and it worked just as I expected. #include <Array.au3> #include <String.au3> Local $aArrayLoop1[0] For $i = 1 To 10 _ArrayAdd($aArrayLoop1,$i) Next _ArrayDisplay($aArrayLoop1) Local $aArray1[10] Local $aArray2[10] Local $aArray3[5] For $i = 0 To UBound($aArray1) -1 $mystring = $aArrayLoop1[$i] Select Case $mystring = 1 MsgBox(0,"found 1 in ArrayLoop1","") Case $mystring = 3 MsgBox(0,"found 3 in ArrayLoop1","Going into For To Loop") Sleep(1000) For $iCt = 0 To Ubound($aArray2) - 1 For $ibox = 0 To UBound($aArray3) - 1 MsgBox(0,"Inside 2nd nested For To loop", "Counting Array3: " & $ibox & " | First For To Loop Count is: " & $iCt) Next Next Sleep(1000) Case $mystring = 5 MsgBox(0,"found 5 in ArrayLoop1","") Case $mystring = 4 MsgBox(0,"found 4 in ArrayLoop1","") Sleep(1000) For $iCt = 0 To Ubound($aArray2) - 1 For $ibox = 0 To UBound($aArray3) - 1 MsgBox(0,"Inside 2nd nested For To loop", "Counting Array3: " & $ibox & " | Second For To Loop Count is: " & $iCt) Next Next Sleep(1000) Case $mystring = 2 MsgBox(0,"found 2 in ArrayLoop1","") Case $mystring = 6 MsgBox(0,"found 6 in ArrayLoop1","") EndSelect Next In my Main "For To Next" loop, I used $i as my Counter. In my main script I used $i as my main counter and I use it as the counter in my nested "For To Next" loops. The count for $i was being thrown off for the main loop because of the Nested loop. Once I changed my counter variable from $i to iCt in my nested loops, it worked perfect.
  22. Ok... after writing a dummy script and testing since I posted this. I did find out that you can for sure include multiple nested For To Next loops inside a Select Case loop. Sooo.... The most simplest mistake one makes while scripting. Would anyone like to guess what it was????
  23. I'm not sure what your Bot is doing but If you want people to download it from a website or the internet in general, you will have to compile it. If it is creating, writing and deleting files on the PC, the person who downloads it will need to have those permissions. Also, if you don't include a digital signature in your exe, windows will throw all kinds of Red Flags to the end user along with the browser the user is using to download it. You may want to check out https://www.comodo.com/ to be able to get a digital Signature along with Nullsoft (NSIS) and use it as a installer. To keep the browser from throwing errors you also may want to look into getting a SSL Certificate if you have your own server or shared hosting server.
  24. sorry for not being more clear. My select Case loop works perfect with out a "For To Next" nested Loop. When I add a For To Next loop inside as part of the statements as defined in the help file Select Case <expression1> statement1 ... [Case <expression2> statement2 ...] [Case <expressionn> statementn ...] [Case Else statementElse ...] EndSelect my select case loop breaks and doesn't finish checking the remaining Case <expressions> . Example: If I have 10 Case <expressions> and matches are made on the first 3 that do not contain a "For To Next" Loop but the 4th Case does contain a "For To Next" Loop in it's statement, the script skips all the remaining Case <expressions>. Number 4 with the "For To Next" loop did get completed but everything else got skipped that comes after number 4 and basically the script moves on to the next part outside of the Select Case Loop. Here's my issue. I am renaming files using a Select Case loop. Once the files are renamed I also FTP those files to a server. This is all done in the "statement" after the expression has been matched. This part works perfect. Earlier this week I was told I would need to change some value fields inside those files before I upload them. My thoughts were "no problem". I'll just create a "For To Next" loop inside each one of the statements and change the values that need to be change and then FTP them out all in pretty much one motion inside of statement after the match has been made. When I added the For To Next Loop, the script only renamed part of the files like it should have and skipped the remaining ones. When I remove the For To Next loop, the script renames and FTP's like it has been for the past year and a half.
  25. Guys, I'm running in to an issue with one of my scripts working with a nested For To Next loop inside a Select Case. This isnt the actual script. It's just an example layout. For $i = O To 10 Select Case $mystring = 1 ;do this Case $mystring = 2 ;do that Case $mystring = 3 For $iLine = 0 To 10 For $iCt = 0 To 5 msgbox(0,"Counting to Five", $iCt) Next Next EndSelect Next Am I missing something. I can comment out the For To Next loop and everything works as expected. Once I try and run it with the next For To Next loop though, it breaks at that point.
×
×
  • Create New...