PDA

View Full Version : RoomObj



LilWizzy
08-31-2009, 11:13 PM
I have been trying to figure out a way to detect items in a room like a cloud. What would be the proper form for this?

I have been trying
if RoomObj.loot {loot.name = "cloud"}

but I guess that is wrong. I keep getting a false positive. What is the correct way?

Deathravin
08-31-2009, 11:38 PM
if GameObj.loot.find { |looza| looza.noun == "cloud" } then put 'report I love tha cock' end

Deathravin
08-31-2009, 11:43 PM
But to be fair, you could just do checkloot.include?("cloud") for that one...
When you want to use GameObj's is for shit like this taken from my hunting script:

diskloot = GameObj.loot.find_all { |looz| looz.name !~ /#{checkname} disk$/ and looz.name =~ / disk$/ }
^^ Gives you an array with all the loot objects in the room with the name " disk", and that's NOT your disk.

or for stuff like this:
if GameObj.npcs.find { |npc| npc.status == "dead" }
^^ Gives you a single npc that's dead in the room.

LilWizzy
09-01-2009, 10:00 AM
Cool thanks. I'm still learning.