Log in

View Full Version : People in the room



ThadJarvis
06-13-2010, 08:05 PM
Anyone able to give a quick example of how to iterate over the room list and perform some event if someone is present?

Thanks.

SanGreal
06-13-2010, 08:17 PM
GameObj.pcs.each{|dude|
if dude.noun == "Jarvis"
fput "say 'Sup #{dude.name}"
end
}


or



if checkpcs.include?("Jarvis")
echo "Get him!"
end


or



if GameObj.pcs.find{|pc| pc.noun == "Jarvis"}
echo "Jarvis is here!"
end


Take your pick I guess

ThadJarvis
06-13-2010, 08:27 PM
Thank you very much.

pabstblueribbon
06-13-2010, 09:01 PM
checkpcs("Whoever")

Works too.

ThadJarvis
06-14-2010, 10:39 AM
Can you do wait_while { !checkpcs "Thad" } ?

I would try it, but I only have access to a smartphone right now lol