Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Input Box Command?


Kimimaru
 Share

Recommended Posts

Hello. I'm currently making a script, which I will probably release when it's complete, and I've been looking around to see if SadScript had a command that makes an input box appear, but I haven't found one. What I'm looking for is a command that makes a box pop up, similar to a MsgBox, except with a space for the player to enter information. If there's one, can someone please tell me the syntax? If not, is it possible to create one? Also, if you were to type text in the input box, what would the variable for the text be? Thanks.
Link to comment
Share on other sites

I didn't think it would be worth it to make another topic, so I'll ask my simple question here. How would I go about making a String a certain number of characters long? Here's an example:

```
If Value > 3 Then
```
Something like that doesn't seem to work. The variable, **Value**, is a String.
Link to comment
Share on other sites

I just have one more simple question. Is there a way to add a title to a QueryBox, similar to a MsgBox? Here's an example of a MsgBox syntax:

```
MsgBox "(message)", 0, "(title)"
```
I know that a QueryBox takes this form:

```
Call PlayerQueryBox(Index, Message, Script)
```
So, is it possible to stick in a title? Whenever the QueryBox comes up, it shows the VB6 form symbol and then "QueryBox," which doesn't look very good, in my opinion. Any help would be greatly appreciated.
Link to comment
Share on other sites

I can probably figure it out, but if I can't, I'll post here again. Thanks for the help!

Sorry about this, but one final small concern. Say the variable, **Value**, was typed into a QueryBox.

This isn't working for me:

```
Case 1
Select Case Value

Case "hi"

Call PlayerMsg(Index, "That is invalid!", WHITE)

Case Else

Call PutVar("Events.ini", "Data", "Events", Value)

End Select
    End Select
```
This is just an example.

My concern is with the **Call PutVar("Events.ini", "Data", "Events", Value)** part. That part is supposed to replace the current value of the **Events** variable with the value of the **Value** variable. For some reason, it's not working.
Link to comment
Share on other sites

Hmm. I don't see why that wouldn't work. Unless your not allowed to have a select case within a select case.
Or, it might be a type mismatch.

Try putting Trim() around value.
```
Call PutVar("Events.ini", "Data", "Events", Trim(Value))

```And changing the second select case to an If Then … Else Statement.
Link to comment
Share on other sites

Thanks for the help guys! <>'s method worked, but I didn't do the whole thing. I simply changed it to:

```
Call PutVar("Events.ini", "Data", "Events", Trim(Value))

```
I didn't change the cases or anything else.

When I restart the client, however, the value for the **Events** variable reverts back to how it was before.

As for the QueryBox title, I've removed a certain section of the "querybox" packet in **modHandleData** that displays the VB6 form model, but it didn't seem to remove it. Do you think I can get some help with that, please?
Link to comment
Share on other sites

Oh, okay. Sorry about that. I didn't change them at all. Here they are:

```
' Executes when the server initially loads.
Sub OnServerLoad()
GameName = GetVar("Data.ini", "CONFIG", "GameName")
MAX_MAPS = GetVar("Data.ini", "MAX", "MAX_MAPS")
MOTD = GetVar("MOTD.ini", "MOTD", "Msg")
End Sub
```

```
' Executes when the scripts are reloaded.
Sub OnScriptReload()
GameName = GetVar("Data.ini", "CONFIG", "GameName")
MAX_MAPS = GetVar("Data.ini", "MAX", "MAX_MAPS")
MOTD = GetVar("MOTD.ini", "MOTD", "Msg")
End Sub
```
I don't know what else you need to see.
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

×
×
  • Create New...