Jump to content

[C#] GetUserInputAsync


enisn

Recommended Posts

spacer.png

 

Summary: This script helps to get input easily in Client-Side with C#.

Download: BasicInput.cs (github.com)

 

Usage: 

 

// Just get input.
BasicInput.GetInput((input) =>
{
 	Chat.Output("Your message is: " + input);
});

//-------------
// Get input with Title & Maxlength
BasicInput.GetInput((input) =>
{
 	Chat.Output("Your message is: " + input);
}, "Type your message:", 32);

//-------------
// Get input with existing text:
BasicInput.GetInput((input) =>
{
 	Chat.Output("Your message is: " + input);
}, "Type your message:", 32, "Old Message");


// --------------
// Also can get 2 parameters to get state of input.

BasicInput.GetInput((input, state) =>
{
  if (state == BasicInput.InputResultState.Canceled)
    {
    	Chat.Output("Input Canceled!");
    }
    if (state == BasicInput.InputResultState.Completed)
    {
	    Chat.Output("Input completed successfully and mesasge is " + input);
    }
});

 

  • Like 2
Link to comment
Share on other sites

  • 1 year later...

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
  • Recently Browsing   0 members

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