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

Query boxes help please


JayT
 Share

Recommended Posts

hey ive been looking at query boxes for like 2 hours now lol! ive been through the tuts and im still no more familiar with it. Ok so i changed my Sub Query to this:
```
Sub QueryBox(index, script)
Value = GetVar("responses.ini", "Responses", Cstr(index))

Select Case script
Case 0

Select Case Value
Case "password"
Call PlayerMsg(index, "You've guessed the correct password!", 15)

Case Else
Call PlayerMsg(index, "That is incorrect!", 12)

End Select

End Select

End Sub
```
as this is how Balliztik1 changes it in his tut but i dont get it :-S….
all i want is to get the info that they type in the textbox in the query window and use it in a script, also for some reason i dont have the Responses.ini in my server as im using EE 2.7 but i know i can just create that and put the info in there. if any1 can shed a little more light on this then that would be great! lol thanks alot
Link to comment
Share on other sites

I'm going to assume you already have knowledge of sadscript, as well as the Select Case system.

When you open a querybox, whatever you type will saved as "Value" in the querybox sub.

So when you have:
Case "password"
Everything under that (till the next Case), will execute if the player entered "Password".
This, of course, is for Script#0 (hence the first "Case 0").

Read over the following, and try to get a "feel" of how it works.
```
Sub QueryBox(index, script)
Value = GetVar("responses.ini", "Responses", Cstr(index))
Select Case script
' This is for script 0
Case 0
Select Case Value
Case "password"
Call PlayerMsg(index, "The user entered the word: password", 15)
Case "mouse"
Call PlayerMsg(Index, "The user entered: mouse", 15)
Case Else
Call PlayerMsg(index, "The user entered something other then password or mouse", 12)
End Select
Exit Sub
' This is for script 1
Case 1
Call PlayerMsg(Index, "This will display no matter what the user enters with script1", 15)
If Value = "Happyland" Then
Call PlayerMsg(Index, "User entered... Happyland.", 15)
End If
Exit Sub
Case Else
Call PlayerMsg(Index, "No script found; please contact tech", white)
Exit Sub
End Select
End Sub

```
Link to comment
Share on other sites

sorry for double post but still cant do what i want to do lol. im making a guild creation script and when the query pops up and they put in their guild name and what ever they put in i want it to create that guild for them, but with this is read what they say and if it matches what ever i want it to it'll do it but this is different, i wanna get what they said and create that guild if you get what i mean

EDIT: would instead of the Value = GetVar("Responses.ini blah blah) change it to/ or add underneath  Guild = Cstr(Index) …... would that work?
Link to comment
Share on other sites

You're welcome.

Configuring the Query Boxes to create a different header may be more beneficial, since you can make it so that if multiple people are creating a guild at once, there is no chance that one player will get another player's guild. I think that's possible in this case but very rare to occur. Lag might be the main factor in causing that to occur. I've never experienced anything like that before, but to me, it seems like it can happen, since everyone's guild value is being read from the same INI file, header, and variable. Anyway, I know how to change the header that the INI file will produce, but it requires a slight amount of source editing.

I just thought I'd point that out.
Link to comment
Share on other sites

@Kimimaru:

> You're welcome.
>
> Configuring the Query Boxes to create a different header may be more beneficial, since you can make it so that if multiple people are creating a guild at once, there is no chance that one player will get another player's guild. I think that's possible in this case but very rare to occur. Anyway, I know how to change the header that the INI file will produce, but it requires a slight amount of source editing.
>
> I just thought I'd point that out.

Won't happen. The variable's name is based upon the player's index number. There's no chance you won't get one that isn't yours, since only one index is assigned to one player at any given time.
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...