Syxguns

Creat a Ruler

11 posts in this topic

New to Autoit, and I had a couple of question.

First let me say that I have searched the forum extensively and the closest thing I have found is the "Pangaea Ruler", which I can use for a type of guideline to follow.  However, I want a ruler that has a couple of properties and I'm not sure with my limited knowledge of programming if AutoIt is the correct choice for me.  Here is the basics of what I need.

1) translucent where only the ruler marks are shown.

2) I do not want a window, but I still need 5 to 7 menu items to show which will pull up configuration panel

3) Ruler marks only in one location but adjustable to configuration panel

4) This program will consist of of a few other elements besides just the ruler, so I guess this question is can AutoIt  handle a program that is a little more robust then just automating?

5) If I am not to use AutoIt for the primary design, may AutoIt be called to run certain functions from within another program, and what program would you suggest.

 

Bellow is a basic drawn layout of what I want to create.  Remember the program is transparent.

RulerExample.jpg

Share this post


Link to post
Share on other sites



If you're talking about creating a GUI like the picture. sure You can do it using AutoIt.

 

Saludos

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

go build the GUI with koda, then post it and ask some one to help make it transparent

Edit:
koda is found inside the autoit SciTE editor under tools menu or (alt+m)

Edited by jvds

Share this post


Link to post
Share on other sites

Syxguns,

Welcome to the AutoIt forums.

Getting bored waiting for our Xmas guests to arrive - this seems to be close to what you are seeking:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <WINAPI.au3>

; Allow GUI to be closed
HotKeySet("ESC", "_Exit")

; Array to hold action controlIDs

Global $aAction[8]

; Create popup GUI with layers
$hGUI = GUICreate("Test", 400, 100, Default, Default, $WS_POPUP, $WS_EX_LAYERED)

; Make main GUI transparent
GUISetBkColor(0xABCDEF)
_WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF, 250)

; Create ruler - adjust values to fit your requirements
GUICtrlCreateLabel("", 0, 50, 5, 50)
GUICtrlSetBkColor(-1, 0)
For $i = 0 To 11
    GUICtrlCreateLabel("", 33 * $i, 60, 2, 30)
    GUICtrlSetBkColor(-1, 0)
Next
GUICtrlCreateLabel("", 395, 50, 5, 50)
GUICtrlSetBkColor(-1, 0)

; Create action labels
For $i = 1 To 7
    $aAction[$i] = GUICtrlCreateLabel($i, 70 + (30 * $i), 0, 20, 20, BitOr($SS_CENTER, $SS_CENTERIMAGE))
    GUICtrlSetBkColor(-1, 0)
    GUICtrlSetColor(-1, 0xFFFFFF)
Next

GUISetState()

While 1

    $iMsg = GUIGetMsg()
    Switch $iMsg

        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_PRIMARYDOWN
            ; Drag GUI if mouse button pressed - need to be over ruler
            _SendMessage($hGUI, $WM_SYSCOMMAND, 0xF012, 0)
        Case Else
            For $i = 1 To 7
                ; Label actioned?
                If $iMsg = $aAction[$i] Then
                    ; Announce it
                    MsgBox($MB_SYSTEMMODAL, "Pressed", "Action " & $i)
                    ; No point in looking further
                    ExitLoop

                EndIf

            Next
    EndSwitch



WEnd



Func _Exit()
    Exit
EndFunc

Have a play with it and see if it does what you want.

M23

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Syxguns,

Welcome to the AutoIt forums.

Getting bored waiting for our Xmas guests to arrive - this seems to be close to what you are seeking:

expandpopup

 

Have a play with it and see if it does what you want.

M23

Melba23,

Thank you so much for that basic layout!  works just like I wanted.  I should be able to get the basic application started with that.  It's fantastic to find out that I made the correct choice to go with AutoIt.

Syx

Share this post


Link to post
Share on other sites

@Melba23 or anyone else that could help me with this.

In the code you posted above to hide the form on the GUI. I've noted the code and tried to reproduce it and keep failing.

; Make main GUI transparent
GUISetBkColor(0xABCDEF)
_WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF, 250)

I have also read the information found on this site called:  Function_WinAPI_GetLayeredWindowAttributes  However, I have not had any success using it.

In your code I see that you are setting the background color to a hexadecimal used for transparency then using the function to call the GUI, setting the HEX, and using 250 instead of 255 for $iTransGUI.  

