Text adventure engine:How to recieve string from player and respond to it?

I am trying to write a simple script to teach myself how to have textfield inputs from the player show in my label. But to no avail. The following script is supposed to show the state of the bucket
show the text field
take input"Tip bucket" from the textfield
and tip the bucket

using UnityEngine;
using System.Collections;

public class Receive : MonoBehaviour {
	
		public GUISkin Primitive;
		public string stringToEdit = "You wake up in a prison cell made of stone. There is water dripping into the bucket";
		public string toChange = "The bucket spills all over the floor of your cell.";
	 public string shouldBe = "Tip bucket";
	public string onceWas = "";
	
		void Update() {
			
      }
	 

     void OnGUI() {
		GUI.color = Color.black;
		
		GUI.skin = Primitive;
        onceWas = GUI.TextField(new Rect(330, 500, 200, 28), onceWas, 25);
	
		GUI.Label(new Rect(330, 100, 350, 600), stringToEdit);
		 
	if ((Input.GetButton("Enter") && GUI.TextField(new Rect(330, 500, 200, 28), shouldBe, 25))
	
				GUI.Label(new Rect(330, 100, 350, 600), toChange);
	
		 
    
}

How could I make this better/more efficient/actually functional? The error log says:

Assets/Receive.cs(27,35): error CS1525: Unexpected symbol GUI' Assets/Receive.cs(31,1): error CS1519: Unexpected symbol end-of-file’ in class, struct, or interface member declaration
Assets/Receive.cs(31,1): error CS8025: Parsing error

EDIT: So firstly I was missing a curly brace at the end. Secondly the ‘GUI’ problem was caused by a missing parenthesis on the “if” line. Now there is another error saying: &&' cannot be applied to operands of type bool’ and `string’ Trying to find a solution for that now.

I think that error just means you need 1 more “}” to close the Class.

using UnityEngine;
using System.Collections;
//using System.Collections.Generic; //if using lists

public class textAdventure : MonoBehaviour {

	// Use this for initialization
	//List<string> verbs;
	public string[] verbs;
	public string[] items;
	public TextAsset verbList;		
	public TextAsset itemList;
	public string[] actionToMatch;
	public string[] actions;
	string action;
	bool actionMatched = false;
	bool pickedAction = false;
	
	void Start () {
	string[] tempVerbs = verbList.text.Split(","[0]); //split the text
		verbs = new string[tempVerbs.Length];
		verbs = tempVerbs;
	string[] tempItems = itemList.text.Split(","[0]);
		items = new string[tempItems.Length];
		items = tempItems;
		actions = new string[10];
			action = "";
	actionToMatch = new string[3];
		
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	void matchText()
	{
		string[] input = action.Split(" "[0]);
		actions[0] = input[0];
		actions[1] = input[1];
		actions[2] = input[2];
		for(int i = 0; i < 3; i ++)
		{
			if(input[0] == actionToMatch*)*
  •  	{*
    
  •  		actionMatched = true;*
    
  •  	}*
    
  •  }*
    
  • }*

  • void getRandomAction()*

  • {*

  •  int choose = Random.Range(0,verbs.Length);*
    
  •  pickedAction = true;*
    
  •  actionToMatch[0] = verbs[choose];*
    
  •  actionToMatch[1] = verbs[choose+1];*
    
  •  actionToMatch[2] = verbs[choose+2];*
    
  • }*

  • void OnGUI()*

  • {*

  •  action = GUI.TextField(new Rect(0,0,400,20),action);*
    
  •  if(!pickedAction)*
    
  •  {*
    
  •  	getRandomAction();*
    
  •  }*
    
  •  if(!actionMatched)*
    
  •  {*
    
  •  GUI.Label(new Rect(0,30,400,20),actionToMatch[0]);*
    
  •  	GUI.Label(new Rect(0,50,400,20),actionToMatch[1]);*
    
  •  	GUI.Label(new Rect(0,70,400,20),actionToMatch[2]);*
    
  •  	if(GUI.Button(new Rect(420,0,100,20),"Submit"))*
    
  •  	{*
    
  •  		matchText();*
    
  •  	}*
    
  •  }*
    
  •  else*
    
  •  {*
    
  •  	GUI.Label(new Rect (0,30,500,20),"You Sucessfully " + actions[0] + " the " + actions[1] + " " + actions[2]);*
    
  •  }*
    
  • }*
    }
    this is just something I fired together, its far from perfect, but just shows a few principles, about picking words out of a list and so on, it may be a good idea to have your actions that could be the same put together, and then pick a group of actions based on the appropriate action for the situation. its quite a tough system to get right. but hopefully this may point you some way to how it can be done. YMMV.
    incidentally, there are 2 text files required for this, one with verbs and one of items, they both much be comma delimited.