Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/09/2016 in all areas

  1. A little sneak peek for the next version...especially for users with high res (dpi) monitors: ISN 1.03 will by fully High DPI compatible! And many windows in the ISN can be resized! (For a better view) So stay tuned!
    4 points
  2. water

    AD - Active Directory UDF

    Version 1.6.3.0

    17,290 downloads

    Extensive library to control and manipulate Microsoft Active Directory. Threads: Development - General Help & Support - Example Scripts - Wiki Previous downloads: 30467 Known Bugs: (last changed: 2020-10-05) None Things to come: (last changed: 2020-07-21) None BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort
    1 point
  3. water

    Active Directory UDF

    I have converted and extended the adfunctions.au3 written by Jonathan Clelland to a full AutoIt UDF including help file, examples, ScITE integration etc. The example scripts should run fine without changes. 2016-08-18: Version: 1.4.6.0 As always: Please test before using in production! KNOWN BUGS: (Last changed: ) None AD 1.4.6.0.zip For AutoIt >= 3.3.12.0 AD 1.4.0.0.zip other versions of AutoIt
    1 point
  4. I prefer StringInStr: #include <File.au3> Global $aCars, $sCar = "Car 5" _FileReadToArray('carsharing.txt', $aCars) $sFound = _SearchLastState($sCar) MsgBox($MB_ICONINFORMATION, "Last Status for "&$sCar&": ", $sFound) Func _SearchLastState($sCar) For $i = $aCars[0] To 1 Step -1 If StringInStr($aCars[$i], $sCar) Then Return $aCars[$i] Next EndFunc ;==>_SearchLastState I used carsharing.txt
    1 point
  5. Then I suggest something like this (untested): #include <File.au3> Global $aFile, $sCar = "Car 5" FileReadToArray("FilePath of the file to read", $aFile) For $i = $aFile[0] to 1 Step -1 If StringLeft($aFile[$i], StringLen($sCar) + 16) = $sCar & " checked out by " Then ConsoleWrite($aFile[$i]) Exitloop EndiF Next
    1 point
  6. So this is what I suspect the deal is; you're running FF with elevated privs, explorer does not run with elevated privs. When you double-click a .htm the OS sees the FF process is open but the non-elevated process cannot interact with the elevated one. There may be an event log entry showing a security failure which would indicate that it is trying but failing. Make sense? For my own curiosity; Why are you running FF with admin rights anyways? It's never a good idea to browse the web with an elevated browser.
    1 point
  7. Jos

    SciTE bugs

    Geeeezzz ... you probably should take up writing novels! And please stop all this arguing about right or wrong. A space is a delimiter for command lines ... right or wrong? Now back to seeing if we can find a easy solution for your problem: Have you tried using parameter 3 & 4 in stead of 1&2 and is that working? Jos
    1 point
  8. This a script for making PixelChecksums easier, with skeleton code generation. I'm quite sure many people have done this, here is my contribution though. Use Ctrl + Shift + x to select a coordinate and Ctrl + Shift + c to make a PixelChecksum of selected coordinates. Ctrl + Shift + z clears the text box. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> HotKeySet("^+x", "getMousePos") HotKeySet("^+c", "getPixelChecksum") HotKeySet("^+z", "clearEdit") $winHeight = 600 $winWidth = 430 $mainWindow = GUICreate("Pixel Checksum Automation", $winWidth, $winHeight, @DesktopWidth - $winWidth - 50) GUISetState() WinSetOnTop("Pixel Checksum Automation", "", 1) $fileMenu = GUICtrlCreateMenu("&File") $fileOpen = GUICtrlCreateMenuItem("Open...", $fileMenu) $fileSave = GUICtrlCreateMenuItem("Save...", $fileMenu) $fileExit = GUICtrlCreateMenuItem("Exit", $fileMenu) $settingsMenu = GUICtrlCreateMenu("&Settings") $settingsOnTop = GUICtrlCreateMenuItem("Always on top", $settingsMenu) GUICtrlSetState(-1, $GUI_CHECKED) $helpMenu = GUICtrlCreateMenu("&Help") $helpHelp = GUICtrlCreateMenuItem("Help", $helpMenu) GUICtrlCreateLabel("Mouse Position", 5, 5) GUICtrlCreateLabel("X:", 5, 20) GUICtrlCreateLabel("Y:", 55, 20) $xValue = GUICtrlCreateLabel("", 20, 20, 30, 15) $yValue = GUICtrlCreateLabel("", 70, 20, 30, 15) GUICtrlCreateLabel("While loop:", 5, 35) $whileEquals = GUICtrlCreateCheckbox("Equals", 5, 50) $whileNotEquals = GUICtrlCreateCheckbox("Not Equals", 70, 50) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlCreateLabel("Do loop:", 190, 35) $doEquals = GUICtrlCreateCheckbox("Equals", 190, 50) $doNotEquals = GUICtrlCreateCheckbox("Not Equals", 255, 50) GUICtrlCreateLabel("If statement:", 5, 70) $ifEquals = GUICtrlCreateCheckbox("Equals", 5, 85) $ifNotEquals = GUICtrlCreateCheckbox("Not Equals", 70, 85) GUICtrlCreateLabel("Combined with Global Const:", 190, 70) $yes = GUICtrlCreateCheckbox("Yes", 190, 85) GUICtrlCreateLabel("Variable name:", 230, 89) $globalConstInput = GUICtrlCreateInput("", 303, 85, 100, 20) GUICtrlCreateLabel("Upper left coordinates:", 5, 105) GUICtrlCreateLabel("Lower right coordinates:", 5, 120) $upperLeft = GUICtrlCreateLabel("", 125, 105, 60) $lowerRight = GUICtrlCreateLabel("", 125, 120, 60) $clearCoordinates = GUICtrlCreateButton("Clear coordinates", 190, 108) $currentCoordinate = "upper_left" $edit = GUICtrlCreateEdit("", 5, 140, $winWidth - 10, 435) Dim $x1 = 0, $y1 = 0, $x2 = 0, $y2 = 0 While 1 $msg = GUIGetMsg() Switch $msg Case $fileExit ExitLoop Case $fileOpen $openFile = FileOpenDialog("Open file", @ScriptDir, "Text files (*.txt)", 3) $openFileHandle = FileOpen($openFile, 0) $text = FileRead($openFileHandle) GUICtrlSetData($edit, $text) FileClose($openFileHandle) Case $fileSave $text = GUICtrlRead($edit) $saveFile = FileSaveDialog("Save file", @ScriptDir, "Text files (*.txt)", 18) If StringCompare(StringRight($saveFile, 4), ".txt", 0) <> 0 Then $saveFile = $saveFile & ".txt" EndIf $saveFileHandle = FileOpen($saveFile, 2) FileWrite($saveFileHandle, $text) FileClose($saveFileHandle) Case $settingsOnTop If BitAND(GUICtrlRead($settingsOnTop), $GUI_CHECKED) = $GUI_CHECKED Then WinSetOnTop("Pixel Checksum Automation", "", 0) GUICtrlSetState($settingsOnTop, $GUI_UNCHECKED) Else WinSetOnTop("Pixel Checksum Automation", "", 1) GUICtrlSetState($settingsOnTop, $GUI_CHECKED) EndIf Case $helpHelp MsgBox(64, "Help", "Use Shift + Control + x to select coordinates, Shift + Control + c to do a pixel checksum of the selected coordinates and Shift + Control + z to clear the edit box") Case $clearCoordinates clearCoordinates() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch $array = MouseGetPos() GUICtrlSetData($xValue, $array[0]) GUICtrlSetData($yValue, $array[1]) Sleep(30) WEnd GUIDelete() Func getMousePos() $array = MouseGetPos() If $currentCoordinate = "upper_left" Then GUICtrlSetData($upperLeft, $array[0] & ", " & $array[1]) $x1 = $array[0] $y1 = $array[1] $currentCoordinate = "lower_right" ElseIf $currentCoordinate = "lower_right" Then GUICtrlSetData($lowerRight, $array[0] & ", " & $array[1]) $x2 = $array[0] $y2 = $array[1] $currentCoordinate = "upper_left" EndIf EndFunc Func getPixelChecksum() If $x1 > $x2 Or $y1 > $y2 Then WinSetOnTop("Pixel Checksum Automation", "", 0) MsgBox(48, "Bad coordinates", "You have entered bad coordinates! The upper left corner coordinates must be above and to the left of the lower right coordinates.") If BitAND(GUICtrlRead($settingsOnTop), $GUI_CHECKED) = $GUI_CHECKED Then WinSetOnTop("Pixel Checksum Automation", "", 1) EndIf clearCoordinates() Else $checksum = PixelChecksum($x1, $y1, $x2, $y2) $text = GUICtrlRead($edit) $varName = GUICtrlRead($globalConstInput) If BitAND(GUICtrlRead($whileEquals), $GUI_CHECKED) = $GUI_CHECKED Then If BitAND(GUICtrlRead($yes), $GUI_CHECKED) <> $GUI_CHECKED Then GUICtrlSetData($edit, $text & "While(PixelChecksum(" & $x1 & "," & $y1 & "," & $x2 & "," & $y2 & ") = " & $checksum & ")" & @CRLF & @CRLF & "WEnd" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) Else GUICtrlSetData($edit, $text & "While(PixelChecksum($" & $varName & "X1, $" & $varName & "Y1, $" & $varName & "X2, $" & $varName & "Y2) = $" & $varName & "Checksum)" & @CRLF & @CRLF & "WEnd" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X1 = " & $x1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y1 = " & $y1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X2 = " & $x2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y2 = " & $y2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Checksum = " & $checksum & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "-------------------------------------------------------------------------------------" & @CRLF) EndIf EndIf $text = GUICtrlRead($edit) If BitAND(GUICtrlRead($whileNotEquals), $GUI_CHECKED) = $GUI_CHECKED Then If BitAND(GUICtrlRead($yes), $GUI_CHECKED) <> $GUI_CHECKED Then GUICtrlSetData($edit, $text & "While(PixelChecksum(" & $x1 & "," & $y1 & "," & $x2 & "," & $y2 & ") <> " & $checksum & ")" & @CRLF & @CRLF & "WEnd" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) Else GUICtrlSetData($edit, $text & "While(PixelChecksum($" & $varName & "X1, $" & $varName & "Y1, $" & $varName & "X2, $" & $varName & "Y2) <> $" & $varName & "Checksum)" & @CRLF & @CRLF & "WEnd" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X1 = " & $x1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y1 = " & $y1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X2 = " & $x2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y2 = " & $y2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Checksum = " & $checksum & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "-------------------------------------------------------------------------------------" & @CRLF) EndIf EndIf $text = GUICtrlRead($edit) If BitAND(GUICtrlRead($doEquals), $GUI_CHECKED) = $GUI_CHECKED Then If BitAND(GUICtrlRead($yes), $GUI_CHECKED) <> $GUI_CHECKED Then GUICtrlSetData($edit, $text & "Do" & @CRLF & @CRLF & "Until PixelChecksum(" & $x1 & "," & $y1 & "," & $x2 & "," & $y2 & ") = " & $checksum & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) Else GUICtrlSetData($edit, $text & "Do" & @CRLF & @CRLF & "Until PixelChecksum($" & $varName & "X1, $" & $varName & "Y1, $" & $varName & "X2, $" & $varName & "Y2) = $" & $varName & "Checksum" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X1 = " & $x1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y1 = " & $y1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X2 = " & $x2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y2 = " & $y2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Checksum = " & $checksum & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "-------------------------------------------------------------------------------------" & @CRLF) EndIf EndIf $text = GUICtrlRead($edit) If BitAND(GUICtrlRead($doNotEquals), $GUI_CHECKED) = $GUI_CHECKED Then If BitAND(GUICtrlRead($yes), $GUI_CHECKED) <> $GUI_CHECKED Then GUICtrlSetData($edit, $text & "Do" & @CRLF & @CRLF & "Until PixelChecksum(" & $x1 & "," & $y1 & "," & $x2 & "," & $y2 & ") <> " & $checksum & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) Else GUICtrlSetData($edit, $text & "Do" & @CRLF & @CRLF & "Until PixelChecksum($" & $varName & "X1, $" & $varName & "Y1, $" & $varName & "X2, $" & $varName & "Y2) <> $" & $varName & "Checksum" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X1 = " & $x1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y1 = " & $y1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X2 = " & $x2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y2 = " & $y2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Checksum = " & $checksum & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "-------------------------------------------------------------------------------------" & @CRLF) EndIf EndIf $text = GUICtrlRead($edit) If BitAND(GUICtrlRead($ifEquals), $GUI_CHECKED) = $GUI_CHECKED Then If BitAND(GUICtrlRead($yes), $GUI_CHECKED) <> $GUI_CHECKED Then GUICtrlSetData($edit, $text & "If PixelChecksum(" & $x1 & "," & $y1 & "," & $x2 & "," & $y2 & ") = " & $checksum & " Then" & @CRLF & @CRLF & "EndIf" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) Else GUICtrlSetData($edit, $text & "If PixelChecksum($" & $varName & "X1, $" & $varName & "Y1, $" & $varName & "X2, $" & $varName & "Y2) = $" & $varName & "Checksum Then" & @CRLF & @CRLF & "EndIf" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X1 = " & $x1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y1 = " & $y1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X2 = " & $x2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y2 = " & $y2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Checksum = " & $checksum & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "-------------------------------------------------------------------------------------" & @CRLF) EndIf EndIf $text = GUICtrlRead($edit) If BitAND(GUICtrlRead($ifNotEquals), $GUI_CHECKED) = $GUI_CHECKED Then If BitAND(GUICtrlRead($yes), $GUI_CHECKED) <> $GUI_CHECKED Then GUICtrlSetData($edit, $text & "If PixelChecksum(" & $x1 & "," & $y1 & "," & $x2 & "," & $y2 & ") <> " & $checksum & " Then" & @CRLF & @CRLF & "EndIf" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) Else GUICtrlSetData($edit, $text & "If PixelChecksum($" & $varName & "X1, $" & $varName & "Y1, $" & $varName & "X2, $" & $varName & "Y2) <> $" & $varName & "Checksum Then" & @CRLF & @CRLF & "EndIf" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X1 = " & $x1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y1 = " & $y1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X2 = " & $x2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y2 = " & $y2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Checksum = " & $checksum & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "-------------------------------------------------------------------------------------" & @CRLF) EndIf EndIf EndIf EndFunc Func clearCoordinates() GUICtrlSetData($upperLeft, "") GUICtrlSetData($lowerRight, "") $currentCoordinate = "upper_left" $x1 = 0 $y1 = 0 $x2 = 0 $y2 = 0 EndFunc Func clearEdit() GUICtrlSetData($edit, "") EndFunc
    1 point
  9. wakillon

    Shape2Polygon

    Create simple forms from polygon is easy but its more difficult with complex forms, so... Shape2Polygon permit to get Polygon array Coordinates from a Black and White Shape for be used with _GDIPlus_GraphicsDrawPolygon. Source, compiled Version and Shape Samples are available in the download section. Hope it can help ! If you get an error while scanning, post the shape and i will try to update the script.
    1 point
  10. wakillon

    Shape2Polygon

    Don't know if it's what you want... #include <GUIConstantsEx.au3> #include <GDIPlus.au3> #include <WindowsConstants.au3> #include <WinAPIGdi.au3> #include <Array.au3> Local $aPoints = [[215,0],[1,126],[1,128],[0,135],[1,142],[2,149],[3,156],[5,163],[8,170],[11,177],[15,184],[20,191],[25,198],[32,205],[39,212],[46,218],[53,223],[60,227],[67,231],[74,234],[81,237],[88,240],[95,241],[101,240],[97,233],[94,226],[91,219],[89,212],[89,201],[92,194],[99,187],[106,184],[122,184],[129,185],[136,187],[143,189],[150,192],[157,197],[164,204],[167,203],[173,196],[180,190],[187,186],[201,186],[208,188],[215,192],[222,197],[229,204],[235,211],[240,218],[245,225],[249,232],[252,239],[256,245],[260,238],[263,231],[267,224],[271,217],[277,210],[284,203],[291,196],[298,191],[305,188],[312,185],[320,185],[327,186],[334,191],[341,198],[345,205],[349,204],[356,198],[363,193],[370,189],[377,186],[384,184],[396,184],[403,185],[410,187],[417,192],[422,199],[422,213],[420,220],[418,227],[414,234],[409,241],[410,244],[417,242],[424,240],[431,238],[438,234],[445,231],[452,227],[459,222],[466,217],[473,210],[480,203],[486,196],[492,189],[496,182],[501,175],[504,168],[507,161],[509,154],[510,147],[511,140],[510,133],[510,120],[508,113],[506,106],[503,99],[499,92],[494,85],[488,78],[481,71],[474,65],[467,59],[460,54],[453,49],[446,45],[439,41],[432,37],[425,33],[418,30],[411,26],[404,23],[397,21],[390,18],[383,16],[376,13],[370,16],[374,23],[377,30],[379,37],[379,55],[377,62],[374,69],[369,76],[362,83],[355,88],[348,91],[341,93],[333,93],[326,91],[319,88],[312,82],[305,75],[301,68],[297,61],[295,54],[292,47],[291,40],[289,33],[288,26],[287,19],[287,7],[286,0],[281,7],[277,14],[273,21],[271,28],[259,28],[252,29],[245,28],[238,21],[235,14],[231,7],[224,0],[224,17],[223,24],[223,33],[222,40],[220,47],[218,54],[216,61],[213,68],[208,75],[201,82],[194,87],[187,90],[180,92],[171,92],[164,91],[157,89],[150,85],[143,78],[138,71],[134,64],[132,57],[132,40],[134,33],[136,26],[139,19],[137,13],[130,15],[123,18],[116,20],[109,23],[102,26],[95,29],[88,32],[81,35],[74,39],[67,43],[60,47],[53,52],[46,57],[39,63],[32,70],[26,77],[20,84],[15,91],[11,98],[8,105],[5,112],[3,119],[1,126]] Global $hGraphic, $hBrush, $hBrushFont, $hFont, $hFormat, $hFamily, $hGUI, $tRect_Coords[4] ;would be used in two functions therefore declared as global. Global $iTheme = 0 Local $hPen, $hPath $Version = 1; 1 or 2 Example() $Version = 2; 1 or 2 Example() Func Example() ; Create GUI $hGUI = GUICreate("GDI+", _ArrayMax($aPoints) + 100, _ArrayMax($aPoints, 0, -1, -1, 1) + 100) ; Fill a rectangle _GDIPlus_Startup() $tRect_Coords[0] = 0 $tRect_Coords[1] = 0 $tRect_Coords[2] = _ArrayMax($aPoints) + 100 $tRect_Coords[3] = _ArrayMax($aPoints, 0, -1, -1, 1) + 100 $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;Create a graphics object from a window handle _GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;Sets the graphics object rendering quality (antialiasing) _GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF) $hBrush = _GDIPlus_HatchBrushCreate(35, 0xFF606060, 0xFF000000) $hPen = _GDIPlus_PenCreate(0xFF202020, 3) ;_GDIPlus_PenSetMiterLimit($hPen, 10) _GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPROUND) $hMatrix = _GDIPlus_MatrixCreate() $hPath = _GDIPlus_PathCreate() ;Create new path object ;~ _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 7.5) _GDIPlus_PathAddPolygon ( $hPath, $aPoints ) ; move coordinates 50 pixels on x/y axis _GDIPlus_MatrixTranslate($hMatrix, 50, 50) _GDIPlus_PathTransform($hPath, $hMatrix) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI) ;Register for painting GUIRegisterMsg($WM_PAINT, "WM_PAINT") ;$WM_PAINT GUISetState() ; Loop until the user exits. If $Version = 1 Then Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_PRIMARYDOWN If CheckPointer($tRect_Coords) Then SetThemev1(1) Case $GUI_EVENT_PRIMARYUP If CheckPointer($tRect_Coords) Then SetThemev1(2) Else SetThemev1(0) EndIf Case $GUI_EVENT_MOUSEMOVE If GetTheme() = 1 Then ContinueLoop If CheckPointer($tRect_Coords) Then SetThemev1(2) Else SetThemev1(0) EndIf EndSwitch Until 0 Else Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_PRIMARYDOWN If CheckPointer($tRect_Coords) Then SetThemev2(1) Case $GUI_EVENT_PRIMARYUP If CheckPointer($tRect_Coords) Then SetThemev2(2) Else SetThemev2(0) EndIf Case $GUI_EVENT_MOUSEMOVE If GetTheme() = 1 Then ContinueLoop If CheckPointer($tRect_Coords) Then SetThemev2(2) Else SetThemev2(0) EndIf EndSwitch Until 0 EndIf ; Clean up resources _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_BrushDispose($hBrush) _GDIPlus_BrushDispose($hBrushFont) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc ;==>Example Func WM_PAINT($hGUI, $iMsg, $wParam, $lParam) _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_UPDATENOW) ;Your Code must lie below ;Paint the string _GDIPlus_GraphicsClear($hGraphic, 0xFFF0F0F0) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI) _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_VALIDATE) Return 0;'GUI_RUNDEFMSG' EndFunc ;==>WM_PAINT Func CheckPointer(ByRef $aiCoords_ClientRel) Return _WinAPI_PtInRectEx(_WinAPI_GetMousePosX(True, $hGUI), _WinAPI_GetMousePosY(True, $hGUI), $aiCoords_ClientRel[0], $aiCoords_ClientRel[1], $aiCoords_ClientRel[2] + $aiCoords_ClientRel[0], $aiCoords_ClientRel[3] + $aiCoords_ClientRel[1]) EndFunc ;==>CheckPointer Func GetTheme() Return $iTheme EndFunc ;==>GetTheme Func SetThemev1($Theme, $f_Redraw = true) If GetTheme() = $Theme Then Return 1 If $Theme = 0 Then ;Idle $hBrush = _GDIPlus_HatchBrushCreate(35, 0xFF606060, 0xFF000000) $hPen = _GDIPlus_PenCreate(0xFF202020, 3) ;_GDIPlus_PenSetMiterLimit($hPen, 10) _GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPROUND) $hMatrix = _GDIPlus_MatrixCreate() $hPath = _GDIPlus_PathCreate() ;Create new path object ;~ _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 7.5) _GDIPlus_PathAddPolygon ( $hPath, $aPoints ) ; move coordinates 50 pixels on x/y axis _GDIPlus_MatrixTranslate($hMatrix, 50, 50) _GDIPlus_PathTransform($hPath, $hMatrix) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI) ElseIf $Theme = 1 Then ;MouseDown $hBrush = _GDIPlus_HatchBrushCreate(35, 0xFFFF6060, 0xFF000000) $hPen = _GDIPlus_PenCreate(0xFF202020, 3) ;_GDIPlus_PenSetMiterLimit($hPen, 10) _GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPROUND) $hMatrix = _GDIPlus_MatrixCreate() $hPath = _GDIPlus_PathCreate() ;Create new path object ;~ _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 7.5) _GDIPlus_PathAddPolygon ( $hPath, $aPoints ) ; move coordinates 50 pixels on x/y axis _GDIPlus_MatrixTranslate($hMatrix, 50, 50) _GDIPlus_PathTransform($hPath, $hMatrix) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI) ;~ msgbox(0,"","pressed") ElseIf $Theme = 2 Then ;MouseOver $hBrush = _GDIPlus_HatchBrushCreate(35, 0xFFFFFF60, 0xFF000000) $hPen = _GDIPlus_PenCreate(0xFF202020, 3 ) ;_GDIPlus_PenSetMiterLimit($hPen, 10) _GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPROUND) $hMatrix = _GDIPlus_MatrixCreate() $hPath = _GDIPlus_PathCreate() ;Create new path object ;~ _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 7.5) _GDIPlus_PathAddPolygon ( $hPath, $aPoints ) ; move coordinates 50 pixels on x/y axis _GDIPlus_MatrixTranslate($hMatrix, 50, 50) _GDIPlus_PathTransform($hPath, $hMatrix) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI) Else Return SetError(1, 0, 0) EndIf $iTheme = $Theme ConsoleWrite("CurTheme: " & $iTheme & @CRLF) If $f_Redraw Then _WinAPI_RedrawWindow($hGUI, 0, 0, BitOR($RDW_INTERNALPAINT, $RDW_ERASE)) endfunc ;==>SetTheme Func SetThemev2($Theme, $f_Redraw = true) If GetTheme() = $Theme Then Return 1 If $Theme = 0 Then ;Idle $hBrush = _GDIPlus_HatchBrushCreate(35, 0xFF606060, 0xFF000000) $hPen = _GDIPlus_PenCreate(0xFF202020, 3) ;_GDIPlus_PenSetMiterLimit($hPen, 10) _GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPROUND) $hMatrix = _GDIPlus_MatrixCreate() $hPath = _GDIPlus_PathCreate() ;Create new path object ;~ _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 7.5) _GDIPlus_PathAddPolygon ( $hPath, $aPoints ) ; move coordinates 50 pixels on x/y axis _GDIPlus_MatrixTranslate($hMatrix, 50, 50) _GDIPlus_PathTransform($hPath, $hMatrix) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI) ElseIf $Theme = 1 Then ;MouseDown $hBrush = _GDIPlus_HatchBrushCreate(35, 0xFFFF6060, 0xFFFF6060) $hPen = _GDIPlus_PenCreate(0xFFFF6060, 3) ;_GDIPlus_PenSetMiterLimit($hPen, 10) _GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPROUND) $hMatrix = _GDIPlus_MatrixCreate() $hPath = _GDIPlus_PathCreate() ;Create new path object ;~ _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 7.5) _GDIPlus_PathAddPolygon ( $hPath, $aPoints ) ; move coordinates 50 pixels on x/y axis _GDIPlus_MatrixTranslate($hMatrix, 50, 50) _GDIPlus_PathTransform($hPath, $hMatrix) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI) ;~ msgbox(0,"","pressed") ElseIf $Theme = 2 Then ;MouseOver $hBrush = _GDIPlus_HatchBrushCreate(35, 0xFFFFFF60, 0xFFFFFF60) $hPen = _GDIPlus_PenCreate(0xFFFFFF60, 3) ;_GDIPlus_PenSetMiterLimit($hPen, 10) _GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPROUND) $hMatrix = _GDIPlus_MatrixCreate() $hPath = _GDIPlus_PathCreate() ;Create new path object ;~ _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 7.5) _GDIPlus_PathAddPolygon ( $hPath, $aPoints ) ; move coordinates 50 pixels on x/y axis _GDIPlus_MatrixTranslate($hMatrix, 50, 50) _GDIPlus_PathTransform($hPath, $hMatrix) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI) Else Return SetError(1, 0, 0) EndIf $iTheme = $Theme ConsoleWrite("CurTheme: " & $iTheme & @CRLF) If $f_Redraw Then _WinAPI_RedrawWindow($hGUI, 0, 0, BitOR($RDW_INTERNALPAINT, $RDW_ERASE)) endfunc ;==>SetTheme
    1 point
  11. The regexp engine will do exactly what the pattern says, so its pretty much generic. Precise explanation given by https://regex101.com/ below. Now if ever the ID or the search string might contain regexp metacharacter, a good precaution would be to make sure these strings are interpreted literally. Also in this case, the m modifier (multiline) isn't needed. What do you mean by " a line upwards or downwards "? Is it that the identifier could be place after the Auth response??? In that case the pattern would need serious rewrite. OTOH if you mean that there can be an unspecified number of lines between ID and auth repsonse, then yes, the pattern is totally generic. Could be megabytes between id and response, but the first response found after ID will make it, regardless of thread. If you need something else, just ask. The code would then become: Local $sFile = "samplelog.txt" Local $sUniqueId = "005P9272" Local $sSearch = "Auth response is as follow :" Local $sText = FileRead($sFile) Local $sFound = StringRegExpReplace($sText, "(?is).*?\Q" & $sUniqueId & "\E.*?\Q" & $sSearch & "\E\N*\R(\N*).*", "$1") MsgBox(0, "Response found", $sFound) /(?is).*?005P9272.*?Auth response is as follow :\N*\R(\N*).*/ (?is) Match the remainder of the pattern with the following options: i modifier: insensitive. Case insensitive match (ignores case of [a-zA-Z]) s modifier: single line. Dot matches newline characters .*? matches any character Quantifier: *? Between zero and unlimited times, as few times as possible, expanding as needed [lazy] 005P9272 matches the characters 005P9272 literally (case insensitive) .*? matches any character Quantifier: *? Between zero and unlimited times, as few times as possible, expanding as needed [lazy] Auth response is as follow : matches the characters Auth response is as follow : literally (case insensitive) \N* matches any non-newline character Quantifier: * Between zero and unlimited times, as many times as possible, giving back as needed [greedy] \R matches any Unicode newline sequence; can be modified using verbs 1st Capturing group (\N*) \N* matches any non-newline character Quantifier: * Between zero and unlimited times, as many times as possible, giving back as needed [greedy] .* matches any character Quantifier: * Between zero and unlimited times, as many times as possible, giving back as needed [greedy]
    1 point
  12. Synapsee

    Shape2Polygon

    a pinch of Shape2Polygon + a pinch of UEZ + a pinch of that post = #include <GUIConstantsEx.au3> #include <GDIPlus.au3> #include <WindowsConstants.au3> #include <WinAPIGdi.au3> #include <Array.au3> Local $aPoints = [[215,0],[1,126],[1,128],[0,135],[1,142],[2,149],[3,156],[5,163],[8,170],[11,177],[15,184],[20,191],[25,198],[32,205],[39,212],[46,218],[53,223],[60,227],[67,231],[74,234],[81,237],[88,240],[95,241],[101,240],[97,233],[94,226],[91,219],[89,212],[89,201],[92,194],[99,187],[106,184],[122,184],[129,185],[136,187],[143,189],[150,192],[157,197],[164,204],[167,203],[173,196],[180,190],[187,186],[201,186],[208,188],[215,192],[222,197],[229,204],[235,211],[240,218],[245,225],[249,232],[252,239],[256,245],[260,238],[263,231],[267,224],[271,217],[277,210],[284,203],[291,196],[298,191],[305,188],[312,185],[320,185],[327,186],[334,191],[341,198],[345,205],[349,204],[356,198],[363,193],[370,189],[377,186],[384,184],[396,184],[403,185],[410,187],[417,192],[422,199],[422,213],[420,220],[418,227],[414,234],[409,241],[410,244],[417,242],[424,240],[431,238],[438,234],[445,231],[452,227],[459,222],[466,217],[473,210],[480,203],[486,196],[492,189],[496,182],[501,175],[504,168],[507,161],[509,154],[510,147],[511,140],[510,133],[510,120],[508,113],[506,106],[503,99],[499,92],[494,85],[488,78],[481,71],[474,65],[467,59],[460,54],[453,49],[446,45],[439,41],[432,37],[425,33],[418,30],[411,26],[404,23],[397,21],[390,18],[383,16],[376,13],[370,16],[374,23],[377,30],[379,37],[379,55],[377,62],[374,69],[369,76],[362,83],[355,88],[348,91],[341,93],[333,93],[326,91],[319,88],[312,82],[305,75],[301,68],[297,61],[295,54],[292,47],[291,40],[289,33],[288,26],[287,19],[287,7],[286,0],[281,7],[277,14],[273,21],[271,28],[259,28],[252,29],[245,28],[238,21],[235,14],[231,7],[224,0],[224,17],[223,24],[223,33],[222,40],[220,47],[218,54],[216,61],[213,68],[208,75],[201,82],[194,87],[187,90],[180,92],[171,92],[164,91],[157,89],[150,85],[143,78],[138,71],[134,64],[132,57],[132,40],[134,33],[136,26],[139,19],[137,13],[130,15],[123,18],[116,20],[109,23],[102,26],[95,29],[88,32],[81,35],[74,39],[67,43],[60,47],[53,52],[46,57],[39,63],[32,70],[26,77],[20,84],[15,91],[11,98],[8,105],[5,112],[3,119],[1,126]] Global $hGraphic, $hBrush, $hBrushFont, $hFont, $hFormat, $hFamily, $hGUI, $tRect_Coords[4] ;would be used in two functions therefore declared as global. Global $iTheme = 0 Local $hPen, $hPath $Version = 1; 1 or 2 Example() $Version = 2; 1 or 2 Example() Func Example() ; Create GUI $hGUI = GUICreate("GDI+", _ArrayMax($aPoints) + 100, _ArrayMax($aPoints, 0, -1, -1, 1) + 100) ; Fill a rectangle _GDIPlus_Startup() $tRect_Coords[0] = 0 $tRect_Coords[1] = 0 $tRect_Coords[2] = _ArrayMax($aPoints) + 100 $tRect_Coords[3] = _ArrayMax($aPoints, 0, -1, -1, 1) + 100 $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;Create a graphics object from a window handle _GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;Sets the graphics object rendering quality (antialiasing) _GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF) $hBrush = _GDIPlus_HatchBrushCreate(35, 0xFF606060, 0xFF000000) $hPen = _GDIPlus_PenCreate(0xFF202020, 3) _GDIPlus_PenSetMiterLimit($hPen, 32) _GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPROUND) $hMatrix = _GDIPlus_MatrixCreate() $hPath = _GDIPlus_PathCreate() ;Create new path object _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 7.5) ; move coordinates 50 pixels on x/y axis _GDIPlus_MatrixTranslate($hMatrix, 50, 50) _GDIPlus_PathTransform($hPath, $hMatrix) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI) ;Register for painting GUIRegisterMsg($WM_PAINT, "WM_PAINT") ;$WM_PAINT GUISetState() ; Loop until the user exits. If $Version = 1 Then Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_PRIMARYDOWN If CheckPointer($tRect_Coords) Then SetThemev1(1) Case $GUI_EVENT_PRIMARYUP If CheckPointer($tRect_Coords) Then SetThemev1(2) Else SetThemev1(0) EndIf Case $GUI_EVENT_MOUSEMOVE If GetTheme() = 1 Then ContinueLoop If CheckPointer($tRect_Coords) Then SetThemev1(2) Else SetThemev1(0) EndIf EndSwitch Until 0 Else Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_PRIMARYDOWN If CheckPointer($tRect_Coords) Then SetThemev2(1) Case $GUI_EVENT_PRIMARYUP If CheckPointer($tRect_Coords) Then SetThemev2(2) Else SetThemev2(0) EndIf Case $GUI_EVENT_MOUSEMOVE If GetTheme() = 1 Then ContinueLoop If CheckPointer($tRect_Coords) Then SetThemev2(2) Else SetThemev2(0) EndIf EndSwitch Until 0 EndIf ; Clean up resources _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_BrushDispose($hBrush) _GDIPlus_BrushDispose($hBrushFont) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc ;==>Example Func WM_PAINT($hGUI, $iMsg, $wParam, $lParam) _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_UPDATENOW) ;Your Code must lie below ;Paint the string _GDIPlus_GraphicsClear($hGraphic, 0xFFF0F0F0) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI) _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_VALIDATE) Return 0;'GUI_RUNDEFMSG' EndFunc ;==>WM_PAINT Func CheckPointer(ByRef $aiCoords_ClientRel) Return _WinAPI_PtInRectEx(_WinAPI_GetMousePosX(True, $hGUI), _WinAPI_GetMousePosY(True, $hGUI), $aiCoords_ClientRel[0], $aiCoords_ClientRel[1], $aiCoords_ClientRel[2] + $aiCoords_ClientRel[0], $aiCoords_ClientRel[3] + $aiCoords_ClientRel[1]) EndFunc ;==>CheckPointer Func GetTheme() Return $iTheme EndFunc ;==>GetTheme Func SetThemev1($Theme, $f_Redraw = true) If GetTheme() = $Theme Then Return 1 If $Theme = 0 Then ;Idle $hBrush = _GDIPlus_HatchBrushCreate(35, 0xFF606060, 0xFF000000) $hPen = _GDIPlus_PenCreate(0xFF202020, 3) _GDIPlus_PenSetMiterLimit($hPen, 32) _GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPROUND) $hMatrix = _GDIPlus_MatrixCreate() $hPath = _GDIPlus_PathCreate() ;Create new path object _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 7.5) ; move coordinates 50 pixels on x/y axis _GDIPlus_MatrixTranslate($hMatrix, 50, 50) _GDIPlus_PathTransform($hPath, $hMatrix) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI) ElseIf $Theme = 1 Then ;MouseDown $hBrush = _GDIPlus_HatchBrushCreate(35, 0xFFFF6060, 0xFF000000) $hPen = _GDIPlus_PenCreate(0xFF202020, 3) _GDIPlus_PenSetMiterLimit($hPen, 32) _GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPROUND) $hMatrix = _GDIPlus_MatrixCreate() $hPath = _GDIPlus_PathCreate() ;Create new path object _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 7.5) ; move coordinates 50 pixels on x/y axis _GDIPlus_MatrixTranslate($hMatrix, 50, 50) _GDIPlus_PathTransform($hPath, $hMatrix) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI) ;~ msgbox(0,"","pressed") ElseIf $Theme = 2 Then ;MouseOver $hBrush = _GDIPlus_HatchBrushCreate(35, 0xFFFFFF60, 0xFF000000) $hPen = _GDIPlus_PenCreate(0xFF202020, 3) _GDIPlus_PenSetMiterLimit($hPen, 32) _GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPROUND) $hMatrix = _GDIPlus_MatrixCreate() $hPath = _GDIPlus_PathCreate() ;Create new path object _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 7.5) ; move coordinates 50 pixels on x/y axis _GDIPlus_MatrixTranslate($hMatrix, 50, 50) _GDIPlus_PathTransform($hPath, $hMatrix) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI) Else Return SetError(1, 0, 0) EndIf $iTheme = $Theme ConsoleWrite("CurTheme: " & $iTheme & @CRLF) If $f_Redraw Then _WinAPI_RedrawWindow($hGUI, 0, 0, BitOR($RDW_INTERNALPAINT, $RDW_ERASE)) endfunc ;==>SetTheme Func SetThemev2($Theme, $f_Redraw = true) If GetTheme() = $Theme Then Return 1 If $Theme = 0 Then ;Idle $hBrush = _GDIPlus_HatchBrushCreate(35, 0xFF606060, 0xFF000000) $hPen = _GDIPlus_PenCreate(0xFF202020, 3) _GDIPlus_PenSetMiterLimit($hPen, 32) _GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPROUND) $hMatrix = _GDIPlus_MatrixCreate() $hPath = _GDIPlus_PathCreate() ;Create new path object _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 7.5) ; move coordinates 50 pixels on x/y axis _GDIPlus_MatrixTranslate($hMatrix, 50, 50) _GDIPlus_PathTransform($hPath, $hMatrix) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI) ElseIf $Theme = 1 Then ;MouseDown $hBrush = _GDIPlus_HatchBrushCreate(35, 0xFFFF6060, 0xFFFF6060) $hPen = _GDIPlus_PenCreate(0xFFFF6060, 3) _GDIPlus_PenSetMiterLimit($hPen, 32) _GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPROUND) $hMatrix = _GDIPlus_MatrixCreate() $hPath = _GDIPlus_PathCreate() ;Create new path object _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 7.5) ; move coordinates 50 pixels on x/y axis _GDIPlus_MatrixTranslate($hMatrix, 50, 50) _GDIPlus_PathTransform($hPath, $hMatrix) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI) ;~ msgbox(0,"","pressed") ElseIf $Theme = 2 Then ;MouseOver $hBrush = _GDIPlus_HatchBrushCreate(35, 0xFFFFFF60, 0xFFFFFF60) $hPen = _GDIPlus_PenCreate(0xFFFFFF60, 3) _GDIPlus_PenSetMiterLimit($hPen, 32) _GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPROUND) $hMatrix = _GDIPlus_MatrixCreate() $hPath = _GDIPlus_PathCreate() ;Create new path object _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 7.5) ; move coordinates 50 pixels on x/y axis _GDIPlus_MatrixTranslate($hMatrix, 50, 50) _GDIPlus_PathTransform($hPath, $hMatrix) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI) Else Return SetError(1, 0, 0) EndIf $iTheme = $Theme ConsoleWrite("CurTheme: " & $iTheme & @CRLF) If $f_Redraw Then _WinAPI_RedrawWindow($hGUI, 0, 0, BitOR($RDW_INTERNALPAINT, $RDW_ERASE)) endfunc ;==>SetTheme any people who improve that have my eternal gratitude ^^
    1 point
  13. wakillon

    Shape2Polygon

    Thanks You are right, here is one who was used for Trump campaign ! #Region ;************ Includes ************ #Include <Array.au3> #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #EndRegion ;************ Includes ************ _GDIPlus_Startup() Opt ( 'GUIOnEventMode', 1 ) Global $hGUI, $hGraphic, $hBmp_Buffer, $hGfx_Buffer, $aDim, $aPosCenter, $x, $y ; Code Generated by Shape2Polygon, Polygon Size=328x309 (reduction level=4) from D:\Shape2Polygon\Shapes\Hypnosis-spiral-800px.png Local $aPoints = [[717,0],[164,307],[168,308],[172,308],[190,308],[193,308],[197,307],[202,307],[206,306],[210,305],[214,304],[218,303],[222,302],[226,301],[229,300],[232,298],[236,297],[239,295],[243,294],[246,291],[250,290],[254,288],[258,285],[262,283],[265,281],[269,277],[273,274],[277,271],[281,267],[285,263],[289,259],[292,256],[295,252],[298,248],[300,244],[303,241],[305,237],[308,233],[310,229],[312,225],[313,221],[315,217],[316,214],[318,210],[320,206],[321,202],[322,198],[322,194],[323,190],[324,187],[325,183],[325,179],[325,174],[326,171],[327,168],[327,155],[326,151],[326,147],[325,145],[325,138],[325,135],[324,131],[323,127],[322,124],[322,120],[321,117],[320,113],[318,109],[316,105],[316,101],[313,97],[312,93],[310,90],[308,86],[306,82],[304,79],[301,75],[299,71],[296,67],[293,64],[291,60],[287,56],[284,52],[280,48],[276,44],[272,41],[269,38],[265,34],[261,32],[257,29],[253,26],[249,23],[245,21],[241,19],[237,17],[234,15],[231,14],[227,12],[224,11],[221,9],[217,8],[213,7],[209,6],[205,5],[201,4],[198,3],[195,2],[191,2],[187,1],[182,1],[178,0],[174,0],[171,0],[168,0],[162,0],[159,0],[153,0],[150,0],[146,0],[142,1],[138,2],[135,2],[132,2],[128,3],[125,4],[121,6],[117,6],[114,7],[110,8],[106,10],[102,11],[99,12],[96,14],[92,15],[88,18],[84,19],[82,21],[78,23],[74,25],[71,28],[67,30],[63,32],[59,36],[55,39],[51,42],[47,45],[43,49],[40,53],[36,57],[33,61],[30,65],[27,69],[23,73],[20,77],[18,81],[15,84],[13,88],[12,92],[10,95],[8,99],[6,102],[4,106],[3,110],[2,113],[0,117],[0,120],[0,124],[2,128],[4,131],[8,135],[12,136],[16,136],[20,136],[24,134],[28,130],[29,126],[31,122],[33,118],[34,115],[36,111],[38,108],[40,104],[42,100],[44,97],[47,93],[50,89],[54,85],[56,81],[59,77],[63,73],[66,70],[70,67],[74,64],[78,61],[82,58],[85,56],[88,54],[91,51],[95,49],[99,47],[102,45],[106,43],[110,42],[113,41],[117,39],[121,38],[125,37],[129,36],[133,34],[137,33],[141,33],[145,33],[148,32],[152,31],[161,31],[165,30],[167,31],[179,31],[183,32],[187,33],[191,33],[195,34],[196,34],[200,35],[204,37],[207,38],[211,39],[214,40],[217,42],[221,43],[225,45],[228,48],[232,50],[236,51],[239,54],[243,57],[247,59],[250,63],[254,66],[258,70],[262,74],[266,78],[268,82],[272,86],[274,90],[276,93],[279,96],[281,100],[282,104],[284,108],[285,111],[287,115],[289,119],[289,122],[290,126],[291,129],[292,133],[293,137],[294,140],[295,144],[295,147],[295,151],[295,167],[295,171],[295,174],[294,178],[294,182],[293,185],[292,189],[291,192],[290,196],[289,200],[288,203],[286,207],[284,210],[283,212],[281,215],[280,219],[277,223],[275,227],[272,231],[270,235],[266,239],[262,243],[258,246],[254,249],[251,252],[247,255],[243,258],[239,260],[235,263],[231,265],[227,267],[223,268],[219,270],[216,271],[213,272],[209,273],[205,274],[201,275],[198,275],[195,276],[191,277],[182,277],[179,277],[175,277],[165,277],[162,276],[159,275],[155,275],[152,274],[150,273],[146,272],[143,271],[139,269],[135,268],[132,266],[128,263],[124,261],[121,259],[117,256],[114,254],[110,251],[106,247],[103,243],[100,240],[97,236],[94,232],[92,228],[90,225],[88,222],[86,218],[84,215],[82,212],[81,208],[80,204],[79,200],[78,196],[78,192],[77,189],[76,186],[76,165],[77,162],[77,158],[78,154],[79,151],[80,147],[82,144],[82,140],[84,136],[87,132],[88,128],[92,124],[94,120],[97,117],[100,113],[104,110],[108,106],[111,103],[115,101],[118,98],[122,96],[126,95],[129,92],[133,91],[137,90],[141,88],[145,88],[149,86],[153,86],[158,86],[162,84],[166,84],[169,86],[173,86],[177,86],[180,87],[184,88],[187,88],[191,90],[195,91],[198,93],[202,95],[206,97],[210,100],[214,103],[218,106],[221,110],[224,114],[227,118],[230,122],[232,126],[234,129],[236,133],[237,137],[238,140],[239,144],[240,147],[241,151],[241,167],[240,171],[239,174],[239,178],[237,182],[236,185],[235,189],[232,192],[230,196],[226,200],[223,204],[219,207],[217,210],[213,213],[209,215],[205,217],[201,218],[198,220],[195,221],[191,222],[188,222],[184,223],[178,223],[174,222],[171,222],[168,222],[164,221],[161,219],[157,217],[153,216],[150,213], _ [147,211],[143,207],[140,203],[137,200],[135,196],[134,192],[132,189],[132,185],[130,181],[130,170],[131,166],[132,162],[134,158],[136,154],[140,150],[144,147],[147,143],[151,141],[155,141],[159,139],[166,139],[170,140],[174,141],[178,144],[181,146],[183,149],[186,153],[186,156],[186,160],[183,156],[179,154],[175,152],[167,152],[163,153],[160,155],[156,158],[154,162],[152,165],[150,169],[150,176],[151,180],[152,183],[154,187],[156,191],[160,194],[164,196],[167,198],[171,200],[174,201],[175,201],[184,201],[187,200],[191,199],[195,198],[199,196],[203,192],[207,189],[210,185],[213,182],[214,178],[216,174],[217,171],[218,167],[219,164],[219,154],[218,151],[217,147],[217,144],[215,140],[213,136],[210,133],[208,129],[204,125],[200,121],[197,118],[193,115],[189,114],[186,112],[182,110],[178,110],[174,109],[171,108],[168,108],[160,108],[156,108],[154,109],[150,109],[146,110],[143,111],[139,113],[135,114],[132,117],[128,119],[124,122],[120,126],[117,129],[114,133],[111,137],[108,141],[106,145],[104,149],[103,153],[101,156],[101,160],[100,164],[99,168],[99,185],[100,189],[101,192],[101,196],[103,199],[104,203],[105,207],[108,210],[110,213],[112,217],[114,221],[117,225],[120,228],[123,231],[127,234],[130,237],[133,240],[137,242],[141,244],[145,246],[147,248],[151,249],[155,250],[158,251],[162,253],[166,253],[167,253],[171,254],[188,254],[192,253],[196,253],[200,253],[204,251],[208,250],[211,249],[214,247],[218,246],[220,245],[224,243],[228,240],[231,238],[235,236],[239,232],[243,229],[246,225],[249,222],[252,219],[255,215],[258,211],[260,207],[262,203],[264,200],[265,196],[267,192],[268,188],[270,184],[270,180],[271,176],[272,173],[272,169],[272,165],[272,153],[272,150],[272,145],[271,142],[270,138],[270,134],[268,130],[267,126],[266,123],[264,119],[262,115],[261,111],[259,108],[257,105],[254,101],[251,97],[249,93],[246,90],[242,86],[238,82],[235,79],[231,76],[227,74],[224,72],[221,69],[217,67],[213,65],[210,63],[206,63],[202,60],[198,59],[195,59],[191,57],[188,56],[184,55],[180,55],[177,55],[174,54],[155,54],[152,55],[147,55],[144,55],[141,56],[137,57],[133,57],[129,59],[126,60],[123,61],[119,63],[115,65],[111,67],[108,69],[104,72],[100,74],[96,76],[92,78],[89,81],[85,84],[81,88],[78,91],[74,95],[72,99],[69,102],[66,106],[64,110],[61,114],[59,118],[57,122],[55,126],[54,129],[52,133],[51,137],[50,140],[49,144],[48,147],[47,150],[46,154],[46,158],[46,162],[45,165],[45,185],[46,189],[46,192],[46,196],[47,200],[48,203],[48,207],[50,210],[51,214],[51,218],[53,221],[55,224],[56,228],[57,230],[59,234],[60,237],[63,241],[65,245],[67,248],[69,250],[72,253],[73,255],[74,258],[78,262],[80,264],[84,268],[84,270],[88,272],[92,276],[96,279],[100,282],[103,285],[107,287],[111,290],[114,291],[118,293],[121,295],[125,297],[129,298],[146,304],[159,307]] ; Set Position. $x = 20 $y = 20 $aDim = _PolygonGetSize ( $aPoints ) $hGUI = GUICreate ( 'Vote for Trump !', $aDim[0] +$x*2, $aDim[1] +$y*2 ) GUISetOnEvent ( $GUI_EVENT_CLOSE, '_Exit' ) GUISetState() $hGraphic = _GDIPlus_GraphicsCreateFromHWND ( $hGUI ) $hBmp_Buffer = _GDIPlus_BitmapCreateFromGraphics ( $aDim[0] +$x*2, $aDim[1] +$y*2, $hGraphic ) $hGfx_Buffer = _GDIPlus_ImageGetGraphicsContext ( $hBmp_Buffer ) $aPoints = _PolygonSetPos ( $aPoints, $x, $y ) Dim $aPosCenter[2][2] = [[1]] $aPosCenter[1][0] = $aDim[0]/2 +$x $aPosCenter[1][1] = $aDim[1]/2 +$y While 1 _GDIPlus_GraphicsClear ( $hGfx_Buffer, 0xFFFFFFFF ) _GDIPlus_GraphicsFillPolygon ( $hGfx_Buffer, $aPoints ) _GDIPlus_GraphicsTransformPoints ( $hGfx_Buffer, $aPosCenter ) _GDIPlus_GraphicsTranslateTransform ( $hGfx_Buffer, $aPosCenter[1][0], $aPosCenter[1][1] ) _GDIPlus_GraphicsRotateTransform ( $hGfx_Buffer, 5 ) _GDIPlus_GraphicsTranslateTransform ( $hGfx_Buffer, -$aPosCenter[1][0], -$aPosCenter[1][1] ) _GDIPlus_GraphicsDrawImage ( $hGraphic, $hBmp_Buffer, 0, 0 ) Sleep ( 10 ) WEnd _GDIPlus_GraphicsDispose ( $hGfx_Buffer ) _GDIPlus_BitmapDispose ( $hBmp_Buffer ) _GDIPlus_GraphicsDispose ( $hGraphic ) _GDIPlus_Shutdown() Exit Func _PolygonGetSize ( $aPoints ) If UBound ( $aPoints, 2 ) <> 2 Then Return SetError ( 1, 0, '' ) Local $aRet[2] Local $iXMin = _ArrayMin ( $aPoints, 1, 1, -1, 0 ) Local $iYMin = _ArrayMin ( $aPoints, 1, 1, -1, 1 ) Local $iXMax = _ArrayMax ( $aPoints, 1, 1, -1, 0 ) Local $iYMax = _ArrayMax ( $aPoints, 1, 1, -1, 1 ) $aRet[0] = $iXMax - $iXMin +1 ; width $aRet[1] = $iYMax - $iYMin +1 ; height $aPoints = 0 Return $aRet EndFunc ;==> _PolygonGetSize() Func _PolygonSetPos ( $aPoints, $x=0, $y=0 ) If UBound ( $aPoints, 2 ) <> 2 Then Return SetError ( 1, 0, '' ) Local $iXMin = _ArrayMin ( $aPoints, 1, 1, -1, 0 ) Local $iYMin = _ArrayMin ( $aPoints, 1, 1, -1, 1 ) For $i = 1 To UBound ( $aPoints ) -1 $aPoints[$i][0] = $x + $aPoints[$i][0] - $iXMin $aPoints[$i][1] = $y + $aPoints[$i][1] - $iYMin Next Return $aPoints EndFunc ;==> _PolygonSetPos() Func _Exit() Exit EndFunc ;==> _Exit() Edited cause $aPoints Coordinates disapear when posting with AutoIt format.
    1 point
  14. UEZ

    Shape2Polygon

    Great work again wakillon. A small example how to use the generated array data would be great! Example modified from the help file: #include <Array.au3> #include <GDIPlus.au3> #include <GUIConstantsEx.au3> Example() Func Example() Local $hGUI, $hGraphic, $hBrush, $hPen, $hPath, $hMatrix ; Code Generated by Shape2Polygon, Polygon Size=512x246 (reduction level=8) from C:\...\Shape2Polygon\Sample Shapes\Shape_08.png Local $aPoints = [[215,0],[1,126],[1,128],[0,135],[1,142],[2,149],[3,156],[5,163],[8,170],[11,177],[15,184],[20,191],[25,198],[32,205],[39,212],[46,218],[53,223],[60,227],[67,231],[74,234],[81,237],[88,240],[95,241],[101,240],[97,233],[94,226],[91,219],[89,212],[89,201],[92,194],[99,187],[106,184],[122,184],[129,185],[136,187],[143,189],[150,192],[157,197],[164,204],[167,203],[173,196],[180,190],[187,186],[201,186],[208,188],[215,192],[222,197],[229,204],[235,211],[240,218],[245,225],[249,232],[252,239],[256,245],[260,238],[263,231],[267,224],[271,217],[277,210],[284,203],[291,196],[298,191],[305,188],[312,185],[320,185],[327,186],[334,191],[341,198],[345,205],[349,204],[356,198],[363,193],[370,189],[377,186],[384,184],[396,184],[403,185],[410,187],[417,192],[422,199],[422,213],[420,220],[418,227],[414,234],[409,241],[410,244],[417,242],[424,240],[431,238],[438,234],[445,231],[452,227],[459,222],[466,217],[473,210],[480,203],[486,196],[492,189],[496,182],[501,175],[504,168],[507,161],[509,154],[510,147],[511,140],[510,133],[510,120],[508,113],[506,106],[503,99],[499,92],[494,85],[488,78],[481,71],[474,65],[467,59],[460,54],[453,49],[446,45],[439,41],[432,37],[425,33],[418,30],[411,26],[404,23],[397,21],[390,18],[383,16],[376,13],[370,16],[374,23],[377,30],[379,37],[379,55],[377,62],[374,69],[369,76],[362,83],[355,88],[348,91],[341,93],[333,93],[326,91],[319,88],[312,82],[305,75],[301,68],[297,61],[295,54],[292,47],[291,40],[289,33],[288,26],[287,19],[287,7],[286,0],[281,7],[277,14],[273,21],[271,28],[259,28],[252,29],[245,28],[238,21],[235,14],[231,7],[224,0],[224,17],[223,24],[223,33],[222,40],[220,47],[218,54],[216,61],[213,68],[208,75],[201,82],[194,87],[187,90],[180,92],[171,92],[164,91],[157,89],[150,85],[143,78],[138,71],[134,64],[132,57],[132,40],[134,33],[136,26],[139,19],[137,13],[130,15],[123,18],[116,20],[109,23],[102,26],[95,29],[88,32],[81,35],[74,39],[67,43],[60,47],[53,52],[46,57],[39,63],[32,70],[26,77],[20,84],[15,91],[11,98],[8,105],[5,112],[3,119],[1,126]] ; Create GUI $hGUI = GUICreate("GDI+ Example for Shape2Polygon by UEZ", _ArrayMax($aPoints) + 100, _ArrayMax($aPoints, 0, -1, -1, 1) + 100) GUISetState(@SW_SHOW) _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;Create a graphics object from a window handle _GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;Sets the graphics object rendering quality (antialiasing) _GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF) $hBrush = _GDIPlus_HatchBrushCreate(35, 0xFF606060, 0xFF000000) $hPen = _GDIPlus_PenCreate(0xFF202020, 3) _GDIPlus_PenSetMiterLimit($hPen, 32) _GDIPlus_PenSetDashCap($hPen, $GDIP_DASHCAPROUND) $hMatrix = _GDIPlus_MatrixCreate() $hPath = _GDIPlus_PathCreate() ;Create new path object ;~ _GDIPlus_PathAddPolygon($hPath, $aPoints) _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 7.5) ; move coordinates 50 pixels on x/y axis _GDIPlus_MatrixTranslate($hMatrix, 50, 50) _GDIPlus_PathTransform($hPath, $hMatrix) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI) ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Clean up resources _GDIPlus_PathDispose($hPath) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PenDispose($hPen) _GDIPlus_MatrixDispose($hMatrix) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc ;==>Example
    1 point
  15. AutoIt Studio version 1.02 is now online! Changelog: (by google translator) -> ISN AutoIt Studio: <- ----------------------------------- - Fix: Several bugfixes - Bugfix: "Close project" The trigger is (if enabled) run now by the query for "changes to the project". - Fix: Fixed a bug by AutoComplete has not been time for variables. - Fix: Fixed a bug which was Autocomplete "," does not reappear when writing - Fix: Autocomplete frequently been displayed in comment fields. This is now fixed. - Fix: Fixed bug when canceling the "Import File" dialog - Fix: Fixed bug when saving the project time in Change Logs - NEW: In the project tree a file is selected via Drag'n Drop and down the CTRL key can be created directly a copy of the file. - NEW: When you create a new project from an existing file .au3 there is now the possibility of the folder contents also take over in the new project. - NEW: New menu item in the program settings: "File Locations -> AutoIt paths". - NEW: File Locations for Au3Stripper.exe & Tidy.exe can now be defined in the program settings. Are these not found locally, the supplied files from the ISN package be used. Further also program variables like% isnstudiodir% can now be used for the AutoIt paths. - NEW: The ISN is now its own tool for text searches in multiple files or folders! (Tools -> Find in Files) - NEW: "As agents for change logs always preset the author of the project". This option can now be activated directly when creating a new project. - NEW: The contents of the "author" -Eingabefeldes when creating a new project will be saved for the next time. -> ISN form Studio 2: <- ----------------------------------- - Fix: Several bugfixes - NEW: The Control Editor was revised somewhat. - NEW: By holding down the CTRL key and move the mouse wheel up or down can now Tabseiten the Control Editor are changed. It also works without the CTRL key when the pointer is directly over the Tabseiten! - NEW: New Control: Graphic (GUICtrlCreateGraphic) - NEW: The Control Editor gets on monitors with a small resolution (height) now automatically a vertical scrollbar. Thus, now the "list of Controls" accessible.
    1 point
  16. Gianni

    GIF Animation

    Hi @Mbee have you tried my example in post #151? in short you can: 1) transform your gif image to binary string using the following nice tool by mr. @wakillon. https://www.autoitscript.com/forum/topic/123329-binarytoau3kompressor-v1054-update-of-10-oct-2014/ 2) embedd (the needed part) of the generated code in your script 3) position and resize the images using the _GUICtrlCreateGIF() function created by the guru @trancexx here a simple example. hope it can help #include "GIFAnimation.au3" ; ----- following code generated using Wakillon's BinaryToAu3Kompressor ------ ; ----- https://www.autoitscript.com/forum/topic/123329-binarytoau3kompressor-v1054-update-of-10-oct-2014/ ; Guitarrist Global $sFileBin = '0xF0B200474946383961150000200083000000FFFF00734A00DC9200FFD4408E96620050320080FF000062966E6E6E00003096A0A0A40088090021FF000B4E4554534341504045322E3003010124FE000928432946756D6942650018F904090E00282C03015801C64304AD10C8090082A5180763CEF89B0011480551144091AC0049300485228F9916001CF48DD7DAEBD3BC00CAEBC0319C4EA0DA00B170C0E980C1A744001A9C0AAE5768559800DC563A9C90C805CB0014C809C429CC53A50057B06653CBBB8DA800552A3E1390CDA67E00747C588275571F0200857C1F8C8A14176400155A268F1D162F4500164B8F43451C675D003D30276A05638227002D2F09A66C4A2C0800644C73416E2BB372008E137615B45EBCBD003B79BE7B357ABE75001617C18ACACA53CE14191182600A89600304AC0010C849ABBD2068CC0083F80167791F285200E43008E12905032C00BBAF6AB734ACE2E700366F14420165301C006EC55641389C048C009A58D1A029589B4E0063721A0D609DB1C300B458D0F1C00131F900BABBC8AE082B15680029C712F14292634D00C8127A7B17050985007E31050A8A6713840085086F07928C128E0008855E92937C8680009A9B7C579369079400151AA519A01D9A2100A4A64EA0AF3DB2AB0018B3AAA922B8B8AC00BABD6E1A40AFA601008A8B2FC70A94C2C2282FCD671260A91F60A28000C170B80D79848AF000A0890D0DA110A1500040118F4FA88C5AAD00050ED9A72ED09DC800C059EE6E14E322B800050D4F9288C7126F00AE015348F865750500477C7E7F77050A0A0073137D7E08800507004C84787F54929317008D859198999A7092001AA22EA351A4419800A79F185F99AE8B4A00A8B03DB3A81DB6AC0017B419B7BB722DB000B1198989C1C58ABF30C02FC0737F2F6A2F9B64114B2F096475812F859293008B128D8505939F9A009B70995F943D5F5100993DA019AA41AEA500A166B0AE1DB4A6B600A6B1ABBAB517724000B1A10189892DC4C5E09AC0C1CB157F2FFF5EFF5E3FBF17BF17BF177F2F7F2F6B2F3B' Global $sFileBin1 = Binary(_LzntDecompress($sFileBin)) ; Fish $sFileBin = '0xA2B4004749463839612600502B00C3000100800218800F0230003800200000C0C0C0FFF10040FF00FF0218001C001000000021FF0B4E4554534300415045322E30030101003821F904011900020C002C019801AC870008001208000473080076FF080000FF2100FF2900FF310000FF3900FF4200FF004A00FF5200FF5A0000FF6300FF6B00FF730000FF7B00FF8400FFFE8C0362FF007F003F003F003F003F00033300C0BD05081C48B02000C101030C2A5CC8B00020C2840D234A14F00070A245830F115EDC0088B040010320356E008C380024C88F1F0D00401CA9B0A4C997260057B21C58F280019B00386FEA94C972C081009F40830AE579D1A700D0A343010008B0B400E1D2A708101C881A00752A55A951954ED800BAB569C1A55CBB0600B84AF62A80B0680100103C8B962B80B26500D9B69D1060A0DCB90074132048C0B72FDF00BB73EB0A0880976B0000BF8813006E5B97007061C389FF3E36EC00186D80CB861568DE00AC4031E5CA61315B0036BC350067CE6C2B00832EBD9A2E69BAA70037A77E1DBAB5EAD2000B72EBCE3DBB34E300D67445D3DDBD5BEE0065E08D2707204E1C00786881CE0D33984E00BD7AF4D203A307A800CE9DBAF682C2593300DD6830BE3CF9F30C00BE1B3C7EB981FBF100EEDFC77F1F3E38C30001F3F3EBD7CF5EF000FD060EB817608000001668E0800212D59200030C36D860034A2900E5E0840A2A44C084000D2E751C00183A5000A1850F3018A20321006A781C892232F8A10041043CE0E28B0F9800C81E8C2EAE48C08D0038B648A38CC7D19800514604E5882304440042F000043C5E56E400913F563490900210005064914906302504001035F9E48D075D5900E5942B692910970700450041046822D91F009A69CAF4234966B200C9239B11AC28D10000744660229D764E8400670412001AA8048300F669119E84269AA800A1450DA0A80422CDC0D4D09B1B05043F9E3F9EFF3F9E1F001F001F001F001F001F001F00FF1F001F001F001F001F001F001F001F00FF1F001F001F000F000F000F000F001F4FFF1F4F1F4F1F4F1F4F1F4F1F4F1F4F1F4FBF1F4F1F4F1F4F1F4F1F4F134FDE1F4F031F4F1D4F81043AE8A082000A1120E183100A080060831456F800831F00329821820D84F84000870611F0C08A2C6A0038E2872CA248C08C0034AAC8E287230A78006346191154238D10000419648E040A7922008F2209F4A30004080029A4525042E9240400102139108D074D090040840002E0E44A56002A498043114010C10099101CD8C09968CA00C4234965B249A203006C4680A24403D49900E19A67DE39519E1100482041A0820E2A81009F16E56968A18222005AD4008C1EEAE848006F6E14100021FE89005468697320616E69406D617465642050A4200066696C65207761730020636F6E73747275026381017573696E672050556C656143024112036F007220547269616C200056657273696F6E2C40207669736974D0022000617420687474703A802F2F7777772E758103802E636F6D20746F0006006E64206F7574206D006F72652E015553532050434D540040A8504918414E59E00540A849312E0067696602433A5C6100786F6F6D6E6577650073745C6772617068906963735CD20101323F02033802D2010101003B' Global $sFileBin2 = Binary(_LzntDecompress($sFileBin)) Func _LzntDecompress($bBinary); by trancexx $bBinary = Binary($bBinary) Local $tInput = DllStructCreate('byte[' & BinaryLen($bBinary) & ']') DllStructSetData($tInput, 1, $bBinary) Local $tBuffer = DllStructCreate('byte[' & 16 * DllStructGetSize($tInput) & ']') Local $a_Call = DllCall('ntdll.dll', 'int', 'RtlDecompressBuffer', 'ushort', 2, 'ptr', DllStructGetPtr($tBuffer), 'dword', DllStructGetSize($tBuffer), 'ptr', DllStructGetPtr($tInput), 'dword', DllStructGetSize($tInput), 'dword*', 0) If @error Or $a_Call[0] Then Return SetError(1, 0, '') Local $tOutput = DllStructCreate('byte[' & $a_Call[6] & ']', DllStructGetPtr($tBuffer)) Return SetError(0, 0, DllStructGetData($tOutput, 1)) EndFunc ;==>_LzntDecompress ; ------ end of Decompression ------------------------------------------------ Opt("GUICloseOnESC", 1); ESC to exit Opt("MustDeclareVars", 1) ; Make GUI Global $hGui = GUICreate("GIF Animation", 450, 350) ; GIF job ; _GUICtrlCreateGIF( BinFile, "", xPosition, yPosition, xWidth, yHeight) ; Gutarrist _GUICtrlCreateGIF($sFileBin1, "", 5, 5, 35, 35) _GUICtrlCreateGIF($sFileBin1, "", 80, 80, 55, 55) _GUICtrlCreateGIF($sFileBin1, "", 90, 170, 155, 155) GUICtrlSetTip(-1, "ESC to exit") ; Fish _GUICtrlCreateGIF($sFileBin2, "", 55, 5, 35, 35) _GUICtrlCreateGIF($sFileBin2, "", 180, 80, 55, 55) _GUICtrlCreateGIF($sFileBin2, "", 270, 170, 155, 155) GUICtrlSetTip(-1, "ESC to exit") ; Show it GUISetState() ; Loop till end While 1 If GUIGetMsg() = -3 Then Exit WEnd
    1 point
  17. mikell

    auto select radio buttons

    Try to add this to the previous code While $oIE.busy ; add this to wait for complete loading of the new page Sleep(100) Wend $oButton = _IEGetObjByName($oIE, "clin_list_menu") $oButton.Focus() $oButton.Click()
    1 point
  18. here is what the source code looks like after i login: function old_build_vendor_menu(){ /* used on all Vendor Only web pages */ //alert("start function old_build_vendor_menu"); var myMenu = '<FORM ID="MENU" NAME="MENU" METHOD="post">n'; myMenu += '<TABLE BORDER="0" ALIGN="center" CELLPADDING="2" CELLSPACING="0" CLASS="table_font" NOWRAP>n'; //--------------- first row ---------------- myMenu += '<TR ALIGN="center" NOWRAP>n'; myMenu += '<TD ALIGN="center" VALIGN="middle" NOWRAP CLASS="CHOP_header_text_graphic">n'; myMenu += ' <INPUT TYPE="button" NAME="vendor_home" VALUE="CHOP Home" CLASS="button" onClick="document.MENU.action = '; myMenu += "'https://"+document.domain+"/cgi-bin/log_in.pl'"; myMenu += '; document.MENU.ACTION.value = '+"'HOME'"+'; return isVendorId('+"'MENU'"+');">n'; myMenu += ' <IMG SRC="/images/1pixel.gif" WIDTH="10" HEIGHT="1">n'; myMenu += ' <INPUT TYPE="button" NAME="clin_check" VALUE="CLIN Checker" CLASS="button" onClick="OpenInNewWin('; myMenu += "'https://"+document.domain+"/cgi-bin/clin_checker.pl'"; myMenu += ', '525', '850');">n'; myMenu += ' <IMG SRC="/images/1pixel.gif" WIDTH="10" HEIGHT="1">n'; myMenu += ' <INPUT TYPE="button" ID="clin_list_menu" NAME="clin_list_menu" VALUE="CLIN List" CLASS="button" onClick="document.MENU.action='; myMenu += "'https://"+document.domain+"/sewp/jsp/ViewClinList.action'"; myMenu += '; document.MENU.ACTION.value = '; myMenu += "' '"; etc........................... i want to click on the "CLIN List" button. So which part of the source code would i add to my script to do that? jev
    1 point
  19. For what it's worth, I added the ability to change the Coord Mode. I needed "client area" for my current project and decided I'd try my hand at the GuiCtrl functions, rather than hardcoding the setting into the script. It makes the script that much more valuable to me. I have no experience with the GuiCtrl functions yet, so go easy on me if it looks hacky. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> HotKeySet("^+x", "getMousePos") HotKeySet("^+c", "getPixelChecksum") HotKeySet("^+z", "clearEdit") $winHeight = 600 $winWidth = 430 $mainWindow = GUICreate("Pixel Checksum Automation", $winWidth, $winHeight, @DesktopWidth - $winWidth - 50) GUISetState() WinSetOnTop("Pixel Checksum Automation", "", 1) $fileMenu = GUICtrlCreateMenu("&File") $fileOpen = GUICtrlCreateMenuItem("Open...", $fileMenu) $fileSave = GUICtrlCreateMenuItem("Save...", $fileMenu) $fileExit = GUICtrlCreateMenuItem("Exit", $fileMenu) $settingsMenu = GUICtrlCreateMenu("&Settings") $settingsOnTop = GUICtrlCreateMenuItem("Always on top", $settingsMenu) GUICtrlSetState(-1, $GUI_CHECKED) $settingsCoordMode = GUICtrlCreateMenu("Coord Mode", $settingsMenu) $coordModeScreen = GUICtrlCreateMenuItem("Screen", $settingsCoordMode) GUICtrlSetState(-1, $GUI_CHECKED) $coordModeWindow = GUICtrlCreateMenuItem("Window", $settingsCoordMode) $coordModeClient = GUICtrlCreateMenuItem("Client", $settingsCoordMode) $helpMenu = GUICtrlCreateMenu("&Help") $helpHelp = GUICtrlCreateMenuItem("Help", $helpMenu) GUICtrlCreateLabel("Mouse Position", 5, 5) GUICtrlCreateLabel("X:", 5, 20) GUICtrlCreateLabel("Y:", 55, 20) $xValue = GUICtrlCreateLabel("", 20, 20, 30, 15) $yValue = GUICtrlCreateLabel("", 70, 20, 30, 15) GUICtrlCreateLabel("While loop:", 5, 35) $whileEquals = GUICtrlCreateCheckbox("Equals", 5, 50) $whileNotEquals = GUICtrlCreateCheckbox("Not Equals", 70, 50) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlCreateLabel("Do loop:", 190, 35) $doEquals = GUICtrlCreateCheckbox("Equals", 190, 50) $doNotEquals = GUICtrlCreateCheckbox("Not Equals", 255, 50) GUICtrlCreateLabel("If statement:", 5, 70) $ifEquals = GUICtrlCreateCheckbox("Equals", 5, 85) $ifNotEquals = GUICtrlCreateCheckbox("Not Equals", 70, 85) GUICtrlCreateLabel("Combined with Global Const:", 190, 70) $yes = GUICtrlCreateCheckbox("Yes", 190, 85) GUICtrlCreateLabel("Variable name:", 230, 89) $globalConstInput = GUICtrlCreateInput("", 303, 85, 100, 20) GUICtrlCreateLabel("Upper left coordinates:", 5, 105) GUICtrlCreateLabel("Lower right coordinates:", 5, 120) $upperLeft = GUICtrlCreateLabel("", 125, 105, 60) $lowerRight = GUICtrlCreateLabel("", 125, 120, 60) $clearCoordinates = GUICtrlCreateButton("Clear coordinates", 190, 108) $currentCoordinate = "upper_left" $edit = GUICtrlCreateEdit("", 5, 140, $winWidth - 10, 435) Dim $x1 = 0, $y1 = 0, $x2 = 0, $y2 = 0 While 1 $msg = GUIGetMsg() Switch $msg Case $fileExit ExitLoop Case $coordModeWindow AutoItSetOption("PixelCoordMode",0) AutoItSetOption("MouseCoordMode",0) GUICtrlSetState($coordModeScreen, $GUI_UNCHECKED) GUICtrlSetState($coordModeWindow, $GUI_CHECKED) GUICtrlSetState($coordModeClient, $GUI_UNCHECKED) Case $coordModeScreen AutoItSetOption("PixelCoordMode",1) AutoItSetOption("MouseCoordMode",1) GUICtrlSetState($coordModeScreen, $GUI_CHECKED) GUICtrlSetState($coordModeWindow, $GUI_UNCHECKED) GUICtrlSetState($coordModeClient, $GUI_UNCHECKED) Case $coordModeClient AutoItSetOption("PixelCoordMode",2) AutoItSetOption("MouseCoordMode",2) GUICtrlSetState($coordModeScreen, $GUI_UNCHECKED) GUICtrlSetState($coordModeWindow, $GUI_UNCHECKED) GUICtrlSetState($coordModeClient, $GUI_CHECKED) Case $fileOpen $openFile = FileOpenDialog("Open file", @ScriptDir, "Text files (*.txt)", 3) $openFileHandle = FileOpen($openFile, 0) $text = FileRead($openFileHandle) GUICtrlSetData($edit, $text) FileClose($openFileHandle) Case $fileSave $text = GUICtrlRead($edit) $saveFile = FileSaveDialog("Save file", @ScriptDir, "Text files (*.txt)", 18) If StringCompare(StringRight($saveFile, 4), ".txt", 0) <> 0 Then $saveFile = $saveFile & ".txt" EndIf $saveFileHandle = FileOpen($saveFile, 2) FileWrite($saveFileHandle, $text) FileClose($saveFileHandle) Case $settingsOnTop If BitAND(GUICtrlRead($settingsOnTop), $GUI_CHECKED) = $GUI_CHECKED Then WinSetOnTop("Pixel Checksum Automation", "", 0) GUICtrlSetState($settingsOnTop, $GUI_UNCHECKED) Else WinSetOnTop("Pixel Checksum Automation", "", 1) GUICtrlSetState($settingsOnTop, $GUI_CHECKED) EndIf Case $helpHelp MsgBox(64, "Help", "Use Shift + Control + x to select coordinates, Shift + Control + c to do a pixel checksum of the selected coordinates and Shift + Control + z to clear the edit box") Case $clearCoordinates clearCoordinates() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch $array = MouseGetPos() GUICtrlSetData($xValue, $array[0]) GUICtrlSetData($yValue, $array[1]) Sleep(30) WEnd GUIDelete() Func getMousePos() $array = MouseGetPos() If $currentCoordinate = "upper_left" Then GUICtrlSetData($upperLeft, $array[0] & ", " & $array[1]) $x1 = $array[0] $y1 = $array[1] $currentCoordinate = "lower_right" ElseIf $currentCoordinate = "lower_right" Then GUICtrlSetData($lowerRight, $array[0] & ", " & $array[1]) $x2 = $array[0] $y2 = $array[1] $currentCoordinate = "upper_left" EndIf EndFunc Func getPixelChecksum() If $x1 > $x2 Or $y1 > $y2 Then WinSetOnTop("Pixel Checksum Automation", "", 0) MsgBox(48, "Bad coordinates", "You have entered bad coordinates! The upper left corner coordinates must be above and to the left of the lower right coordinates.") If BitAND(GUICtrlRead($settingsOnTop), $GUI_CHECKED) = $GUI_CHECKED Then WinSetOnTop("Pixel Checksum Automation", "", 1) EndIf clearCoordinates() Else $checksum = PixelChecksum($x1, $y1, $x2, $y2) $text = GUICtrlRead($edit) $varName = GUICtrlRead($globalConstInput) If BitAND(GUICtrlRead($whileEquals), $GUI_CHECKED) = $GUI_CHECKED Then If BitAND(GUICtrlRead($yes), $GUI_CHECKED) <> $GUI_CHECKED Then GUICtrlSetData($edit, $text & "While(PixelChecksum(" & $x1 & "," & $y1 & "," & $x2 & "," & $y2 & ") = " & $checksum & ")" & @CRLF & @CRLF & "WEnd" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) Else GUICtrlSetData($edit, $text & "While(PixelChecksum($" & $varName & "X1, $" & $varName & "Y1, $" & $varName & "X2, $" & $varName & "Y2) = $" & $varName & "Checksum)" & @CRLF & @CRLF & "WEnd" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X1 = " & $x1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y1 = " & $y1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X2 = " & $x2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y2 = " & $y2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Checksum = " & $checksum & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "-------------------------------------------------------------------------------------" & @CRLF) EndIf EndIf $text = GUICtrlRead($edit) If BitAND(GUICtrlRead($whileNotEquals), $GUI_CHECKED) = $GUI_CHECKED Then If BitAND(GUICtrlRead($yes), $GUI_CHECKED) <> $GUI_CHECKED Then GUICtrlSetData($edit, $text & "While(PixelChecksum(" & $x1 & "," & $y1 & "," & $x2 & "," & $y2 & ") <> " & $checksum & ")" & @CRLF & @CRLF & "WEnd" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) Else GUICtrlSetData($edit, $text & "While(PixelChecksum($" & $varName & "X1, $" & $varName & "Y1, $" & $varName & "X2, $" & $varName & "Y2) <> $" & $varName & "Checksum)" & @CRLF & @CRLF & "WEnd" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X1 = " & $x1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y1 = " & $y1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X2 = " & $x2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y2 = " & $y2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Checksum = " & $checksum & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "-------------------------------------------------------------------------------------" & @CRLF) EndIf EndIf $text = GUICtrlRead($edit) If BitAND(GUICtrlRead($doEquals), $GUI_CHECKED) = $GUI_CHECKED Then If BitAND(GUICtrlRead($yes), $GUI_CHECKED) <> $GUI_CHECKED Then GUICtrlSetData($edit, $text & "Do" & @CRLF & @CRLF & "Until PixelChecksum(" & $x1 & "," & $y1 & "," & $x2 & "," & $y2 & ") = " & $checksum & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) Else GUICtrlSetData($edit, $text & "Do" & @CRLF & @CRLF & "Until PixelChecksum($" & $varName & "X1, $" & $varName & "Y1, $" & $varName & "X2, $" & $varName & "Y2) = $" & $varName & "Checksum" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X1 = " & $x1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y1 = " & $y1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X2 = " & $x2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y2 = " & $y2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Checksum = " & $checksum & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "-------------------------------------------------------------------------------------" & @CRLF) EndIf EndIf $text = GUICtrlRead($edit) If BitAND(GUICtrlRead($doNotEquals), $GUI_CHECKED) = $GUI_CHECKED Then If BitAND(GUICtrlRead($yes), $GUI_CHECKED) <> $GUI_CHECKED Then GUICtrlSetData($edit, $text & "Do" & @CRLF & @CRLF & "Until PixelChecksum(" & $x1 & "," & $y1 & "," & $x2 & "," & $y2 & ") <> " & $checksum & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) Else GUICtrlSetData($edit, $text & "Do" & @CRLF & @CRLF & "Until PixelChecksum($" & $varName & "X1, $" & $varName & "Y1, $" & $varName & "X2, $" & $varName & "Y2) <> $" & $varName & "Checksum" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X1 = " & $x1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y1 = " & $y1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X2 = " & $x2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y2 = " & $y2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Checksum = " & $checksum & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "-------------------------------------------------------------------------------------" & @CRLF) EndIf EndIf $text = GUICtrlRead($edit) If BitAND(GUICtrlRead($ifEquals), $GUI_CHECKED) = $GUI_CHECKED Then If BitAND(GUICtrlRead($yes), $GUI_CHECKED) <> $GUI_CHECKED Then GUICtrlSetData($edit, $text & "If PixelChecksum(" & $x1 & "," & $y1 & "," & $x2 & "," & $y2 & ") = " & $checksum & " Then" & @CRLF & @CRLF & "EndIf" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) Else GUICtrlSetData($edit, $text & "If PixelChecksum($" & $varName & "X1, $" & $varName & "Y1, $" & $varName & "X2, $" & $varName & "Y2) = $" & $varName & "Checksum Then" & @CRLF & @CRLF & "EndIf" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X1 = " & $x1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y1 = " & $y1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X2 = " & $x2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y2 = " & $y2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Checksum = " & $checksum & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "-------------------------------------------------------------------------------------" & @CRLF) EndIf EndIf $text = GUICtrlRead($edit) If BitAND(GUICtrlRead($ifNotEquals), $GUI_CHECKED) = $GUI_CHECKED Then If BitAND(GUICtrlRead($yes), $GUI_CHECKED) <> $GUI_CHECKED Then GUICtrlSetData($edit, $text & "If PixelChecksum(" & $x1 & "," & $y1 & "," & $x2 & "," & $y2 & ") <> " & $checksum & " Then" & @CRLF & @CRLF & "EndIf" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) Else GUICtrlSetData($edit, $text & "If PixelChecksum($" & $varName & "X1, $" & $varName & "Y1, $" & $varName & "X2, $" & $varName & "Y2) <> $" & $varName & "Checksum Then" & @CRLF & @CRLF & "EndIf" & @CRLF & "-------------------------------------------------------------------------------------" & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X1 = " & $x1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y1 = " & $y1 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "X2 = " & $x2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Y2 = " & $y2 & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "Global Const $" & $varName & "Checksum = " & $checksum & @CRLF) $text = GUICtrlRead($edit) GUICtrlSetData($edit, $text & "-------------------------------------------------------------------------------------" & @CRLF) EndIf EndIf EndIf EndFunc Func clearCoordinates() GUICtrlSetData($upperLeft, "") GUICtrlSetData($lowerRight, "") $currentCoordinate = "upper_left" $x1 = 0 $y1 = 0 $x2 = 0 $y2 = 0 EndFunc Func clearEdit() GUICtrlSetData($edit, "") EndFunc
    1 point
×
×
  • Create New...