The steps that I have followed so far are designing a form in Koda.  Using the above code that you used with $hGUI replaced by my global variable for the options design I created and I can't seem to get it to work.

Could you maybe give me a little more information on how you made this work for you?

Thanks

Syx

Share this post


Link to post
Share on other sites

Syxguns,

Please post the code you are using and I will take a look.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Here is what I've got started in my spare time.  Hopefully after I get just a couple of basics like this working then I can finish the layout and start coding.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <WINAPI.au3>
#include <Misc.au3>



#Region ### START Koda GUI section ### Form=
; Swing Control Bot Form
 Global $SC = GUICreate("Scale Control", 510, 265, 249, 176, -1, BitOR($WS_EX_TRANSPARENT,$WS_EX_WINDOWEDGE & $WS_EX_TOPMOST))
GUISetBkColor(0x0066CC)


; First Tab Control
Global $SCTab_Group1 = GUICtrlCreateGroup("", 3, 3, 502, 260, -1, $WS_EX_TRANSPARENT)
Global $Tab1 = GUICtrlCreateTab(11, 20, 485, 199)

; Tab Scale
Global $TabScale = GUICtrlCreateTabItem("Scale")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

;Labels and inputs for first tab "Scale"
Global $Scale_Width = GUICtrlCreateLabel("Scale Width:", 58, 70, 65, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $InputSW = GUICtrlCreateInput("400", 131, 67, 100, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $Scale_W = GUICtrlCreateUpdown($InputSW)

    If _IsPressed("26", $Scale_W) Then ; Up
        GUICtrlSetData($InputSW, GUICtrlRead($InputSW) + 1)
        Sleep(100)
    ElseIf _IsPressed("28", $Scale_W) Then ; Down
        GUICtrlSetData($InputSW, GUICtrlRead($InputSW) - 1)
        Sleep(100)
    EndIf

Global $Scale_Height = GUICtrlCreateLabel("Scale Height:", 55, 100, 68, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $InputSH = GUICtrlCreateInput("400", 131, 97, 100, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $Scale_H = GUICtrlCreateUpdown($InputSH)

    If _IsPressed("26", $Scale_H) Then ; Up
        GUICtrlSetData($InputSH, GUICtrlRead($InputSH) + 1)
        Sleep(100)
    ElseIf _IsPressed("28", $Scale_H) Then ; Down
        GUICtrlSetData($InputSH, GUICtrlRead($InputSH) - 1)
        Sleep(100)
    EndIf

Global $PScale_offset = GUICtrlCreateLabel("Scale Offset:", 27, 130, 96, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $InputPO = GUICtrlCreateInput("0", 131, 127, 100, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $POffset = GUICtrlCreateUpdown($InputPO)

    If _IsPressed("26", $POffset) Then ; Up
        GUICtrlSetData($InputPO, GUICtrlRead($InputPO) + 1)
        Sleep(100)
    ElseIf _IsPressed("28", $POffset) Then ; Down
        GUICtrlSetData($InputPO, GUICtrlRead($InputPO) - 1)
        Sleep(100)
    EndIf

Global $PScale_Width = GUICtrlCreateLabel("Scale Width:", 27, 160, 96, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $InputPW = GUICtrlCreateInput("400", 131, 157, 100, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $PScaleW = GUICtrlCreateUpdown($InputPW)

    If _IsPressed("26", $PScaleW) Then ; Up
        GUICtrlSetData($InputPW, GUICtrlRead($InputPW) + 1)
        Sleep(100)
    ElseIf _IsPressed("28", $POffset) Then ; Down
        GUICtrlSetData($InputPW, GUICtrlRead($InputPW) - 1)
        Sleep(100)
    EndIf


; Right side of tab "Scale"
; automate boxes to read drag for $ScaleCo_X and $ScaleCo_Y
;*************************************************************
;*************************************************************
Global $Scale_Coordinates = GUICtrlCreateLabel("Scale Coordinates:", 277, 70, 93, 17)
Global $Scale_X = GUICtrlCreateLabel("X", 289, 100, 11, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $ScaleCo_X = GUICtrlCreateInput("", 301, 97, 50, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $Scale_Y = GUICtrlCreateLabel("Y", 364, 100, 11, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $ScaleCo_Y = GUICtrlCreateInput("", 376, 97, 50, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

;******* Scale Control Coordinates to be written later*****
;*************************************************************
;*************************************************************
Global $SCCoordinates = GUICtrlCreateLabel("SC Coordinates:", 277, 130, 87, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $SC_X = GUICtrlCreateLabel("X", 289, 160, 11, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $SCCo_X = GUICtrlCreateInput("", 301, 157, 50, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $SC_Y = GUICtrlCreateLabel("Y", 364, 160, 11, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $SCCo_Y = GUICtrlCreateInput("", 376, 157, 50, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")



;************************************************************************
; Tab Sheet 2 begins "Buttons"

Global $TabButtons = GUICtrlCreateTabItem("Buttons")

Global $MMLeft = GUICtrlCreateLabel("Margin Left", 40, 70, 57, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $InputML = GUICtrlCreateInput("0", 104, 67, 75, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $MML = GUICtrlCreateUpdown($InputML)

    If _IsPressed("26", $MML) Then ; Up
        GUICtrlSetData($InputML, GUICtrlRead($InputML) + 1)
        Sleep(100)
    ElseIf _IsPressed("28", $MML) Then ; Down
        GUICtrlSetData($InputML, GUICtrlRead($InputML) - 1)
        Sleep(100)
    EndIf


Global $MMBottom = GUICtrlCreateLabel("Margin Bottom", 25, 100, 72, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $InputMB = GUICtrlCreateInput("0", 104, 97, 75, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $MMB = GUICtrlCreateUpdown($InputMB)

    If _IsPressed("26", $MMB) Then ; Up
        GUICtrlSetData($InputMB, GUICtrlRead($InputMB) + 1)
        Sleep(100)
    ElseIf _IsPressed("28", $MMB) Then ; Down
        GUICtrlSetData($InputMB, GUICtrlRead($InputMB) - 1)
        Sleep(100)
    EndIf


Global $DDelay = GUICtrlCreateLabel("Drag Delay", 41, 130, 54, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $InputDD = GUICtrlCreateInput("0", 104, 127, 75, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $DD = GUICtrlCreateUpdown($InputDD)

    If _IsPressed("26", $DD) Then ; Up
        GUICtrlSetData($InputDD, GUICtrlRead($InputDD) + 1)
        Sleep(100)
    ElseIf _IsPressed("28", $DD) Then ; Down
        GUICtrlSetData($InputDD, GUICtrlRead($InputDD) - 1)
        Sleep(100)
    EndIf


Global $MTransparancy = GUICtrlCreateLabel("Transparancy", 30, 160, 69, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $InputT = GUICtrlCreateInput("0", 104, 157, 75, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $MTrans = GUICtrlCreateUpdown($InputT)

    If _IsPressed("26", $MTrans) Then ; Up
        GUICtrlSetData($InputT, GUICtrlRead($InputT) + 1)
        Sleep(100)
    ElseIf _IsPressed("28", $MTrans) Then ; Down
        GUICtrlSetData($InputT, GUICtrlRead($InputT) - 1)
        Sleep(100)
    EndIf


; Menu on/off switches
; *************** To control switches on scale *******************
;*****************************************************************

Global $SButtonSwitch = GUICtrlCreateCheckbox("Scale Button", 205, 70, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

Global $PerButtonSwitch = GUICtrlCreateCheckbox("Percentage Button", 205, 100, 115, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

Global $ConfButtonSwitch = GUICtrlCreateCheckbox("Configuration Button", 205, 130, 115, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

Global $CalButtonSwitch = GUICtrlCreateCheckbox("Calculator Button", 205, 160, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

Global $NPButtonSwitch = GUICtrlCreateCheckbox("Notepad Button", 345, 70, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

Global $MinimizeButtonSwitch = GUICtrlCreateCheckbox("Minimize Button", 345, 100, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

Global $SCButtonSwitch = GUICtrlCreateCheckbox("SC Button", 345, 130, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")



;*************************************************************
; Begin New Sheet

Global $Tab1 = GUICtrlCreateTabItem("Sheet 1")




;*******************************************************************
; New Sheet

Global $Tab2 = GUICtrlCreateTabItem("Sheet 2")



;*****************************************************************************
; New Sheet



Global $Tab3 = GUICtrlCreateTabItem("Sheet 3")

;******************************************************************************
; New Sheet

Global $Tab4 = GUICtrlCreateTabItem("Sheet 4")

;*****************************************************************************
; New Sheet

Global $Tab5 = GUICtrlCreateTabItem("Sheet 5")

;*****************************************************************************
; New Sheet

Global $Tab6 = GUICtrlCreateTabItem("Sheet 6")

;*******************************************************************************
; Action Buttons

GUICtrlCreateTabItem("")
;*******************************************************************************
; Ok Button to write to INI or XML file before close
Global $OK = GUICtrlCreateButton("OK", 308, 226, 75, 25)

;******************************************************************************
; INI Button to open ini or xml File for manual adjustments (Probably INI easier for others to understand)

Global $INI = GUICtrlCreateButton("INI", 390, 226, 75, 25)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Just the tab group box is all I want to show when the "C" (config) is pressed on the array tab on the scale.  Thank you for your assistance.

Edited by Syxguns

Share this post


Link to post
Share on other sites

Syxguns,

That GUI looks nothing like the "ruler" you asked about in the first post, so where did this one come from? And how is it related to the first?

And looking at the code it appears you are automating a golf game - is that indeed the case?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

I am not automating a control for the game, I am creating a ruler to help you hit more precisely.  I didn't include the original ruler because I have not had time to figure out why only the Configuration Panel opens when I place the code in.

I am not injecting code, and trying to create a feature that will hit the ball perfect every time would be close to impossible.  Every club and ball you play with has a different speed.  My program is just a ruler and calculator to help you hit the correct club the correct distance judging uphill, downhill, and wind.  It will only help you by not having to calculate all the different variables by making 3 or 4 mathematical calculations, then aiming and trying to hit the correct amount on the club.  So it is a game assistant, but it does not do anything for you except the math, and give you a ruler when you have to hit your 150 club 140.

Here is the code with the ruler, but as I said I haven't been able to get both to show up yet.  What I was designing was the config panel to help you line up the ruler and save the coordinates so each time it opens it will be in the same location.  The configuration will also have your club total distance for the ruler to mark out 5 yard increments.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <WINAPI.au3>
#include <Misc.au3>



#Region ### START Koda GUI section ### Form=
; Swing Control Bot Form
 Global $SC = GUICreate("Scale Control", 510, 265, 249, 176, -1, BitOR($WS_EX_TRANSPARENT,$WS_EX_WINDOWEDGE & $WS_EX_TOPMOST))
GUISetBkColor(0x0066CC)


; First Tab Control
Global $SCTab_Group1 = GUICtrlCreateGroup("", 3, 3, 502, 260, -1, $WS_EX_TRANSPARENT)
Global $Tab1 = GUICtrlCreateTab(11, 20, 485, 199)

; Tab Scale
Global $TabScale = GUICtrlCreateTabItem("Scale")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

;Labels and inputs for first tab "Scale"
Global $Scale_Width = GUICtrlCreateLabel("Scale Width:", 58, 70, 65, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $InputSW = GUICtrlCreateInput("400", 131, 67, 100, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $Scale_W = GUICtrlCreateUpdown($InputSW)

    If _IsPressed("26", $Scale_W) Then ; Up
        GUICtrlSetData($InputSW, GUICtrlRead($InputSW) + 1)
        Sleep(100)
    ElseIf _IsPressed("28", $Scale_W) Then ; Down
        GUICtrlSetData($InputSW, GUICtrlRead($InputSW) - 1)
        Sleep(100)
    EndIf

Global $Scale_Height = GUICtrlCreateLabel("Scale Height:", 55, 100, 68, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $InputSH = GUICtrlCreateInput("400", 131, 97, 100, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $Scale_H = GUICtrlCreateUpdown($InputSH)

    If _IsPressed("26", $Scale_H) Then ; Up
        GUICtrlSetData($InputSH, GUICtrlRead($InputSH) + 1)
        Sleep(100)
    ElseIf _IsPressed("28", $Scale_H) Then ; Down
        GUICtrlSetData($InputSH, GUICtrlRead($InputSH) - 1)
        Sleep(100)
    EndIf

Global $PScale_offset = GUICtrlCreateLabel("Scale Offset:", 27, 130, 96, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $InputPO = GUICtrlCreateInput("0", 131, 127, 100, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $POffset = GUICtrlCreateUpdown($InputPO)

    If _IsPressed("26", $POffset) Then ; Up
        GUICtrlSetData($InputPO, GUICtrlRead($InputPO) + 1)
        Sleep(100)
    ElseIf _IsPressed("28", $POffset) Then ; Down
        GUICtrlSetData($InputPO, GUICtrlRead($InputPO) - 1)
        Sleep(100)
    EndIf

Global $PScale_Width = GUICtrlCreateLabel("Scale Width:", 27, 160, 96, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $InputPW = GUICtrlCreateInput("400", 131, 157, 100, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $PScaleW = GUICtrlCreateUpdown($InputPW)

    If _IsPressed("26", $PScaleW) Then ; Up
        GUICtrlSetData($InputPW, GUICtrlRead($InputPW) + 1)
        Sleep(100)
    ElseIf _IsPressed("28", $POffset) Then ; Down
        GUICtrlSetData($InputPW, GUICtrlRead($InputPW) - 1)
        Sleep(100)
    EndIf


; Right side of tab "Scale"
; automate boxes to read drag for $ScaleCo_X and $ScaleCo_Y
;*************************************************************
;*************************************************************
Global $Scale_Coordinates = GUICtrlCreateLabel("Scale Coordinates:", 277, 70, 93, 17)
Global $Scale_X = GUICtrlCreateLabel("X", 289, 100, 11, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $ScaleCo_X = GUICtrlCreateInput("", 301, 97, 50, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $Scale_Y = GUICtrlCreateLabel("Y", 364, 100, 11, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $ScaleCo_Y = GUICtrlCreateInput("", 376, 97, 50, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

;******* Scale Control Coordinates to be written later*****
;*************************************************************
;*************************************************************
Global $SCCoordinates = GUICtrlCreateLabel("SC Coordinates:", 277, 130, 87, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $SC_X = GUICtrlCreateLabel("X", 289, 160, 11, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $SCCo_X = GUICtrlCreateInput("", 301, 157, 50, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $SC_Y = GUICtrlCreateLabel("Y", 364, 160, 11, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $SCCo_Y = GUICtrlCreateInput("", 376, 157, 50, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")



;************************************************************************
; Tab Sheet 2 begins "Buttons"

Global $TabButtons = GUICtrlCreateTabItem("Buttons")

Global $MMLeft = GUICtrlCreateLabel("Margin Left", 40, 70, 57, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $InputML = GUICtrlCreateInput("0", 104, 67, 75, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $MML = GUICtrlCreateUpdown($InputML)

    If _IsPressed("26", $MML) Then ; Up
        GUICtrlSetData($InputML, GUICtrlRead($InputML) + 1)
        Sleep(100)
    ElseIf _IsPressed("28", $MML) Then ; Down
        GUICtrlSetData($InputML, GUICtrlRead($InputML) - 1)
        Sleep(100)
    EndIf


Global $MMBottom = GUICtrlCreateLabel("Margin Bottom", 25, 100, 72, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $InputMB = GUICtrlCreateInput("0", 104, 97, 75, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $MMB = GUICtrlCreateUpdown($InputMB)

    If _IsPressed("26", $MMB) Then ; Up
        GUICtrlSetData($InputMB, GUICtrlRead($InputMB) + 1)
        Sleep(100)
    ElseIf _IsPressed("28", $MMB) Then ; Down
        GUICtrlSetData($InputMB, GUICtrlRead($InputMB) - 1)
        Sleep(100)
    EndIf


Global $DDelay = GUICtrlCreateLabel("Drag Delay", 41, 130, 54, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $InputDD = GUICtrlCreateInput("0", 104, 127, 75, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $DD = GUICtrlCreateUpdown($InputDD)

    If _IsPressed("26", $DD) Then ; Up
        GUICtrlSetData($InputDD, GUICtrlRead($InputDD) + 1)
        Sleep(100)
    ElseIf _IsPressed("28", $DD) Then ; Down
        GUICtrlSetData($InputDD, GUICtrlRead($InputDD) - 1)
        Sleep(100)
    EndIf


Global $MTransparancy = GUICtrlCreateLabel("Transparancy", 30, 160, 69, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $InputT = GUICtrlCreateInput("0", 104, 157, 75, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
Global $MTrans = GUICtrlCreateUpdown($InputT)

    If _IsPressed("26", $MTrans) Then ; Up
        GUICtrlSetData($InputT, GUICtrlRead($InputT) + 1)
        Sleep(100)
    ElseIf _IsPressed("28", $MTrans) Then ; Down
        GUICtrlSetData($InputT, GUICtrlRead($InputT) - 1)
        Sleep(100)
    EndIf


; Menu on/off switches
; *************** To control switches on scale *******************
;*****************************************************************

Global $SButtonSwitch = GUICtrlCreateCheckbox("Scale Button", 205, 70, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

Global $PerButtonSwitch = GUICtrlCreateCheckbox("Percentage Button", 205, 100, 115, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

Global $ConfButtonSwitch = GUICtrlCreateCheckbox("Configuration Button", 205, 130, 115, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

Global $CalButtonSwitch = GUICtrlCreateCheckbox("Calculator Button", 205, 160, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

Global $NPButtonSwitch = GUICtrlCreateCheckbox("Notepad Button", 345, 70, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

Global $MinimizeButtonSwitch = GUICtrlCreateCheckbox("Minimize Button", 345, 100, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

Global $SCButtonSwitch = GUICtrlCreateCheckbox("SC Button", 345, 130, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")



;*************************************************************
; Begin New Sheet

Global $Tab1 = GUICtrlCreateTabItem("Sheet 1")




;*******************************************************************
; New Sheet

Global $Tab2 = GUICtrlCreateTabItem("Sheet 2")



;*****************************************************************************
; New Sheet



Global $Tab3 = GUICtrlCreateTabItem("Sheet 3")

;******************************************************************************
; New Sheet

Global $Tab4 = GUICtrlCreateTabItem("Sheet 4")

;*****************************************************************************
; New Sheet

Global $Tab5 = GUICtrlCreateTabItem("Sheet 5")

;*****************************************************************************
; New Sheet

Global $Tab6 = GUICtrlCreateTabItem("Sheet 6")

;*******************************************************************************
; Action Buttons

GUICtrlCreateTabItem("")
;*******************************************************************************
; Ok Button to write to INI or XML file before close
Global $OK = GUICtrlCreateButton("OK", 308, 226, 75, 25)

;******************************************************************************
; INI Button to open ini or xml File for manual adjustments (Probably INI easier for others to understand)

Global $INI = GUICtrlCreateButton("INI", 390, 226, 75, 25)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

; Allow GUI to be closed
HotKeySet("ESC", "_Exit")

; Array to hold action controlIDs

Global $aAction[8]

; Create popup GUI with layers
;First number is window width, second window height of window
;third screen L/R position, fourth screen height position
$hGUI = GUICreate("Auto Control Bot", 400, 100, 255, 670, $WS_POPUP, $WS_EX_LAYERED)

; Make main GUI transparent
GUISetBkColor(0xABCDEF)
_WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF, 250)

; Create ruler - adjust values to fit your requirements
GUICtrlCreateLabel("", 0, 50, 5, 50)
GUICtrlSetBkColor(-1, 0)
For $i = 0 To 11
    GUICtrlCreateLabel("", 33 * $i, 60, 2, 30)
    GUICtrlSetBkColor(-1, 0)
Next
GUICtrlCreateLabel("", 395, 50, 5, 50)
GUICtrlSetBkColor(-1, 0)

; Create action labels
For $i = 1 To 7
    $aAction[$i] = GUICtrlCreateLabel($i, 70 + (30 * $i), 0, 20, 20, BitOr($SS_CENTER, $SS_CENTERIMAGE))
    GUICtrlSetBkColor(-1, 0)
    GUICtrlSetColor(-1, 0xFFFFFF)
Next

GUISetState()

While 1

    $iMsg = GUIGetMsg()
    Switch $iMsg

        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_PRIMARYDOWN
            ; Drag GUI if mouse button pressed - need to be over ruler
            _SendMessage($hGUI, $WM_SYSCOMMAND, 0xF012, 0)
        Case Else
            For $i = 1 To 7
                ; Label actioned?
                If $iMsg = $aAction[$i] Then
                    ; Announce it
                    MsgBox($MB_SYSTEMMODAL, "Pressed", "Action " & $i)
                    ; No point in looking further
                    ExitLoop

                EndIf

            Next
    EndSwitch



WEnd



Func _Exit()
    Exit
EndFunc

 

Share this post


Link to post
Share on other sites

Syxguns,

I am afraid that in my opinion this falls foul of the Forum rules as it most definitely comes under "script interaction with games" - it is designed to overlay a game and allow you to adjust the manner in which you will play. As a result the thread will now be locked.

M23

 


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.