Jump to content

ScottSaltz

Members
  • Posts

    14
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

ScottSaltz's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. sorry, just looking for help that's all... i tried to delete the message after a little more research...again, sorry... guess i'm too stupid to ask for help
  2. sorry, just looking for help that's all... i tried to delete the message after a little more research...again, sorry
  3. Here is my code to move the mouse every 10 seconds IF the mouse is not "moving" at the moment. the 10 second parameter is hard coded for now. one running, click on the checkbox to "start"... I have run this on Windows7 and Windows8 with no problems. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=C:Program Files (x86)AutoIt3Iconsau3.ico #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <array.au3> #include <ButtonConstants.au3> #include <Date.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <StaticConstants.au3> #include <StringConstants.au3> #include <Timers.au3> #include <WindowsConstants.au3> $gbTesting = True ; Create a GUI with various controls. Global $hGUI = GUICreate("Example", 300, 200) Global $iEvenOdd = 1 Global $gSeconds = 10 Global $giCalc = 1000 * $gSeconds Global $aPos, $aPos2 Global $iTotal = 0 Global $iSkipped = 0 Global $giMouseAdjustment = 1 #Region ### START Koda GUI section ### Form= $hGUI = GUICreate("Wiggle", 206, 148, 192, 125) $idCheckbox = GUICtrlCreateCheckbox("On/Off", 41, 8, 50, 17) $idCloser = GUICtrlCreateButton("Close", 15, 90, 84, 25) $Label1 = GUICtrlCreateLabel("x:", 36, 32, 45, 17, $SS_RIGHT) $Label2 = GUICtrlCreateLabel("y:", 36, 56, 45, 17, $SS_RIGHT) $Label3 = GUICtrlCreateLabel("Secs", 148, 8, 39, 17, $SS_RIGHT) $Label4 = GUICtrlCreateLabel("Total", 116, 32, 70, 17, $SS_RIGHT) $Label5 = GUICtrlCreateLabel("Skipped", 116, 56, 70, 17, $SS_RIGHT) $Label6 = GUICtrlCreateLabel("+/-", 116, 80, 70, 17, $SS_RIGHT) $Label7 = GUICtrlCreateLabel("Label7", 13, 120, 180, 17) GUICtrlSetData(-1,_now()) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) Example() Func Example() ; Loop until the user exits. Local $array, $iSecValue, $bLoop = True While $bLoop = True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idCloser ExitLoop Case $idCheckbox If _IsChecked($idCheckbox) Then _Reset() EndIf EndSwitch If _IsChecked($idCheckbox) Then $iEvenOdd = _Loop($iEvenOdd) $hStarttime = _Timer_Init() $iTimeDiff = 0 While $iTimeDiff < $giCalc $iTimeDiff=_Timer_Diff($hStarttime) $array = StringSplit($iTimeDiff,'.',$STR_ENTIRESPLIT) $left = StringLeft($array[1],1) If Number($array[1]) < 1000 Then $iSecValue = 0 Else $iSecValue = $giCalc / 1000 EndIf ;~ _ArrayDisplay($array) Switch StringLen($array[1]) Case 4 GUICtrlSetData($Label3,StringLeft($array[1],1)) Case 5 GUICtrlSetData($Label3,StringLeft($array[1],2)) Case 6 GUICtrlSetData($Label3,StringLeft($array[1],3)) EndSwitch Sleep(250) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idCloser $bLoop = False ExitLoop Case $idCheckbox If _IsChecked($idCheckbox) Then _Reset() EndIf EndSwitch WEnd GUICtrlSetData($Label3,0) EndIf WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>Example Func _Reset() GUICtrlSetData($Label7,'Started: ' & _now()) $iTotal = 0 GUICtrlSetData($Label4,'Total: ' & $iTotal) $iSkipped = 0 GUICtrlSetData($Label5,'Skips: ' & $iSkipped) EndFunc Func _IsChecked($idControlID) Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked Func _Loop($EvenOdd) Local $FuncName = '_Loop.' & @ScriptLineNumber Local $aPos = MouseGetPos() sleep(500) Local $aPos2 = MouseGetPos() If $aPos[0] = $aPos2[0] _ And $aPos[1] = $aPos2[1] Then If $EvenOdd = 1 Then $x = $aPos[0] + $giMouseAdjustment $y = $aPos[1] + $giMouseAdjustment Else $x = $aPos[0] - $giMouseAdjustment $y = $aPos[1] - $giMouseAdjustment EndIf GUICtrlSetData($Label1,'x: ' & $x) GUICtrlSetData($Label2,'y: ' & $y) MouseMove($x,$y) $iTotal += 1 GUICtrlSetData($Label4,'Total: ' & $iTotal) If $EvenOdd = 2 Then $EvenOdd = 1 $sign = '+' Else $EvenOdd += 1 $sign = '-' EndIf GUICtrlSetData($Label6,$sign) Else $iSkipped += 1 GUICtrlSetData($Label5,'Skips: ' & $iSkipped) EndIf Return $EvenOdd EndFunc
  4. This will allow me to pass data TO the AutoIT program... one 1/2 of the puzzle... the other 1/2 is to return values back. The documentation does not make reference, that I could find, to that?
  5. Thank you for your replies... My intention was to try and use AutoIT to handle the GUI for my Cobol program. I must pass the "values" returned from the screen from the AutoIT .dll BACK to the Cobol program.
  6. Anyone know how to build/create/compile AutoIT program into .dll instead of a .exe? I am attempting to use AutoIT for the Screens in my Cobol programs. I need to pass values between the Cobol program and AutoIT .dll and have values passed back (from the screen). Any thoughts (besides COBOL - WTF??) Thanks
  7. I would love to use AutoIT for the GUI interface with existing back end system, written in another language. Does anyone know, is it possible to compile AutoIT script into a .dll and call from a different language? Thanks, Scott
  8. This is the input I was looking for to explain it: @ScottSaltz - Check this link out and see if it helps
  9. The server that is appearing to be locked, is running Thin clients and when a program blows up a window pops up on the desktop of the server. The application on the Client hangs until the window on the Server is acknowledged. Sometimes programmers are on the Server desktop (remote desktop) and other times we are not.
  10. that is exactly what I am using and it's waiting to be "active", but reporting the window as "visible".
  11. Hi guys, I'm an old time programmer but kind of new to Autoit and appreciate any input. I have a script written to look for a window to pop up on the screen (screen which is a server in the computer room) that needs the button clicked for acknowledgement. I have it working just fine until there is no one logged on to the console of the server (maybe it's locked at this point and I have to just deal with that?). My log file is reporting that the script found the window to exist and has the Handle but is waiting for the window to be "Active" before continuing. At this point, if I Remote Desktop to the server, I see the window there and then watch the script click the button and the log file then reports it as being done. Just looking for possible suggestions on what to try here, thanks in advance! Scott
  12. There is a complete coded sample: #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <SendMessage.au3> $hGUI = GUICreate("Test", 500, 500) GUICtrlCreateProgress(10, 10, 400, 20, $PBS_MARQUEE) _SendMessage(GUICtrlGetHandle(-1), $PBM_SETMARQUEE, True, 50) ; final parameter is update time in ms GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _SendMessage(GUICtrlGetHandle(-1), $PBM_SETMARQUEE, False, 50) ; final parameter is update time in ms SLEEP(1000) Exit EndSwitch WEnd
  13. I found this to work to stop a progress bar and start it back up again: Turn OFF: _SendMessage(GUICtrlGetHandle($Progress1), $PBM_SETMARQUEE, False, 50) Turn back ON: _SendMessage(GUICtrlGetHandle($Progress1), $PBM_SETMARQUEE, True, 50) ; final parameter is update time in ms ($Progress1 is the name of the progress bar that was created)
×
×
  • Create New...