Syzygyn

How do I get the input from a list of items?

5 posts in this topic

So I was trying to turn my old normal autoclicker based around text and input boxes, into a GUI controlled one that I could use the same hotkeys, but streamline the process of putting in information. This way instead of going through around 8 msg and input boxes, I could just use 1 GUI.

I have never used GUIs before and am sorry for these noob questions. I have tried using the help, but I don't really understand what it means.

 

This is the GUI code

#Region ### START Koda GUI section ### Form=C:\Users\c\Desktop\GUIs\Autoclicker Test Gui.kxf
$Form1 = GUICreate("AutoClicker GUI", 630, 227, 192, 124)
$Pic1 = GUICtrlCreatePic("C:\Users\c\Pictures\fancy_Z.jpg", 72, 40, 129, 129)
$Label1 = GUICtrlCreateLabel("Created by: Syzygyn", 88, 16, 100, 17)
$Speed = GUICtrlCreateInput("The Speed of the Clicker", 224, 72, 137, 21)
$List1 = GUICtrlCreateList("", 376, 80, 73, 32)
GUICtrlSetData(-1, "Left Click|RightClick")
$List2 = GUICtrlCreateList("", 456, 80, 81, 32)
GUICtrlSetData(-1, "Push to Pause|Push to Run")
$List3 = GUICtrlCreateList("", 544, 80, 73, 32)
GUICtrlSetData(-1, "Use U|Use V")
$Button1 = GUICtrlCreateButton("Run", 352, 152, 97, 41)
$Input1 = GUICtrlCreateInput("Window to activate (0=no)", 224, 96, 137, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

And then I tried to define other variables based on the buttons and lists

Func RunAutoClicker()

   $Speed2 = $Speed
   If $List3 = "Use U" Then
      $Key = 55
   Else
      $Key = 56
   EndIf
   If $List1 = "Left Click" Then
      $Click = "left"
   Else
      $Click = "right"
   EndIf
   If $List2 = "Push to Pause" Then
      $Pusher = "pause"
   Else
      $Pusher = "constant"
   EndIf
   If $Input1 = 0 Then
      $Window = ""
   Else
      $Window = $Input1
   EndIf

I also don't really know how to run this function by the press of the "Run" button. Thanks for your patience!

Share this post


Link to post
Share on other sites

Also I just posted this 3 times, is there a way to delete the 2 copies?

My bad.

 

Share this post


Link to post
Share on other sites

I tried doing this to test out how the inputs work and all, but all I got was the Msgbox title as 5 and the text as 3 which didn't make any sense to me.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>


#Region ### START Koda GUI section ### Form=
$TestForm = GUICreate("TestForm", 615, 437, 192, 124)
$TestInput = GUICtrlCreateInput("Put Something here", 216, 56, 169, 21)
$Button1 = GUICtrlCreateButton("Start", 232, 232, 145, 97)
$List1 = GUICtrlCreateList("", 256, 112, 65, 71)
GUICtrlSetData(-1, "Test1|Test2|Test3|Test4")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
         Case $Button1
            MsgBox(1, $List1, $TestInput)

    EndSwitch
WEnd

 

Share this post


Link to post
Share on other sites

I just watched a random youtube tutorial and it really helped with the variables, I realized that I need to use $GUICtrlRead to define the variables so I did this:

#include <misc.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Users\c\Desktop\GUIs\Autoclicker Test Gui.kxf
Global $Form1 = GUICreate("AutoClicker GUI", 630, 227, 192, 124)
Global $Pic1 = GUICtrlCreatePic("C:\Users\c\Pictures\fancy_Z.jpg", 72, 40, 129, 129)
Global $Label1 = GUICtrlCreateLabel("Created by: Syzygyn", 88, 16, 100, 17)
Global $Speed = GUICtrlCreateInput("The Speed of the Clicker", 224, 72, 137, 21)
Global $List1 = GUICtrlCreateList("", 376, 80, 73, 32)
GUICtrlSetData(-1, "Left Click|RightClick")
Global $List2 = GUICtrlCreateList("", 456, 80, 81, 32)
GUICtrlSetData(-1, "Push to Pause|Push to Run")
Global $List3 = GUICtrlCreateList("", 544, 80, 73, 32)
GUICtrlSetData(-1, "Use U|Use V")
Global $Button1 = GUICtrlCreateButton("Run", 352, 152, 97, 41)
Global $Input1 = GUICtrlCreateInput("Window to activate (0=no)", 224, 96, 137, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
         Case $Button1
            $Speed2 = GUICtrlRead($Speed)
            ConsoleWrite($Speed2)
            $ClickBuf = GUICtrlRead($List1)
            If $ClickBuf = "Left Click" Then
               $Click = "left"
            Else
               $Click = "right"
            EndIf
            ConsoleWrite($Click)
            $PusherBuf = GUICtrlRead($List2)
            If $PusherBuf = "Push to Pause" Then
               $Pusher = "pause"
            Else
               $Pusher = "constant"
            EndIf
            ConsoleWrite($Pusher)
            $WindowBuf = GUICtrlRead($Input1)
            If $WindowBuf = "0" Then
               $Window = ""
            Else
               $Window = $WindowBuf
            EndIf
            ConsoleWrite($Window)
            $KeyBuf = GUICtrlRead($List3)
            If $KeyBuf = "Use V" Then
               $Key = 56
            Else
               $Key = 55
            EndIf
            ConsoleWrite($Key)


    EndSwitch
WEnd

 

Share this post


Link to post
Share on other sites

I FINISHED IT :D

1 person likes this

Share this post


Link to post
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