Custom Input Box for search

Started by magintz, Thu 24/07/2003 18:18:15

Previous topic - Next topic

magintz

I'm trying to use a sort of search engine in my game. I do not want to use the default one, but a simple one with a text box, go button, and quit button, but nothing seems to want to work.

if (interface == PARSER) {
 if (button == 2) {
   if (GetTextBoxText(7,0,input)) {
      if (StrCaseComp(input, "llama")==0) {Display("YAY");}
       else {Display("NAY");}}}
   
 else if (button == 3)
   NewRoom(2);
   GUIOff(PARSER);
   

}}

can someone help me get ti to work?
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

SSH

Assuming that PARSER is GUI 7 and your textbox is object 0, and this code is in interface_click with all the other numbers etc. correct, it looks fine to me.

But then I haven't done much with GUIs myself...
12

magintz

QuoteAssuming that PARSER is GUI 7 and your textbox is object 0, and this code is in interface_click with all the other numbers etc. correct, it looks fine to me

Yes PARSER is GUI 7
Yes textbox is object0
Yes the code is in the GUI script section
No it doesn't work
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

magintz

I've also now tried

if (interface == 7) {
 if (button == 2) {
   GetTextBoxText(7,0,input);
ParseText(input);
if (Said("llama")) {
 SetTextBoxText(7,0,"");
 Display("YAY");}
}

 else if (button == 3) {
   NewRoom(2);
   GUIOff(7);}
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

MachineElf

What, exactly, is it that won't work?
Does none of the buttons work or just not the search button?
There are 10 kinds of people in the world: Those who understand binary and those who don't.

magintz

Neither of the buttons work... I can type stuff in and press the buttons but nothing happens... nothing at all
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

magintz

When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

MachineElf

Ok, I found your error.
You have a bracket too little just before if (interface == PARSER) and one too many in the end of the script.
There are 10 kinds of people in the world: Those who understand binary and those who don't.

magintz

#8
Thanks... why does it always have to be such a simple mistake :@(

I'm now getting a problem...

"Error: Said: Supplied word is not in dictionary or is an ignored word

hmm..." - sorted
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

SMF spam blocked by CleanTalk