def look_at_obj(self, objecttype):
    # Check if the agent is already holding an object of the given type
    if self.name2type(self.holding) != self.name2type(objecttype):
        # Find the object with the given objecttype
        entity = self.find_object(objecttype)
        if entity is None:
            # If the object is not found, explore the environment to find it
            self.explore()
            return
        else:
            # Go to the receptacle where the object is located
            self.goto(entity.in_on)
            r_entity = self.seen_entitys[entity.in_on]
            # If the receptacle is openable and not open, open it
            if r_entity.openable and not r_entity.isopen:
                self.open_receptacle(r_entity.name)
            # Take the object
            self.take(entity.name, entity.in_on)
    else:
        # If the agent is already holding the object, proceed to the next step
        pass

    # Now, find a desklamp to turn on and examine the object
    desklamp = self.find_receptacle('desklamp')
    if desklamp is None:
        # If no desklamp is found, explore the environment
        self.explore()
        return
    else:
        # Go to the desklamp
        self.goto(desklamp.name)
        # Turn on the desklamp
        self.turn_on(desklamp.name)
        # Now the object can be examined under the light
        # (Assuming the examination is implicit and no further action is needed)
        return