This code allows the player to set the remote object with a code,
place it in a room and then look into the room from another location.

Commands:
remote set <obj name> <number code>
remote connect <the code>

You must create a object type remote and add the command remote to
the interp files.

/********************************************************************
*       Remote units v1.0
*  	Designed by Dex for the Metaverse Project.		    *
*	dex@meta.mudservices.com				    *
*	http://meta.mudservices.com				    *
*	No fancy copyrights, you most likely know the drill	    *
********************************************************************/
void do_remote(CHAR_DATA *ch, char *argument)
{
    char arg[MAX_INPUT_LENGTH];
    char arg2[MAX_INPUT_LENGTH];
    char arg3[MAX_INPUT_LENGTH];
    OBJ_DATA *obj_next;
    OBJ_DATA *obj;
	int code, location;

    argument = one_argument( argument, arg);
    argument = one_argument( argument, arg2);
    argument = one_argument( argument, arg3);

    if ( arg[0] == '\0')
    {
	send_to_char( "Remote set <remote> <code> or remote connect <code>.\n\r", ch );
	return;
    }

    if ( !str_prefix( arg, "set" ) )
	{
    if ( ( obj = get_obj_carry( ch, arg2, ch ) ) == NULL )
    {
	send_to_char( "You do not have that item.\n\r", ch );
	return;
    }

	if (obj->item_type != ITEM_REMOTE)
	{
	send_to_char( "You need to have a remote unit.\n\r", ch );
	return;
	}

    if ( arg3[0] == '\0')
    {
	send_to_char ("Which code ?\n\r", ch);
	return;
    }

	code = atoi (arg3);
	obj->value[0] = code;
	obj->owner == ch->name;
	send_to_char ("Remote coded and ready for use.\n\r", ch);
	return;
	}

	code = atoi(arg2);
	location = ch->in_room->vnum;
    if ( !str_prefix( arg, "connect" ) )
	{
	for ( obj = object_list; obj != NULL; obj = obj->next )
	{
		obj_next = obj->next;

	if (obj->value[0] == code)
	{
		if (obj->value[0] == 0)
		{
		send_to_char ("Invalid code.\n\r", ch);
		return;
		}


		if (obj->in_room == NULL)
		{
		send_to_char ("You see nothing.\n\r", ch);
		return;
		}

		char_from_room (ch);
		char_to_room (ch, obj->in_room);
		do_look (ch, "auto");
		char_from_room (ch);
		char_to_room (ch, get_room_index(location));
		return;
	}
	}
	send_to_char ("You get no response on this connection.\n\r", ch);
	return;
	}
}