Jump to content
eKolin

Variable change

Recommended Posts

eKolin

Hello! I want to create a simple GUI that would be something like this (created with paint, good enough lol):
bd6d45cb120d447fae9415b2b43b9528.png

Basicly I should be able to edit the black text to whatever i want in the code, the little blue boxes are to put in already existing (that have values of 0) $variable and $variable2 values, if blank then 0. This GUI Would have to pop up only on script start, OK to change the $variable $variable2 and "start" the script. Would like that some1 would write this little script and i could learn out of it ;)

Edited by eKolin
Typo

Share this post


Link to post
Share on other sites
VIP

learn quickly from example:

#include <GUIConstantsEx.au3>

Global $hGUI = GUICreate("AutoIt Input", 573, 94, -1, -1)
GUICtrlCreateLabel("Text, change $variable value to: ", 16, 16, 188, 17)
Global $iVariable = GUICtrlCreateInput("", 208, 16, 105, 21)
Global $Label2 = GUICtrlCreateLabel("Text", 320, 16, 116, 17)
GUICtrlCreateLabel("Text, change $variable2 value to:", 17, 52, 188, 17)
Global $iVariable2 = GUICtrlCreateInput("", 209, 52, 105, 21)
Global $Label4 = GUICtrlCreateLabel("TeXt", 321, 52, 108, 17)
Global $bChange = GUICtrlCreateButton("Button1", 440, 16, 113, 57)
GUISetState(@SW_SHOW)

Global $variable, $variable2

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $bChange
            $variable = GUICtrlRead($iVariable) ; Read/get data of a Input1.
            $variable2 = GUICtrlRead($iVariable2) ; Read/get data of a Input2.
            MsgBox(0, "Value Now", "$variable  value= " & $variable & @CRLF & "$variable2 value= " & $variable2)
    EndSwitch
    Sleep(10)
WEnd

 

Edited by Trong

Regards,
 

Share this post


Link to post
Share on other sites
JLogan3o13

@eKolin all of your posts thus far have been something to the effect of "this should be simple, write it for me". This forum operates on the "teach a man to fish" motto; it is not a place where you put in a demand and someone barfs up code for you. You need to put in some effort if you want to learn. Below is a GUI template to get you started, as was suggested above you need to do some reading in the help file to figure out the rest of it.

#include <GUIConstantsEx.au3>

    $hGUI = GUICreate("Test", 300, 300)
        GUISetState(@SW_SHOW)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                Exit
        EndSwitch
    WEnd

 

Edit: Or just wait long enough and someone will spoon-feed it to you I guess.

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
eKolin
9 minutes ago, JLogan3o13 said:

@eKolin all of your posts thus far have been something to the effect of "this should be simple, write it for me". This forum operates on the "teach a man to fish" motto; it is not a place where you put in a demand and someone barfs up code for you. You need to put in some effort if you want to learn. Below is a GUI template to get you started, as was suggested above you need to do some reading in the help file to figure out the rest of it.

#include <GUIConstantsEx.au3>

    $hGUI = GUICreate("Test", 300, 300)
        GUISetState(@SW_SHOW)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                Exit
        EndSwitch
    WEnd

 

@JLogan3o13 Well, sorry then. Sometimes it seems pointless to me when i spend like 2-8 hours to do a basic function when i need A TON of them, already spent like 50 hours learning AU3 past 2 weeks + school, so don't think that i'm asking for everything done for me. I'm asking only for stuff that imo don't have clear enough tutorials for 0 skill people or just i'm getting tilted because i can't make one function work, instead i ask for another function to save some time doing my project. I find copy/paste helping me to learn aswell.

Edited by eKolin
Included @

Share this post


Link to post
Share on other sites
JLogan3o13

@eKolin, everyone on this forum was a "0 skill person" at some point. But the longer you rely on someone to spoon feed it to you the longer you will stay a "0 skill person". If you run into issues with a function, or how to complete a task after trying it yourself, then post what you have. You'll find people a lot more willing to help if you show some level of effort rather than "this should be easy for you, do it for me".

As to your point about clear enough tutorials, you're asking to create a gui. The example I provided you is almost word for word out of the help file. If you find something that is not clear in the help file - ask. It at least shows you are putting forth some effort.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
VIP

"this should be easy for you, do it for me" 1113Sortlist-Facebook-Stickers.png  


Regards,
 

Share this post


Link to post
Share on other sites
JLogan3o13

@Trong exactly what did that add to the discussion, aside from inflating your post count?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
VIP

@JLogan3o13

I'm not interested in the post coun!
If possible I want to remove 90% of my posts.

Anyway I will not spam the same content again!  it's just a reaction to having a saying with the impact.


Regards,
 

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

×