private String msgchk(String chk, String msg) throws InterruptedException, FileNotFoundException, UnsupportedEncodingException{
        	String broken[];
    		
        	if (chk.endsWith(ghosts)){
        		ghost=1;
        	}
        	if (chk.endsWith(nonstop)){
        	  if (cnt == 0){
            	dataOut.print("n\b");
    			dataOut.flush();
        	  }
        	  cnt++;
        	}
     		if (chk.endsWith("Room error")){
     			return "Room error";
     		}
     		if (msg.endsWith("just entered the Realm.")){
     			broken=msg.split(" ");
            	for (int i=0;i<broken.length;i++ ) {
            		if (broken[i].equals("just")){
            			player=broken[i-1];
            		}
            	}
                GosLink.gb.enter(player.trim(),mynum);
     		}
            if (chk.endsWith(hangup)){
            	GosLink.dw.append("BBS shutdown detected!");
            	loggedin=0;
            	return "!OffLINE+02";
            }
            return null;
        }