Stupid Robutler

Continuing from Steven Granade’s excellent I7 tutorial. Here’s Robutler, a robot who follows you everywhere:

Every turn: if Robutler is not visible begin; move Robutler to the location of the player; say "Robutler rattles into the room, following you."; end if.
Robutler faithfully follows the player from room to room. When my player falls asleep and gets teleported to a room called Dream:Instead of entering the bed: say "You climb into bed. You drift gradually (etc etc) something here, somehow, is horrib-[paragraph break]"; move the player to the Dream.
Robutler is there. While I respect his dedication, I’d rather he sat this one out. But I am completely unable to teleport Robutler to another place or prevent him from entering the Dream room. No combination of if’s unless’s or otherwise’s seems to be able to get it done. It seems like there’s a very very simple rule I should be able to write, and though I am frustrated I’d also be grateful to anyone with a solution.

What about changing “if Robutler is not visible” in the every turn rule to “if Robutler is not visible and the location is not the Dream”? (Note that “the location” is short for “the location of the player.”) That seems like it should keep him out of the Dream room–if there’s more than one room you want to keep him out of it could get a little more complicated.

You are the man, matt w, ‘location’ was the answer. I intend to kill Robutler eventually, but that’s another day. Thanks, I promise not to clog up this board with questions!

If the places robutler should not go are classed as one area, that might work?

if robutler is not visible and the player is not in [i]area[/i] begin?

Powerfulwizard, I for one would encourage you to put up questions, thinking about other peoples queries, and reading the answers that the clever people here put up, helps my understanding of I7 :slight_smile:

Or have a variable. Maybe the player can be asleep of awake. Every turn, if Robutler is not visible and the player is awake, perform the robot code.

See? There are many ways to solve a problem in I7, depending on how your mind works, and they’re all just as good as one another. :slight_smile: