Leaderboard
Popular Content
Showing content with the highest reputation on 10/15/2018 in all areas
-
ur, Try turning off your AV while compiling - or add the "C:\Users\user_name\AppData\Local\AutoIt v3\Aut2exe" folder to the AV exclusion list. M232 points
-
When I searched this forum, I couldn't find any way to get a pixel color from an image. Done some research and found this on a french AutoIt forum (http://www.autoitscript.fr/forum/viewtopic.php?f=3&t=2993&start=0) #include <GDIPlus.au3> $sv_ImageSource = @ScriptDir & "\Source.jpg" $iPosX = 253 $iPosY = 291 _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile($sv_ImageSource) MsgBox(0, "Pixel Color", _GDIPlus_BitmapGetPixel($hImage, $iPosX, $iPosY)) _GDIPlus_ImageDispose($hImage) _GDIPlus_ShutDown() Func _GDIPlus_BitmapGetPixel($hBitmap, $iX, $iY) Local $tArgb, $pArgb, $aRet $tArgb = DllStructCreate("dword Argb") $pArgb = DllStructGetPtr($tArgb) $aRet = DllCall($ghGDIPDll, "int", "GdipBitmapGetPixel", "hwnd", $hBitmap, "int", $iX, "int", $iY, "ptr", $pArgb) Return "0x" & Hex(DllStructGetData($tArgb, "Argb"), 6) EndFunc Hope it will be useful for someone else too!1 point
-
Yes, only desktop setfocus is normally not needed as you normally know which window is your mainwindow. Problem is that in general you encounter a deeper hierarchy of grouping windows which are there but not allways visible. Some windows match your description but are hidden so you cannot setfocus thats why you need inspect.exe to see other parts of gui hierarchy and simplespy to quickly tell the parents. For browsers its then hard to have one way of finding addresbar as all browsers have different hierarchy.1 point
-
[solved] _IEGetObjById error
FrancescoDiMuro reacted to Danp2 for a topic
Update your code to match the revised website.1 point -
What do these ListBox styles mean?
FrancescoDiMuro reacted to Melba23 for a topic
thegreatjedi, The Google force was evidently not with you! Looking on MSDN gives the following more detailed explanations: So it seems that the first style requires an additional key/s to be pressed to select multiple items whereas the second style will select multiple items simply by using the mouse. These styles refer to owner-drawn listboxes, which are far more complicated then the standard controls usually used in AutoIt - so in my view they can safely be ignored by us normal users. M231 point -
While(1) If ... Then ;You want to quit the loop when this happens. ExitLoop ElseIf ... Then ... Else ExitLoop EndIf WEnd1 point
-
MouseClick & Color Finder [Beginner]
UncleLouie909 reacted to IAMK for a topic
The FF or IE UDF can be used for opening a browser.1 point -
added by to Wiki: https://www.autoitscript.com/wiki/User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging1 point
-
1 point
-
So what do you think WIndows defender is? Jos1 point
-
I'm turning off the ability for user's to change their own display names at the end of today. After that you can request a name change from a moderator. Just to prevent confusion, messing about, etc.1 point
-
Updated - 2/9/2010 - So there have been quite a few improvents since my last update 2 days ago. Added five new functions, User Calltips and Keywords, and also made changes to _SLG_UpdateGraph() and _SLG_CreateGraph() so be sure to look at the examples(and thumb) since they are new and show how too use the new functions. 5 new functions: _SLG_AddLine(), _SLG_SetLineValue(), _SLG_SetLineWidth(), _SLG_SetGridLineColor(), _SLG_EnableGridLines()-Thanks UEZ Updated 2/7/2010 - made negative value ranges possible. Here is a UDF I have been working on lately to help create scrolling line graphs. Like the ones you see for the CPU in Task Manager. Please let me know if you see or have any problems. I also want to thank and give some credit to monoceres for all his examples around the forums. I would have never made it this far without them. Example 1 #include "SLG.au3" Opt('GuiOnEventMode', 1) $GUI = GUICreate("GDI+ Scrolling Line Graph", 628, 297, -1, -1, -1, $WS_EX_TOPMOST) GUISetOnEvent(-3, '_Exit') GUISetState() $Increments = 100 $Graph1 = _SLG_CreateGraph($GUI, 18, 18, 596, 257, -100, 100, $Increments, -1,-1,-1,False) While 1 _SLG_SetLineValue($Graph1, Random(-100,100)) _SLG_UpdateGraph($Graph1) Sleep(30) WEnd Func _Exit() Exit EndFunc Example 2 #include <StaticConstants.au3> #include "SLG.au3" Opt('GuiOnEventMode', 1) Const $cBlue = 0xFF00ACFF, $cGreen = 0xFF00FF00, $cPink = 0xFFF004DE, $cYellow = 0xFFFFFF00 Const $cGray = 0xFFADADAD, $cRed = 0xFFFF0000, $cPurple = 0xFF8000FF, $cOrange = 0xFFFF8000 Const $Pi = ACos(-1), $4Pi = $Pi / 4 $GUI = GUICreate("GDI+ Scrolling Line Graph", 628, 297, -1, -1, -1, $WS_EX_TOPMOST) GUISetOnEvent(-3, '_Exit') $Label1 = GUICtrlCreateLabel("Graph 1", 66, 36, 192, 53, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("Graph 2", 372, 36, 192, 53, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif") GUISetState() $Increments = 85 $Graph1 = _SLG_CreateGraph($GUI, 18, 114, 283, 157, -1.01, 1.01, $Increments, $cPink, 2, -1, False) $G1Line2 = _SLG_AddLine($Graph1, $cGreen) $G1Line3 = _SLG_AddLine($Graph1, $cBlue) $Graph2 = _SLG_CreateGraph($GUI, 324, 114, 283, 157, -1.01, 1.01, $Increments, $cBlue) _SLG_SetGridLineColor($Graph2, 0xFF5C5C5C) $G2Line2 = _SLG_AddLine($Graph2, $cGreen) $G2Line3 = _SLG_AddLine($Graph2, $cRed) While 1 For $i = 0 To (2 * $Pi) Step 0.1 _SLG_SetLineValue($Graph1, Sin($i)) _SLG_SetLineValue($Graph2, Sin($i)) For $Line = $G1Line2 To $G1Line3 $y = Sin($i + ($4Pi * ($Line - 1))) _SLG_SetLineValue($Graph1, $y, $Line) Next For $Line = $G2Line2 To $G2Line3 $y = Sin($i + ($4Pi * ($Line - 1))) _SLG_SetLineValue($Graph2, $y, $Line) Next _SLG_UpdateGraph($Graph1) _SLG_UpdateGraph($Graph2) Sleep(25) Next WEnd Func _Exit() Exit EndFunc ;==>_Exit UDF #Region Header ; #INDEX# ======================================================================================================================= ; Title .........: SLG ; AutoIt Version : 3.3.4.0 ; Language ......: English ; Description ...: Functions to assist in creating and updating Scrolling Line Graphs ; Author(s) .....: Beege ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ;_SLG_CreateGraph ;_SLG_UpdateGraph ;_SLG_ClearGraph ;_SLG_SetLineColor ;_SLG_SetYRange ;_SLG_SetBackGroundColor ;_SLG_AddLine ;_SLG_SetLineValue ;_SLG_SetLineWidth ;_SLG_EnableGridLines ;_SLG_SetGridLineColor ; =============================================================================================================================== #Region User KeyWords and CallTips #cs Keywords: au3.keywords.user.udfs= _slg_creategraph _slg_updategraph _slg_cleargraph \ _slg_setlinecolor _slg_setyrange _slg_setbackgroundcolor _slg_addline \ _slg_setlinevalue _slg_setlinewidth _slg_enablegridlines _slg_setgridlinecolor CallTips: _SLG_CreateGraph($hGUI, $iLeft, $iTop, $iWidth, $iHeight, $iY_Min, $iY_Max, $iIncrements, $Line_Color = 0xFF00FF00, $Line_Width = 2, $iBackGround = 0xFF000000, $bGridlines = True) _SLG_UpdateGraph($iIndex) _SLG_AddLine($iIndex, $Line_Color = 0xFF00FF00, $Line_Width = 2) _SLG_ClearGraph($iIndex) _SLG_SetLineValue($iIndex, $iValue, $iLine = 1) _SLG_SetLineColor($iIndex, $iARGB, $iLine = 1) _SLG_SetLineWidth($iIndex, $iWidth, $iLine = 1) _SLG_SetYRange($iIndex, $iY_Min, $iY_Max) _SLG_SetBackGroundColor($iIndex, $iARGB = 0xFF000000) _SLG_SetGridLineColor($iIndex, $iARGB = Default) _SLG_EnableGridLines($iIndex, $bGridlines = True) #ce #EndRegion #include-once #include <GDIPlus.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() OnAutoItExitRegister('_SLG_Exit') #EndRegion Header #Region Global Variables and Constants Global Enum $g_hGraphic, $g_hBitmap, $g_hBuffer, $g_aPens, $g_iLeft, $g_iTop, $g_iWidth, $g_iHeight, $g_iIncrements, _ $g_iIncrement_Size, $g_iShift_Distance, $g_iY, $g_iY_Last, $g_iY_Min, $g_iY_Max, $g_iY_Range, $g_hDC, $g_hGUI, $g_iBackColor, _ $g_iX_counter, $g_iY_counter, $g_iX_counter_mem, $g_bGridlines, $g_iGridColor, $MAX Global $aGraphs[1][$MAX] $aGraphs[0][0] = 0 #cs $aGraphs[0][0] = List Count [0][1-17] = Nothing $aGraphs[$i][0] = $Graphic Object Handle [$i][$g_hBitmap] = Bitmap Object Handle [$i][$g_hBuffer] = Buffer Handle [$i][$g_iLeft] = Left [$i][$g_iTop] = Top [$i][$g_iWidth] = Width [$i][$g_iHeight] = Height [$i][$g_iIncrements] = Step Count [$i][$g_iIncrement_Size]= Step Size [$i][$g_iShift_Distance]= Shift Distance [$i][$g_iY_Min] = Y Min [$i][$g_iY_Max] = Y Max [$i][$g_iY_Range] = Y Range [$i][$g_hDC] = Display device context Handle [$i][$g_hGUI] = GUI Handle [$i][$g_iBackColor] = BackGround Color value [$i][$g_iY_Last] = Array containing Last Y Cordnate for each Line [$i][$g_iY] = Array containing Y Cordnate for each Line [$i][$g_aPens] = Array containing Pen Handles for each Line [$i][$g_bGridlines] = Draw GridLines flag [$i][$g_iGridColor] = GridLines Color Value [$i][$g_iX_counter] = Counter for X GridLines [$i][$g_iY_counter] = Counter for Y GridLines [$i][$g_iX_counter_mem] = Original Counter Value #ce #EndRegion Global Variables and Constants #Region Public Functions ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_CreateGraph ; Description ...: Creates a Scrolling Line Graph ; Syntax.........: _SLG_CreateGraph($hGUI, $iLeft, $iTop, $iWidth, $iHeight, $iY_Min, $iY_Max, $iIncrement_Total, $Line_Color = 0xFF00FF00, $iBackGround = 0xFF000000) ; Parameters ....: $hGUI - Handle to parent or owner window ; $iLeft - Left side of the graph ; $iTop - Top side of the graph ; $iWidth - Width of the graph ; $iHeight - Height of the graph ; $iY_Min - Minimum Y Value ; $iY_Max - Maximum Y Value ; $iIncrements - How many parts the Graph is divided up into. More Parts means more history.. ; $Line_Color - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB). Default = Green ; $iLine_Width - Line Width. Default = 1 ; $iBackGround - BackGround Color. Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB). Default = Black ; $bGridlines - Enable Gridlines. Default = True ; Return values .: Success - Graph Index ; Author ........: Beege ; Remarks .......: Line index of line created is 1. ; =============================================================================================================================== Func _SLG_CreateGraph($hGUI, $iLeft, $iTop, $iWidth, $iHeight, $iY_Min, $iY_Max, $iIncrements, $Line_Color = 0xFF00FF00, $iLine_Width = 2, $iBackGround = 0xFF000000, $bGridlines = True) ReDim $aGraphs[UBound($aGraphs) + 1][UBound($aGraphs, 2)] $aGraphs[0][0] += 1 If $Line_Color = -1 Or $Line_Color = Default Then $Line_Color = 0xFF00FF00 If $iBackGround = -1 Or $iBackGround = Default Then $iBackGround = 0xFF000000 If $iLine_Width = -1 Or $iLine_Width = Default Then $iLine_Width = 2 If $bGridlines = -1 Or $bGridlines = Default Then $bGridlines = True $aGraphs[$aGraphs[0][0]][$g_hGraphic] = _GDIPlus_GraphicsCreateFromHWND($hGUI) $aGraphs[$aGraphs[0][0]][$g_hBitmap] = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $aGraphs[$aGraphs[0][0]][$g_hGraphic]) $aGraphs[$aGraphs[0][0]][$g_hBuffer] = _GDIPlus_ImageGetGraphicsContext($aGraphs[$aGraphs[0][0]][$g_hBitmap]) $aGraphs[$aGraphs[0][0]][$g_iLeft] = $iLeft $aGraphs[$aGraphs[0][0]][$g_iTop] = $iTop $aGraphs[$aGraphs[0][0]][$g_iWidth] = $iWidth $aGraphs[$aGraphs[0][0]][$g_iHeight] = $iHeight $aGraphs[$aGraphs[0][0]][$g_iIncrements] = $iIncrements $aGraphs[$aGraphs[0][0]][$g_iIncrement_Size] = Int($iWidth / $iIncrements) $aGraphs[$aGraphs[0][0]][$g_iShift_Distance] = $iWidth - $aGraphs[$aGraphs[0][0]][$g_iIncrement_Size] _SLG_AddLine($aGraphs[0][0], $Line_Color, $iLine_Width) $aGraphs[$aGraphs[0][0]][$g_iY_Min] = $iY_Min $aGraphs[$aGraphs[0][0]][$g_iY_Max] = $iY_Max _SLG_SetYRange($aGraphs[0][0], $iY_Min, $iY_Max) $aGraphs[$aGraphs[0][0]][$g_hDC] = _WinAPI_GetDC($hGUI) $aGraphs[$aGraphs[0][0]][$g_hGUI] = $hGUI _SLG_SetBackGroundColor($aGraphs[0][0], BitOR($iBackGround, 0xFF000000)) $aGraphs[$aGraphs[0][0]][$g_bGridlines] = $bGridlines $aGraphs[$aGraphs[0][0]][$g_iX_counter] = 20;$iX_c $aGraphs[$aGraphs[0][0]][$g_iX_counter_mem] = 20;$iX_c $aGraphs[$aGraphs[0][0]][$g_iY_counter] = 20;$iY_c $aGraphs[$aGraphs[0][0]][$g_iGridColor] = Default _GDIPlus_GraphicsSetSmoothingMode($aGraphs[$aGraphs[0][0]][$g_hBuffer], 2) _GDIPlus_GraphicsClear($aGraphs[$aGraphs[0][0]][$g_hBuffer], $aGraphs[$aGraphs[0][0]][$g_iBackColor]); If $bGridlines Then _FullGridLines($aGraphs[0][0]) Return $aGraphs[0][0] EndFunc ;==>_SLG_CreateGraph ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_UpdateGraph ; Description ...: Updates Line Graph with new values ; Syntax.........: _SLG_UpdateGraph($iIndex, $iValue) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: All Lines of the graph must be updated before calling this function. ; =============================================================================================================================== Func _SLG_UpdateGraph($iIndex) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) Local $aLineY = $aGraphs[$iIndex][$g_iY] For $i = 1 To $aLineY[0] If Not $aLineY[$i] Then Return Next Local $hShift_Section = _GDIPlus_BitmapCloneArea($aGraphs[$iIndex][$g_hBitmap], $aGraphs[$iIndex][$g_iIncrement_Size], 0, $aGraphs[$iIndex][$g_iShift_Distance], $aGraphs[$iIndex][$g_iHeight]); _GDIPlus_GraphicsClear($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iBackColor]); _GDIPlus_GraphicsDrawImageRect($aGraphs[$iIndex][$g_hBuffer], $hShift_Section, 0, 0, $aGraphs[$iIndex][$g_iShift_Distance], $aGraphs[$iIndex][$g_iHeight]) If $aGraphs[$iIndex][$g_bGridlines] Then _AddGridLines($iIndex) Local $aLineYLast = $aGraphs[$iIndex][$g_iY_Last] Local $aPens = $aGraphs[$iIndex][$g_aPens] For $i = 1 To $aLineYLast[0] _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iShift_Distance] - 1, $aLineYLast[$i], $aGraphs[$iIndex][$g_iWidth] - 1, $aLineY[$i], $aPens[$i]) Next _WriteBuffer($iIndex) _GDIPlus_BitmapDispose($hShift_Section) For $i = 1 To $aLineY[0] $aLineYLast[$i] = $aLineY[$i] Next $aGraphs[$iIndex][$g_iY_Last] = $aLineYLast Return 1 EndFunc ;==>_SLG_UpdateGraph ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetLineValue ; Description ...: Sets Line value ; Syntax.........: _SLG_SetLineValue($iIndex, $iValue, $iLine = 1) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iValue - Value to add to graph ; $iLine - Line index returned from _SLG_AddLine() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: If your graph only has 1 line then the line index is 1 ; =============================================================================================================================== Func _SLG_SetLineValue($iIndex, $iValue, $iLine = 1) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) If $iValue > $aGraphs[$iIndex][$g_iY_Max] Then $iValue = $aGraphs[$iIndex][$g_iY_Max] ElseIf $iValue < $aGraphs[$iIndex][$g_iY_Min] Then $iValue = $aGraphs[$iIndex][$g_iY_Min] EndIf Local $Percent = Abs($iValue - $aGraphs[$iIndex][$g_iY_Min]) / $aGraphs[$iIndex][$g_iY_Range] If $Percent > .992 Then $Percent = .992 Local $iY = Int($aGraphs[$iIndex][$g_iHeight] - ($Percent * $aGraphs[$iIndex][$g_iHeight])) Local $aLineYLast = $aGraphs[$iIndex][$g_iY_Last] If Not $aLineYLast[$iLine] Then $aLineYLast[$iLine] = $iY $aGraphs[$iIndex][$g_iY_Last] = $aLineYLast Return 0 Else Local $aLineY = $aGraphs[$iIndex][$g_iY] $aLineY[$iLine] = $iY $aGraphs[$iIndex][$g_iY] = $aLineY Return 1 EndIf EndFunc ;==>_SLG_SetLineValue ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_AddLine ; Description ...: Adds additional lines to the graph ; Syntax.........: _SLG_AddLine($iIndex, $Line_Color = 0xFF00FF00, $Line_Width = 1) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iLine_Color - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB) ; $Line_Width - Line Width ; Return values .: Success - Line Index ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: Every line must have its value set before you can call _SLG_UpdateGraph() ; =============================================================================================================================== Func _SLG_AddLine($iIndex, $Line_Color = 0xFF00FF00, $Line_Width = 2) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) If $Line_Color = -1 Or $Line_Color = Default Then $Line_Color = 0xFF00FF00 If $Line_Width = -1 Or $Line_Width = Default Then $Line_Width = 1 Local $aLinesY = $aGraphs[$iIndex][$g_iY] Local $aLinesYLast = $aGraphs[$iIndex][$g_iY_Last] Local $aPens = $aGraphs[$iIndex][$g_aPens] If Not IsArray($aLinesYLast) Then Local $aLinesY[1] = [0] Local $aLinesYLast[1] = [0] Local $aPens[1] = [0] EndIf ReDim $aLinesYLast[UBound($aLinesYLast) + 1] ReDim $aLinesY[UBound($aLinesY) + 1] ReDim $aPens[UBound($aPens) + 1] $aLinesYLast[0] += 1 $aLinesY[0] += 1 $aPens[0] += 1 $aLinesYLast[$aLinesYLast[0]] = False $aLinesY[$aLinesY[0]] = False $aPens[$aPens[0]] = _GDIPlus_PenCreate($Line_Color, $Line_Width) $aGraphs[$iIndex][$g_iY_Last] = $aLinesYLast $aGraphs[$iIndex][$g_iY] = $aLinesY $aGraphs[$iIndex][$g_aPens] = $aPens Return $aLinesY[0] EndFunc ;==>_SLG_AddLine ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetLineColor ; Description ...: Sets Line Color of Graph ; Syntax.........: _SLG_SetLineColor($iIndex, $iARGB) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iValue - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB) ; $iLine - Line index returned from _SLG_AddLine() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; - 2 Invalid iLine ; - 3 Error setting pen color ; Author ........: Beege ; Remarks .......: If your graph only has 1 line then the line index is 1 ; =============================================================================================================================== Func _SLG_SetLineColor($iIndex, $iARGB, $iLine = 1) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) Local $aPens = $aGraphs[$iIndex][$g_aPens] If $iLine > $aPens[0] Then Return SetError(2, @extended, 0) _GDIPlus_PenSetColor($aPens[$iLine], $iARGB) If @error Then Return SetError(3, @extended, 0) Return 1 EndFunc ;==>_SLG_SetLineColor ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetLineWidth ; Description ...: Sets Line Width ; Syntax.........: _SLG_SetLineWidth($iIndex, $iWidth, $iLine = 1) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iValue - Width of Line ; $iLine - Line index returned from _SLG_AddLine() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; - 2 Invalid iLine index ; - 3 Error setting pen width ; Author ........: Beege ; Remarks .......: If your graph only has 1 line then the line index is 1 ; =============================================================================================================================== Func _SLG_SetLineWidth($iIndex, $iWidth, $iLine = 1) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) Local $aPens = $aGraphs[$iIndex][$g_aPens] If $iLine > $aPens[0] Then Return SetError(2, @extended, 0) Local $aPens = $aGraphs[$iIndex][$g_aPens] _GDIPlus_PenSetWidth($aPens[$iLine], $iWidth) If @error Then Return SetError(3, @extended, 0) Return 1 EndFunc ;==>_SLG_SetLineWidth ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_ClearGraph ; Description ...: Clears all data from Graph ; Syntax.........: _SLG_ClearGraph($iIndex) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: none ; =============================================================================================================================== Func _SLG_ClearGraph($iIndex) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) _GDIPlus_GraphicsClear($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iBackColor]); If $aGraphs[$iIndex][$g_bGridlines] Then _FullGridLines($iIndex) _WriteBuffer($iIndex) Return 1 EndFunc ;==>_SLG_ClearGraph ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetYRange ; Description ...: Sets the Minimum and Maximum Y Values ; Syntax.........: _SLG_SetYRange($iIndex, $iY_Min, $iY_Max) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iY_Min - Minimum Y Value ; $iY_Max - Maximum Y Value ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: User should most likly want to ClearGraph after changing Y Range ; =============================================================================================================================== Func _SLG_SetYRange($iIndex, $iY_Min, $iY_Max) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) $aGraphs[$iIndex][$g_iY_Min] = $iY_Min $aGraphs[$iIndex][$g_iY_Max] = $iY_Max $aGraphs[$iIndex][$g_iY_Range] = Abs($iY_Max - $iY_Min) Return 1 EndFunc ;==>_SLG_SetYRange ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetBackGroundColor ; Description ...: Sets Graph BackGround Color ; Syntax.........: _SLG_SetBackGroundColor($iIndex, $iARGB = 0xFF000000) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iARGB - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB). Default = Black ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: All previous data will be cleared ; =============================================================================================================================== Func _SLG_SetBackGroundColor($iIndex, $iARGB = 0xFF000000) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) $aGraphs[$iIndex][$g_iBackColor] = $iARGB _SLG_ClearGraph($iIndex) Return 1 EndFunc ;==>_SLG_SetBackGroundColor ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetGridLineColor($iIndex) ; Description ...: Sets Graph GridLines Color Value ; Syntax.........: _SLG_SetGridLineColor($iIndex, $iARGB = Default) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iARGB - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB). Default = Invert of Background Color. ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: All previous data will be cleared ; =============================================================================================================================== Func _SLG_SetGridLineColor($iIndex, $iARGB = Default) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) $aGraphs[$iIndex][$g_iGridColor] = $iARGB _SLG_ClearGraph($iIndex) Return 1 EndFunc ;==>_SLG_SetGridLineColor ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_EnableGridLines ; Description ...: Enables or Disables Drawing of Gridlines for Graph ; Syntax.........: _SLG_EnableGridLines($iIndex, $bGridlines = True) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $bGridlines - GridLines flag: ; |True - GridLines will be drawn ; |False - GridLines will not be drawn ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; - 2 Invalid $bGridlines Value ; Author ........: Beege ; Remarks .......: none ; =============================================================================================================================== Func _SLG_EnableGridLines($iIndex, $bGridlines = True) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) If $bGridlines <> True And $bGridlines <> False Then SetError(2, @extended, 0) $aGraphs[$iIndex][$g_bGridlines] = $bGridlines Return 1 EndFunc ;==>_SLG_EnableGridLines #EndRegion Public Functions #Region Internel Functions ; #FUNCTION# ==================================================================================================================== ; Author ........: UEZ ; Modified ......: Beege ; =============================================================================================================================== Func _AddGridLines($iIndex) Local $iGridlineColor = $aGraphs[$iIndex][$g_iGridColor] If $iGridlineColor = Default Or $iGridlineColor = -1 Then $iGridlineColor = BitOR(0xFF000000, (0xFFFFFFFF - $aGraphs[$iIndex][$g_iBackColor]));Invert Background RGB Local $iY1, $hPen = _GDIPlus_PenCreate($iGridlineColor) For $iY1 = 0 To $aGraphs[$iIndex][$g_iHeight] Step $aGraphs[$iIndex][$g_iY_counter] _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iShift_Distance] - 1, $iY1, $aGraphs[$iIndex][$g_iWidth], $iY1, $hPen) Next If $aGraphs[$iIndex][$g_iX_counter] <= 0 Then _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iWidth] - 1, 0, $aGraphs[$iIndex][$g_iWidth] - 1, $aGraphs[$iIndex][$g_iHeight], $hPen) $aGraphs[$iIndex][$g_iX_counter] = $aGraphs[$iIndex][$g_iX_counter_mem] EndIf $aGraphs[$iIndex][$g_iX_counter] -= $aGraphs[$iIndex][$g_iIncrement_Size] _GDIPlus_PenDispose($hPen) EndFunc ;==>_AddGridLines Func _FullGridLines($iIndex) Local $iGridlineColor = $aGraphs[$iIndex][$g_iGridColor] If $iGridlineColor = Default Or $iGridlineColor = -1 Then $iGridlineColor = BitOR(0xFF000000, (0xFFFFFFFF - $aGraphs[$iIndex][$g_iBackColor]));Invert Background RGB Local $iY1, $hPen = _GDIPlus_PenCreate($iGridlineColor) Local $hShift_Section = _GDIPlus_BitmapCloneArea($aGraphs[$iIndex][$g_hBitmap], 0, 0, $aGraphs[$iIndex][$g_iWidth], $aGraphs[$iIndex][$g_iHeight]); _GDIPlus_GraphicsClear($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iBackColor]); _GDIPlus_GraphicsDrawImageRect($aGraphs[$iIndex][$g_hBuffer], $hShift_Section, 0, 0, $aGraphs[$iIndex][$g_iWidth], $aGraphs[$iIndex][$g_iHeight]) For $iY1 = 0 To $aGraphs[$iIndex][$g_iHeight] Step $aGraphs[$iIndex][$g_iY_counter] _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], 0, $iY1, $aGraphs[$iIndex][$g_iWidth], $iY1, $hPen) Next For $iX = 0 To $aGraphs[$iIndex][$g_iWidth] Step $aGraphs[$iIndex][$g_iIncrement_Size] If $aGraphs[$iIndex][$g_iX_counter] <= 0 Then _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], $iX, 0, $iX, $aGraphs[$iIndex][$g_iHeight], $hPen) $aGraphs[$iIndex][$g_iX_counter] = $aGraphs[$iIndex][$g_iX_counter_mem] EndIf $aGraphs[$iIndex][$g_iX_counter] -= $aGraphs[$iIndex][$g_iIncrement_Size] Next _WriteBuffer($iIndex) _GDIPlus_BitmapDispose($hShift_Section) _GDIPlus_PenDispose($hPen) EndFunc ;==>_FullGridLines Func _WriteBuffer($iIndex) Local $hGDI_HBitmap, $hDC $hGDI_HBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($aGraphs[$iIndex][$g_hBitmap]) $hDC = _WinAPI_CreateCompatibleDC($aGraphs[$iIndex][$g_hDC]) _WinAPI_SelectObject($hDC, $hGDI_HBitmap) _WinAPI_BitBlt($aGraphs[$iIndex][$g_hDC], $aGraphs[$iIndex][$g_iLeft], $aGraphs[$iIndex][$g_iTop], $aGraphs[$iIndex][$g_iWidth], $aGraphs[$iIndex][$g_iHeight], $hDC, 0, 0, $SRCCOPY) _WinAPI_DeleteObject($hGDI_HBitmap) _WinAPI_DeleteDC($hDC) EndFunc ;==>_WriteBuffer Func _SLG_Exit() Local $i, $j, $aPens If $aGraphs[0][0] Then For $i = 1 To $aGraphs[0][0] _GDIPlus_GraphicsDispose($aGraphs[$i][$g_hBuffer]) _GDIPlus_BitmapDispose($aGraphs[$i][$g_hBitmap]) _GDIPlus_GraphicsDispose($aGraphs[$i][$g_hGraphic]) $aPens = $aGraphs[$i][$g_aPens] For $j = 1 To $aPens[0] _GDIPlus_PenDispose($aPens[$j]) Next _WinAPI_ReleaseDC($aGraphs[$i][$g_hGUI], $aGraphs[$i][$g_hDC]) Next EndIf _GDIPlus_Shutdown() EndFunc ;==>_SLG_Exit #EndRegion Internel Functions SLG.au3 Previous DL = 551 point
-
Get the Current URL using IE.au3
slyx reacted to seandisanti for a topic
_IEPropertyGet($oIE,"locationurl")1 point -
MouseClick & Color Finder [Beginner]
UncleLouie909 reacted to junkew for a topic
First step is to read frequently asked questions from top to bottom although what you are looking for is in last 15 questions.0 points -
MouseClick & Color Finder [Beginner]
UncleLouie909 reacted to JLogan3o13 for a topic
@UncleLouie909, while @IAMK is extremely fortunate that Jos saw his intrusion before I did, he has a point. We have UDFs for IE, Chrome and FireFox, all of which are better suited to your needs than using PixelSearch - especially a PixelSearch which, coincidentally, works just the same on a Java game. I would suggest looking at those to accomplish what you're after. @IAMK as I stated, if Jos had not seen your response before I you would have earned a holiday from posting. We have said it numerous times, stay out of a thread in which a Moderator is determining legitimacy. We even put a tag in now when we respond to let people know we are involved; not sure what else we can do to help people engage the grey matter before posting. btw this is rhetorical, I have no desire to see you pollute the thread further with explanations. @All if you with to help the OP regarding the use of the FF UDF, or other means, please feel free. I have stripped what is obviously the same code as his attempt at game automation from the initial post. UncleLouie909, we are not going down that road. Accept help on automating the browser correctly if that is what you are truly after, or abandon the pretense; your choice.0 points -
MouseClick & Color Finder [Beginner]
UncleLouie909 reacted to Jos for a topic
@IAMK, Which part is unclear in this statement? So ..STAY OUT until the "All Clear" is given.0 points -
MouseClick & Color Finder [Beginner]
UncleLouie909 reacted to JLogan3o13 for a topic
It's funny how your code to "googling something" is the exact same as your code for the java game. If you are googling something, why not just use the IE functions or the Chrome UDF? Why on earth would you do something as silly as PixelSearch to Google something?* *Might I suggest making your next excuse at least somewhat plausible?0 points -
MouseClick & Color Finder [Beginner]
UncleLouie909 reacted to JLogan3o13 for a topic
How is this any different than your previous post that was locked? --In case you didn't realize, this is a Mod stepping in to a thread--0 points