Jump to content

Newbie Help :)


Recommended Posts

Ok Guys And Gals.. Here I Am, A Newb In All Ways To AutoIt... And I've Played Around Abit With This A Little Bit.. And So Far, I'm Sorta Happy With My Results..

Now, I'm Attempting To Add To This Current Setup A GUI.. And I'm Completely Lost.. I Can't Even Work Out The Basics Of Gui Coding.. What I'm Asking Is For Any Of You Guys To Assist Me With Some Basic GUI Code..

Here's Where I Am Now..

;; image design
WinActivate("SwgClient")
Send("/sit{Enter}")
HotKeySet("^z", "MyExit")
;; Loop1
While 1=1
Sleep(300)
Send(" / image{Enter}")
Sleep(300)
;; Select's Attribute to change
MouseClick("left", 468, 117, 1)
Sleep(100)
;; Select's attributes change (color, etc)
MouseClick("left", 426, 275, 1)
Sleep(300)
;; Confirms change
MouseClick("left", 623, 700, 1)
;;Send(" / ui action toolbarSlot04{Enter}")
Sleep(300)
Send("/ image{Enter}")
Sleep(300)
;; Select's Attribute to change
MouseClick("left", 468, 117, 1)
Sleep(100)
;; Select's attributes change (color, etc) Use different color this time.
MouseClick("left", 426, 290, 1)
Sleep(300)
;; Confirms change
MouseClick("left", 623, 700, 1)
;;Send("/ ui action toolbarSlot04{Enter}")
Sleep(300)
Send(" / image{Enter}")
Sleep(300)
;; Select's Attribute to change
MouseClick("left", 468, 117, 1)
Sleep(100)
;; Select's attributes change (color, etc)
MouseClick("left", 426, 275, 1)
Sleep(300)
;; Confirms change
MouseClick("left", 623, 700, 1)
;;Send(" / ui action toolbarSlot04{Enter}")
Sleep(300)
Send("/ image{Enter}")
Sleep(300)
;; Select's Attribute to change
MouseClick("left", 468, 117, 1)
Sleep(100)
;; Select's attributes change (color, etc) Use different color this time.
MouseClick("left", 426, 290, 1)
Sleep(300)
;; Confirms change
MouseClick("left", 623, 700, 1)
;;Send("/ ui action toolbarSlot04{Enter}")
Sleep(300)
Send(" / image{Enter}")
Sleep(300)
;; Select's Attribute to change
MouseClick("left", 468, 117, 1)
Sleep(100)
;; Select's attributes change (color, etc)
MouseClick("left", 426, 275, 1)
Sleep(300)
;; Confirms change
MouseClick("left", 623, 700, 1)
;;Send(" / ui action toolbarSlot04{Enter}")
Sleep(300)
Send("/ image{Enter}")
Sleep(300)
;; Select's Attribute to change
MouseClick("left", 468, 117, 1)
Sleep(100)
;; Select's attributes change (color, etc) Use different color this time.
MouseClick("left", 426, 290, 1)
Sleep(300)
;; Confirms change
MouseClick("left", 623, 700, 1)
;;Send("/ ui action toolbarSlot04{Enter}")
Sleep(1000)
Wend

Func MyExit()
   Exit
EndFunc

So, What I'm Really Looking For, Is A Basic GUIWindow, With a Toggle Button, That's Also Linked To A Hotkey, Usable In Or Out Of The Target window. If This Isn't Possible, Lemme Know.. Heh. Thanks In Advance.

Link to comment
Share on other sites

Yawn... Read the help file... Each GUICtrlCreate() control has an example, everyone. Type 'GUICtrlCreate' into the help file and see for yourself. Seeing as your beginning try looking at the GUICtrlCreateButton() example for your toggle button or use a check box > GUICtrlCreateCheckbox().

Edit: Also look at the below code. In contains most the the GUI controls. Im not sure if it comes with the stable 3.1.1 version or just the Beta. For the actual au3 file look in 'C:\Program Files\AutoIt3\tests\gui\. The drive and program files folder name might vary from yours.

CODE
; AutoIt 3.0.103 example

; 17 Jan 2005 - CyberSlug

; This script shows manual positioning of all controls;

; there are much better methods of positioning...

#include <GuiConstants.au3>

; GUI

GuiCreate("Sample GUI", 400, 400)

GuiSetIcon(@SystemDir & "\mspaint.exe", 0)

GUISetBkColor(0x00A0E0E0)

; MENU

GuiCtrlCreateMenu("Menu&One")

GuiCtrlCreateMenu("Menu&Two")

GuiCtrlCreateMenu("MenuTh&ree")

GuiCtrlCreateMenu("Menu&Four")

; CONTEXT MENU

$contextMenu = GuiCtrlCreateContextMenu()

GuiCtrlCreateMenuItem("Context Menu", $contextMenu)

GuiCtrlCreateMenuItem("", $contextMenu);separator

GuiCtrlCreateMenuItem("&Properties", $contextMenu)

; PIC

GuiCtrlCreatePic("logo4.gif",0,0, 0,0)

GuiCtrlCreateLabel("Sample pic", 75, 1, 53, 15)

; AVI

