Jump to content

Specifying # Of Input boxes


Recommended Posts

Okay so, I've been working on a program for a chatroom that has functions for ease of access in doing things.

I'd like to make a function to where it makes an input box like so:

InputBox("Chatroom Program","How many chats would you like to join?", "", "", 110, 140)

Then I would type in a number, such as three, then three input boxes would come up: (Or however many I wanted)

$Input1 = InputBox("Chatroom Program","Please input a chatroom name:", "", "", 110, 140)
$Input2 = InputBox("Chatroom Program","Please input a chatroom name:", "", "", 110, 140)
$Input3 = InputBox("Chatroom Program","Please input a chatroom name:", "", "", 110, 140

Then it would join those chats using send:

Send("/join "& $Input1)
Send("/join "& $Input2)
Send("/join "& $Input3)

Now my question is, is how would that be accomplished in the first place?

And, how could you make it so that the script could define a variable by itself?

Link to comment
Share on other sites

Something like this perhaps (untested)

$sInput = InputBox("Chatroom Program","How many chats would you like to join?", "", "", 110, 140)

$var = GUICtrlRead($sInput)
If Not @error And IsInt($var) Then
    For $i = 1 To $var
        GUICtrlCreateInput("Chatroom" & $i, $i + 12, $i + 12, 10, 50) ; figure out where to put them
    Next
EndIf

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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...