
bdb4269
Active Members-
Posts
51 -
Joined
-
Last visited
bdb4269's Achievements

Wayfarer (2/7)
0
Reputation
-
Sweet. Thanks!
-
I see what you are talking about how the StartStop() keeps getting run. I was trying to figure out why, and I figured that it is because when nothing is checked or unchecked $nMsg is equal to zero, and it was comparing $nMsg to array values that = 0. (because I have the array going up to 50, but only 1-24 have non-null values) So i just changed this part, and it seems to be working fine now without executing the StartStop() unless something is checked or unchecked. if ($nMsg = $Checkbox[$i]) And Not($nMsg = 0) Then StartStop($i) EndIf
-
This is awesome! Thanks much for this. I always like to see how other people do and organize stuff. I learn best that way! One thing though. The tool currently does not stop recording on all ports when it starts up. (I know because I was testing this while they had ports already started, and those ports were never stopped) My understanding is that the startstop function is only run if GUIGetMsg() returns the ControlID of one of the checkboxs, and that GUIGetMsg() only returns the ControlID of one of the checkboxs if it changed state. Am I misunderstanding that?
-
Your suggestion worked! (I just had to add CRLF which I found out was required) I expanded on it, and have gui to allow our supervisors to start and stop recording on 24 ports. I have never used autoit for TCP connections. Below is my code -- if you have time to give it a once over and let me know if anything looks hinky, that would be awesome! #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Dim $Checkbox[50] Dim $Map[50] $Map[1] = 70 $Map[2] = 71 $Map[3] = 72 $Map[4] = 100 $Map[5] = 101 $Map[6] = 102 $Map[7] = 93 $Map[8] = 92 $Map[9] = 91 $Map[10] = 124 $Map[11] = 125 $Map[12] = 126 $Map[13] = 3 $Map[14] = 4 $Map[15] = 5 $Map[16] = 28 $Map[17] = 27 $Map[18] = 26 $Map[19] = 40 $Map[20] = 39 $Map[21] = 38 $Map[22] = 61 $Map[23] = 62 $Map[24] = 63 #Region ### START Koda GUI section ### Form=C:\Documents and Settings\bbeetle\My Documents\Form1.kxf $Form1 = GUICreate("Wygant Start/Stop Tool", 250, 400, 354, 124) $Checkbox[1] = GUICtrlCreateCheckbox("Port " & $Map[1], 20, 20, 100, 20) $Checkbox[2] = GUICtrlCreateCheckbox("Port " & $Map[2], 20, 50, 100, 20) $Checkbox[3] = GUICtrlCreateCheckbox("Port " & $Map[3], 20, 80, 100, 20) $Checkbox[4] = GUICtrlCreateCheckbox("Port " & $Map[4], 20, 110, 100, 20) $Checkbox[5] = GUICtrlCreateCheckbox("Port " & $Map[5], 20, 140, 100, 20) $Checkbox[6] = GUICtrlCreateCheckbox("Port " & $Map[6], 20, 170, 100, 20) $Checkbox[7] = GUICtrlCreateCheckbox("Port " & $Map[7], 20, 200, 100, 20) $Checkbox[8] = GUICtrlCreateCheckbox("Port " & $Map[8], 20, 230, 100, 20) $Checkbox[9] = GUICtrlCreateCheckbox("Port " & $Map[9], 20, 260, 100, 20) $Checkbox[10] = GUICtrlCreateCheckbox("Port " & $Map[10], 20, 290, 100, 20) $Checkbox[11] = GUICtrlCreateCheckbox("Port " & $Map[11], 20, 320, 100, 20) $Checkbox[12] = GUICtrlCreateCheckbox("Port " & $Map[12], 20, 350, 100, 20) $Checkbox[13] = GUICtrlCreateCheckbox("Port " & $Map[13], 150, 20, 100, 20) $Checkbox[14] = GUICtrlCreateCheckbox("Port " & $Map[14], 150, 50, 100, 20) $Checkbox[15] = GUICtrlCreateCheckbox("Port " & $Map[15], 150, 80, 100, 20) $Checkbox[16] = GUICtrlCreateCheckbox("Port " & $Map[16], 150, 110, 100, 20) $Checkbox[17] = GUICtrlCreateCheckbox("Port " & $Map[17], 150, 140, 100, 20) $Checkbox[18] = GUICtrlCreateCheckbox("Port " & $Map[18], 150, 170, 100, 20) $Checkbox[19] = GUICtrlCreateCheckbox("Port " & $Map[19], 150, 200, 100, 20) $Checkbox[20] = GUICtrlCreateCheckbox("Port " & $Map[20], 150, 230, 100, 20) $Checkbox[21] = GUICtrlCreateCheckbox("Port " & $Map[21], 150, 260, 100, 20) $Checkbox[22] = GUICtrlCreateCheckbox("Port " & $Map[22], 150, 290, 100, 20) $Checkbox[23] = GUICtrlCreateCheckbox("Port " & $Map[23], 150, 320, 100, 20) $Checkbox[24] = GUICtrlCreateCheckbox("Port " & $Map[24], 150, 350, 100, 20) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;-------------------------- Local $ConnectedSocket, $szData Local $vServerIP = "192.168.1.11" Local $nPORT = 1503 ; Start The TCP Services ;============================================== TCPStartup() ; Initialize a variable to represent a connection ;============================================== $ConnectedSocket = -1 ;Attempt to connect to SERVER at its IP and PORT 1503 ;======================================================= $ConnectedSocket = TCPConnect($vServerIP, $nPORT) If @error Then MsgBox(4112, "Error", "TCPConnect failed with WSA error: " & @error) Exit EndIf While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch For $i=1 to 48 if $nMsg = $Checkbox[$i] Then StartStop($i) EndIf Next WEnd Func StartStop($port) If GUICtrlRead($Checkbox[$port]) = $GUI_CHECKED Then TCPSend($ConnectedSocket, "START (1:" & $port & ")" & @CRLF) While 1 $response = TCPRecv($ConnectedSocket,100) If $response <> "" Then ExitLoop WEnd If StringRegExp($response,"ERR609") Then MsgBox(48,"ERROR", "Port " & $Map[$port] & " was already recording!") ElseIf Not(StringRegExp($response,"OK")) Then MsgBox(48,"ERROR", "There was some error starting Port " & $Map[$port] & "! Error message below:" & @CR & @CR & $response) GUICtrlSetState($Checkbox[$port],$GUI_UNCHECKED) Else MsgBox(0,"OK", "Port " & $Map[$port] & " started OK") EndIf ;~ MsgBox(0,"debug",$response) ElseIf GUICtrlRead($Checkbox[$port]) = $GUI_UNCHECKED Then TCPSend($ConnectedSocket, "STOP (1:" & $port & ")" & @CRLF) While 1 $response = TCPRecv($ConnectedSocket,100) If $response <> "" Then ExitLoop WEnd If StringRegExp($response,"ERR608") Then MsgBox(48,"ERROR", "Port " & $Map[$port] & " was already not recording!") ElseIf Not(StringRegExp($response,"OK")) Then MsgBox(48,"ERROR", "There was some error stoping Port " & $Map[$port] & "! Error message below:" & @CR & @CR & $response) ;~ GUICtrlSetState($Checkbox[$port],$GUI_CHECKED) ;I figure if there is an error -- better to just leave this unchecked so no chance that supe's dont think it is recording, when it might not be Else MsgBox(0,"OK", "Port " & $Map[$port] & " stopped OK") EndIf ;~ MsgBox(0,"debug",$response) EndIf EndFunc
-
I dont know much about it -- waiting on info from the recording company -- but from what I can tell it is a super simple network messaging sort of thing. The current tool we have** seems to just send a command like "START (1:1)" or "START (1:12)" or "STOP (1:1)" to port 1503 on the recording server. where 1:1 = <card#>:<port#> There is a tool on the recording server called ECAPI hub where I can see the commands scroll as buttons are pressed on the existing tool. (See attached screen shot) Is there a way I could just send a string like "START (1:1)" to a certain port at a certain IP, in autoit -- so I can just test to see if it works? also -- there is this wikipedia article http://en.wikipedia.org/wiki/User:X!/ECAPI **(that needs to be replaced because of config changes, and the orignal creater is long gone, which I why I need to make one frmo scratch)
-
I need to program something that will send ECAPI commands to a recording server on our network. Can i do this with Autoit? Let me know if any additional information is needed.
-
Using Autoit to access a REST service?
bdb4269 replied to bdb4269's topic in AutoIt General Help and Support
Sweet! Thanks for the info. -
Using Autoit to access a REST service?
bdb4269 replied to bdb4269's topic in AutoIt General Help and Support
/bump I was just wondering if Autoit can be used to access a REST service. And, assuming it can, will someone please point me to a good place to start looking. -
Using Autoit to access a REST service?
bdb4269 replied to bdb4269's topic in AutoIt General Help and Support
/bump -
Using Autoit to access a REST service?
bdb4269 replied to bdb4269's topic in AutoIt General Help and Support
http://www.rememberthemilk.com/services/api/ -
I've never worked with an API, and I am about to try to learn my first. I know the API I am trying to learn, is implemented as a REST service. I was just wondering if Autoit can be used to access a REST service. And, assuming it can, will someone please point me to a good place to start looking.
-
I like it. Thanks!
-
OK -- I think this would do the trick (still may be able to be simplified) $dailySPSSName = "E:\" & $projectName & "spss" & $month & $day If FileExists($dailySPSSName & '.sav') Then If FileExists($dailySPSSName & '_old9_.sav') Then $errletter = "s" CantRunMes ($errletter) Exit EndIf $do_old_1 = 0 For $i = 8 To 1 Step - 1 If Not FileExists($dailySPSSName & '_old' & $i & '_.sav') Then ContinueLoop $nextfile = $i + 1 FileMove($dailySPSSName & '.sav', $dailySPSSName & '_old' & $nextfile & '_.sav') $do_old_1 = 1 ExitLoop Next If $do_old_1 = 0 Then FileMove($dailySPSSName & '.sav', $dailySPSSName & '_old1_.sav') EndIf
-
I just realized, that still would not work, because old0 has to exist (not "not exist") for it to skip the continueloop but if the for loop only goes to one, then it will never rename to old1 -- I think I can figure this out -- I'll post back when i do.
-
lol - I had just realized I forgot the error message, and was going to come back to fix it, and I scrolled to the bottom and at first glance saw your code box, which looked a lot like what I did when I was working on in Scite, and for a split second I was like "what?!? how the hell did my changes from scite get put in my post automagically!" Then i ofcourse realized it wasn't my post But I had still missed the needed "ExitLoop" - so my version still would not have worked right. So thanks much for pointing that out. As far as the month day thing, basically they always equal the current month day, (both in 2 digit format). So the renaming is only meant for if there is more than 1 in a day. One thing though -- I believe the for loop, still needs to goto 0 -- you are correct, that old0 will never exist, but I think the 0 needs to be there so that if only the original file exists, (i.e. old1 does not exist yet) it will get all the way down to 0 before it skips the ContinueLoop, and then it will add 1 to $i making $nextfile = 1 for the FileMove. So here (i think this time), is the code that should work. $dailySPSSName = "E:\" & $projectName & "spss" & $month & $day If FileExists($dailySPSSName & '.sav') Then If FileExists($dailySPSSName & '_old9_.sav') Then $errletter = "s" CantRunMes ($errletter) Exit EndIf For $i = 8 To 0 Step - 1 If Not FileExists($dailySPSSName & '_old' & $i & '_.sav') Then ContinueLoop $nextfile = $i + 1 FileMove($dailySPSSName & '.sav', $dailySPSSName & '_old' & $nextfile & '_.sav') ExitLoop Next EndIf