Help - Search - Members - Calendar
Full Version: Random Illusioning In Mush
Achaea's Forums > Off-Topic > Tech Support > Client Help
revolg
So, I've been trying for awhile to get this to work. Apparantly I'm not very good with MUSH.

I wanna make an alias, say, IL KELP that will choose from a list of kelp illusions and pick a random one to send.

Any ideas?
Pernicios
QUOTE (revolg @ Apr 18 2009, 01:47 PM) *
Any ideas?


Never randomize your illusions.

Edit: The question mark made it seem like more of a question, and less of a fact.
Soludra
Can't believe I'm going to help revolg... dry.gif

I'm not sure if this will work, because I haven't tested it, but it should. Put this text in your script file:

CODE
illusions = {
             ["kelp"] = {"illusion 1",
                         "illusion 2",
                        },

             ["bloodroot"] = {"illusion 1",
                              "illusion 2",
                             },
            } -- illusions

math.randomseed(os.time())



And this should be an alias. (Check the regular expressions checkbox)
CODE
Alias: ^\s*IL\s+([:alnum:]+)\s*$

Send:

if illusions["%1"] and #(illusions["%1"]) > 0 then
  rand = math.random(#(illusions["%1"]))
  Send(illusions["%1"][rand])
else
  Note("No such illusion group")
end


It should be pretty obvious how to add new illusions and illusion groups in the script file.
Dexodro
QUOTE (Soludra @ Apr 18 2009, 06:53 PM) *
Can't believe I'm going to help revolg... dry.gif



You don't like Revolg? I love Revolg.

QUOTE (Pernicios @ Apr 18 2009, 06:37 PM) *
QUOTE (revolg @ Apr 18 2009, 01:47 PM) *
Any ideas?


Never randomize your illusions.

Edit: The question mark made it seem like more of a question, and less of a fact.


I made a random-illusion plaything to learn more about lua. It worked, in the end. I was very pleased, although Trevize showed me where I was going wrong. Random stuff like that is -great- on learning new things on a language that's still mysterious.
revolg
It works now. Yay.

Also, some amount of variety is definitely beneficial to illusions when you just want to make someone eat a certain herb. You could achieve this through memorizing several different macros for a set of kelp illusions, or by randomly picking from a set. I'd rather choose the second, because I already have too many. As long as you know they mostly all work, you only lose a little effectiveness.

And what has Revolg done to you, Soludra wink.gif
Soludra
I... honestly can't remember. I'm too lazy to grep through my logs, either.
revolg
QUOTE (Soludra @ Apr 19 2009, 12:16 AM) *
I... honestly can't remember. I'm too lazy to grep through my logs, either.


I didn't do much as a Paladin. It was probably from then lol.

Thank you for the help with the script.
Soludra
Welcome. smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.