MU Soapbox

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

    Hook Help

    MU Code
    4
    9
    2158
    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.
    • skew
      skew last edited by

      Yes, I'm still beating this drum, because I'm still struggling. Sorry and thank you.

      I'm using TinyMUX. @Thenomain has told me he believes there's a way to have hook_cmd not only handle the before/after stuff, but also pass the data that is being sent in the hook through the hook object. I see there is a @hook/ARGS command, but I cannot seem to process how that works.

      What I'm looking to do is have a built-in command (such as pose), take everything that comes after 'pose' and ultimately store it on an object. This will ultimately be a means of pose logging. I had previously been told to set the hook_cmd to ignore the command (pose) and instead soft-code a 'pose' command. This might be a better way?

      What I'm trying to accomplish, in the simplest of examples, is this:

      &B_POSE @hook object <ho>=[pemit( *skew, %0)]

      I tried turning on @hook/args, I tried %1 instead of %0 ... Am I missing something obvious here?

      Ashen-Shugar 1 Reply Last reply Reply Quote 0
      • Ashen-Shugar
        Ashen-Shugar @skew last edited by Ashen-Shugar

        @skew

        I've honestly not done much with MUX's /args hook. Honestly I was not even aware of it. The help on it is not only.. minimal... it's practically worthless.

        To use the ARGS portion of MUX's hooks, you have to use a prefix of R_ before the attribute. So like R_pose to do ARGS processing on pose.

        And as the help was absolutely worthless to point this out, I had to dig into the source code to find that 🙂

        Also, I don't care much for how it's designed, and I don't think it buys much.

        What I personally would do is use %m for the last command the person typed and use that in the A_pose.

        if someone typed:
        pose scratches their head.

        The %m would be 'pose scratches their head'.

        So you would use rest(%m) for the string after 'pose'

        If you also want to hook on ':' and ';' I would alter the hook for A_POSE and B_POSE to be something like oh....

        [ifelse(member(; :,mid(%m,0,1)),delete(%m,0,1),rest(%m))]

        Good luck!

        Thenomain 1 Reply Last reply Reply Quote 1
        • Thenomain
          Thenomain @Ashen-Shugar last edited by Thenomain

          @Ashen-Shugar said in Hook Help:

          use %m for the last command the person typed

          HAH! I was right! (Also, entirely guessed.)

          edit to note: I didn't have any problems finding 'b_', 'a_', etc., in the help files. I do note that sometimes coders will throw their hands up and look into source code to get the answer to what's in their heads, because damn, coders be coders.

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

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

            @Thenomain There's mention of /args in the '@hook' help, but not in the 'hook setup' help. I found somewhere online someone mentioned at 'hook setup3' which I do not have in my version of TinyMUX. In brief, the help for it simply doesn't exist in my version.

            @Ashen-Shugar That's awesome. Exactly what I needed, thank you. And yes, it is what Thenomain said, but his brain is old and leaky and he couldn't remember it.

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

              @skew

              I completely remembered it. While tired. And sick. And not anywhere near a login. And having played video games all day. I hope you're that capable when you're thirty, like me.

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

              Ashen-Shugar skew Derp 3 Replies Last reply Reply Quote 1
              • Ashen-Shugar
                Ashen-Shugar @Thenomain last edited by

                @Thenomain said in Hook Help:

                @skew

                I completely remembered it. While tired. And sick. And not anywhere near a login. And having played video games all day. I hope you're that capable when you're thirty, like me.

                The answer of course is orange.

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

                  @Thenomain I am thirty (one). >=|

                  Ashen-Shugar 1 Reply Last reply Reply Quote 0
                  • Derp
                    Derp Admin @Thenomain last edited by

                    @Thenomain said in Hook Help:

                    @skew

                    I completely remembered it. While tired. And sick. And not anywhere near a login. And having played video games all day. I hope you're that capable when you're thirty, like me.

                    I'll be 31 soon, and dude, I can't even remember where I put my keys most days. Color me impressed.

                    Racism isn't Tinkerbell. It doesn't need you to believe in it for it to exist.

                    1 Reply Last reply Reply Quote 0
                    • Ashen-Shugar
                      Ashen-Shugar @skew last edited by

                      @skew said in Hook Help:

                      @Thenomain I am thirty (one). >=|

                      My nieces are older than you... all three of them. 🙂

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