GuiCtrlCreateAvi("sampleAVI.avi",0, 180, 10, 32, 32, $ACS_AUTOPLAY)

GuiCtrlCreateLabel("Sample avi", 170, 50)

; TAB

GuiCtrlCreateTab(240, 0, 150, 80)

GuiCtrlCreateTabItem("One")

GuiCtrlCreateLabel("Sample Tab with tabItems", 250, 25)

GuiCtrlSetBkColor(-1, 0x00FF00)

GuiCtrlCreateEdit("Sample edit control", 250, 50)

GuiCtrlCreateTabItem("Two")

GuiCtrlCreateTabItem("Three")

GuiCtrlCreateTabItem("")

; COMBO

GuiCtrlCreateCombo("Sample Combo", 250, 80, 120, 100)

; PROGRESS

GuiCtrlCreateProgress(60, 80, 150, 20)

GuiCtrlSetData(-1, 60)

GuiCtrlCreateLabel("Progress:", 5, 82)

; EDIT

GuiCtrlCreateEdit(@CRLF & " Sample Edit Control", 10, 110, 150, 70)

GuiCtrlSetBkColor(-1,0xff0000)

; LIST

GuiCtrlCreateList("", 5, 190, 100, 90)

GuiCtrlSetData(-1, "a.Sample|b.List|c.Control|d.Here", "b.List")

; ICON

GuiCtrlCreateIcon("shell32.dll", 1, 175, 120)

GuiCtrlCreateLabel("Icon", 180, 160, 50, 20)

; LIST VIEW

$listView = GuiCtrlCreateListView("Sample|ListView|", 110, 190, 110, 80)

GuiCtrlCreateListViewItem("A|One", $listView)

GuiCtrlCreateListViewItem("B|Two", $listView)

GuiCtrlCreateListViewItem("C|Three", $listView)

; GROUP WITH RADIO BUTTONS

GuiCtrlCreateGroup("Sample Group", 230, 120)

GuiCtrlCreateRadio("Radio One", 250, 140, 80)

GuiCtrlSetState(-1, $GUI_CHECKED)

GuiCtrlCreateRadio("Radio Two", 250, 165, 80)

GUICtrlCreateGroup ("",-99,-99,1,1) ;close group

; UPDOWN

GuiCtrlCreateLabel("UpDown", 350, 115)

GuiCtrlCreateInput("42", 350, 130, 40, 20)

GuiCtrlCreateUpDown(-1)

; LABEL

GuiCtrlCreateLabel("Green" & @CRLF & "Label", 350, 165, 40, 40)

GuiCtrlSetBkColor(-1, 0x00FF00)

; SLIDER

GuiCtrlCreateLabel("Slider:", 235, 215)

GuiCtrlCreateSlider(270, 210, 120, 30)

GuiCtrlSetData(-1, 30)

; INPUT

GuiCtrlCreateInput("Sample Input Box", 235, 240, 130, 20)

GuiCtrlCreateInput("Colored Input Box", 235, 265, 130, 20)

GuiCtrlSetColor(-1, 0xFF0000)

GuiCtrlSetBkColor(-1, 0x0000FF)

; DATE

GuiCtrlCreateDate("", 5, 280, 200, 20)

GuiCtrlCreateLabel("(Date control expands into a calendar)", 10, 305, 200, 20)

; BUTTON

GuiCtrlCreateButton("Sample Button", 10, 330, 100, 30)

; CHECKBOX

GuiCtrlCreateCheckbox("Checkbox", 130, 335, 80, 20)

GuiCtrlSetState(-1, $GUI_CHECKED)

; TREEVIEW ONE

$treeOne = GuiCtrlCreateTreeView(210, 290, 80, 80)

GUICtrlSetBkColor(-1,0x00ff00)

$treeItem = GuiCtrlCreateTreeViewItem("TreeView", $treeOne)

GuiCtrlCreateTreeViewItem("Item1", $treeItem)

GuiCtrlCreateTreeViewItem("Item2", $treeItem)

GuiCtrlCreateTreeViewItem("Foo", -1)

GuiCtrlSetState($treeItem, $GUI_EXPAND)

; TREEVIEW TWO

$treeTwo = GuiCtrlCreateTreeView(295, 290, 103, 80, $TVS_CHECKBOXES)

GuiCtrlCreateTreeViewItem("TreeView", $treeTwo)

GuiCtrlCreateTreeViewItem("With", $treeTwo)

GuiCtrlCreateTreeViewItem("tvs_checkboxes", $treeTwo)

GuiCtrlSetState(-1, $GUI_CHECKED)

GuiCtrlCreateTreeViewItem("Style", $treeTwo)

; GUI MESSAGE LOOP

GuiSetState()

While GuiGetMsg() <> $GUI_EVENT_CLOSE

WEnd

Edited by Burrup

qq

Link to comment
Share on other sites

Hey Thanks For The Reply.. Like I Said.. I'm Completely Lost When It Comes To GUI's... For Some Reason It Just Wasn't Sinking Into My Brainmeats. LoL.. I Had Not Found This.. And This Is Exactly The Kind Of Thing I Needed :(.. Thank You A Ton.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...