Sign in to follow this  
Followers 0
Penisaurus

Specifying # Of Input boxes

3 posts in this topic

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?

Share this post


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

Share this post


Link to post
Share on other sites

$var will be a String so IsInt($var) will not work. IsInt(Number($var)) would though.

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
Sign in to follow this  
Followers 0