protected int genMudChat(MOB mob, String var, TriadList<String,String,Integer> behaviors, int showNumber, int showFlag)
	throws IOException
	{
		final int mndex=behaviors.indexOfFirst(var);
		final List<List<String>> mudChatV = breakOutMudChatVs(var,behaviors);
		List<String> V = null;
		String s=null;
		for(int v=0;v<=mudChatV.size();v++)
		{
			if((showFlag>0)&&(showFlag!=showNumber))
			{
				if(v<mudChatV.size())
					showNumber++;
				continue;
			}
			if(v==mudChatV.size())
			{
				if((mob.session()!=null)&&(!mob.session().isStopped()))
				{
					if(((showFlag<=-999)&&CMLib.genEd().prompt(mob,false,showNumber,showFlag,L("Add new mud chat")))
					||(showNumber==showFlag))
					{
						V=new Vector<String>();
						V.add("match | these | words or phrases");
						V.add("9say this");
						mudChatV.add(V);
						v-=1;
					}
					else
					if(showFlag==-1)
						mob.tell(L("@x1. Add new mud chat.",""+showNumber));
				}
				continue;
			}
			V=mudChatV.get(v);
			String words=V.get(0);
			mob.tell(L("@x1. MudChat for words: @x2",""+showNumber,words));
			if((showFlag==showNumber)||(showFlag<=-999))
			{
				words=CMLib.genEd().prompt(mob,words,showNumber,showFlag,L("Enter matching words (| delimited, NULL to delete)\n\r"),true);
				if(words.trim().length()==0)
				{
					mudChatV.remove(v);
					if((showFlag==showNumber))
						break;
					showNumber--;
					continue;
				}
				V.set(0,words);
				for(int v1=1;v1<=V.size();v1++)
				{
					if(v1==V.size())
					{
						if((mob.session()!=null)&&(!mob.session().isStopped())
						&&(mob.session().confirm(L("Add another thing to say (y/N)"),L("NO"))))
						{
							V.add("9say this");
							v1-=1;
						}
						continue;
					}
					s=V.get(v1);
					String newStr="?";
					while((newStr.equals("?"))&&(mob.session()!=null)&&(!mob.session().isStopped()))
					{
						newStr=mob.session().prompt(L("Enter  # Weight + thing to say (?) '@x1'\n\r: ",s),s);
						if(newStr.equals("?"))
							mob.tell(L("Enter a number followed by a phrase to say like 9thingtosay. Enter NULL to delete this thing to say."));
						else
							s=newStr;
					}
					if(s.trim().length()==0)
					{
						V.remove(v1);
						v1--;
						continue;
					}
					if(!Character.isDigit(s.charAt(0)))
						s="9"+s;
					V.set(v1,s);
				}
			}
			showNumber++;
		}
		final StringBuffer finalVal=new StringBuffer("");
		for(int v=0;v<mudChatV.size();v++)
		{
			V=mudChatV.get(v);
			if(V.size()==0)
				continue;
			finalVal.append("("+(V.get(0))+");");
			for(int v1=1;v1<V.size();v1++)
				finalVal.append((V.get(v1))+";");
			finalVal.append(";");
		}
		if(mndex>=0)
			behaviors.get(mndex).second  =(finalVal.toString().trim().length()==0)?"":("+"+finalVal.toString());
		else
			behaviors.add(var,(finalVal.toString().trim().length()==0)?"":("+"+finalVal.toString()),Integer.valueOf(behaviors.size()));
		return showNumber;
	}