Cobalt's Housing Directory Object
-
This is an incredibly simple and not very fancy object to track who owns what 'ownable' builds on your grid. It requires that you set an 'ownable' attribute, and an 'owner' attribute, at the request of @il-volpe. I designed it for tinymux, so hopefully it'll actually work on Penn. (If it doesn, please let me know what errors you get so I can try and fix it.)
There are no fancy +commands to this code. It does run a search() of your grid, so if you have an insanely huge grid, it might cause some lag if you look at it all day long, every day.
(if somone could tell me how to change font to a more codey friendly way, I'd appreciate it but here's the code:)
-------------------------------| Housing List |-------------------------------
Limbo.........................Cobalt
Conference Room...............Tributary
Staff Lounge..................Cobalt
Newbie Room...................No one
Theno's Closet................Thenomain
| 5 Housing Builds On Grid |--------------------------------------------------@create Housing Directory=10
&F.HEADER Housing Directory=[center(ansi(h, | Housing List |), 78, ansi(%va, -))]
@VA Housing Directory=<COLOR YOUR WANT>
&FIL.OWNABLE Housing Directory=hasattr(%0, ownable)
@VB Housing Directory=#<YOUR HOUSING OBJECT>
@Desc Housing Directory=[u(f.header)]%r[iter(filter(%vb/fil.ownable, search(type=room)), [ljust(name(%i0), 30, .)][if(hasattr(%i0, owner), name(get(%i0/owner)), No one)], , %r)]%r[u(f.footer)]
&F.FOOTER Housing Directory=[ljust(ansi(h, | [words(filter(%vb/fil.ownable, search(type=room)))] Housing Builds On Grid |), 78, ansi(%va, -))]
@set Housing Directory=INHERITThree things you need to do to set up this code:
-
after c/p that and make the object, set your va & vb. Va is your color code for your header/footer. It should be 'c' 'b' 'g' 'y' 'hx', etc. (e.g. &va=c) vb is the #dbref of your object. So whatever the number of the object set it as &vb housing=### (e.g. &vb housing=#59).
-
Make sure every room you want ownable has 'ownable' set on it. IT can be &ownable <thing>=1 or &ownable <thing>=piggletits. Doesn't matter just needs to be set.
-
Make sure every room that is /currently/ owned has &owner <thing>=THEIR #DBREF set. So for example: &owner limbo=#42.
Again I coded this on Tinymux, but I'll attempt to make it cross platform. Also, I highly suggest keeping this in your staff lounge or on your build staffers. Not because of privacy but because it does run a search on the game every time you look at the object.
When I have time I'll set up code that doesn't do this, that'll be more player friendly.
ETA: If a room is currently unowned but is ownable REMOVE the 'owner' tag. Make sure it is not there, don't set it as 'no one' or anything like that. Otherwise the code will see the attribute and get confused.
I'll also fix that later, but I either need to sleep or go do homework.
-
-
Fangs!
-
Lemme know if it actually works. PennMUSH is different than tinymux.
-
&F.HEADER Housing Directory=[center(ansi(h, | Housing List |), 78, ansi(%va, -))]
They grow up so fast!
-
I thought you might like that. Thought of you when I did that bit.
I'm a real coder now. Arrr. And stuff.
-
Another years later thread resurrection here, but, this is now my favorite thing. Quick command to tack onto the object:
&C.+HOUSING Housing Directory=$+housing:@pemit %#=[u(f.header)]%r[iter(filter(%vb/fil.ownable, search(type=room)), [ljust(name(%i0), 30, .)][if(hasattr(%i0, owner), name(get(%i0/owner)), No one)], , %r)]%r[u(f.footer)]
-
stares blankly at code I made this?
-
@cobaltasaurus You DID.