MU Soapbox

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Muxify
    • Mustard

    Cobalt's Housing Directory Object

    MU Code
    4
    8
    1755
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Cobalt
      Cobalt Tutorialist last edited by Cobalt

      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=INHERIT

      Three things you need to do to set up this code:

      1. 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).

      2. 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.

      3. 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.

      Thenomain 1 Reply Last reply Reply Quote 1
      • il-volpe
        il-volpe last edited by

        Fangs!

        "... you'll find the story doesn’t end how you think, and the most important characters aren’t who you expect.” - Penny 40 to Derek, The Magicians S04E07 ‘The Side Effect’

        1 Reply Last reply Reply Quote 0
        • Cobalt
          Cobalt Tutorialist last edited by

          Lemme know if it actually works. PennMUSH is different than tinymux.

          1 Reply Last reply Reply Quote 0
          • Thenomain
            Thenomain @Cobalt last edited by

            &F.HEADER Housing Directory=[center(ansi(h, | Housing List |), 78, ansi(%va, -))]

            They grow up so fast!

            ❤ ❤ ❤

            “If you wish to make an apple pie from scratch, you must first invent the universe.”
            ― Carl Sagan, Cosmos

            1 Reply Last reply Reply Quote 1
            • Cobalt
              Cobalt Tutorialist last edited by

              I thought you might like that. Thought of you when I did that bit. 😄

              I'm a real coder now. Arrr. And stuff.

              1 Reply Last reply Reply Quote 1
              • Highfalutin
                Highfalutin last edited by Highfalutin

                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)]
                
                1 Reply Last reply Reply Quote 0
                • Cobalt
                  Cobalt Tutorialist last edited by

                  stares blankly at code I made this?

                  Highfalutin 1 Reply Last reply Reply Quote 2
                  • Highfalutin
                    Highfalutin @Cobalt last edited by

                    @cobaltasaurus You DID.

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post