function findpalindromes(array)
local words = {}
for word in string.gmatch(array, "%a+") do
if word == string.reverse(word) then
table.insert(words, word)
end
end
return words
end
I did try to put it in code tags, but it seems clicking the icon has absolutely no effect and the usual [code] and [/code] does not apply here. Meh. Silly new forums.
Comments
Here is my cleaner linked vials script for Mudlet: cleaner linked vials.
This formats your linked vials to take up less horizontal space as well as look much neater when viewing them via "info inventory". I use this on a wrapwidth of 80. It will cost you one additional line per linked vial.
I updated my cleaner linked vials. It will handle more cases now (such as quicksilver), and keeps it the display consistent (removing a/an). To keep the links more visible I added a hyphen before each one, but if you don't like it you can easily change it in the code, just make sure you do both the gate and the chain.
Here is the new link: cleaner linked vials v2 .
Feel free to message me in the game or over the forums with whatever line happens to break display!
Fixed! Forced it to match as a whole word. I struggle a bit with regular expressions, but I usually get what I need
New link: cleaner linked vials v3.
The limited edit time makes for this to be kind of messy, I think.
I've updated my cleaner linked vials! It now captures up to 6 lines when a link has been detected (for those who are using a fesix bandolier), and I improved trigger to be easier on the client for those already have a lot going.
Cleaner linked vials v4function noMove(_, direction)
local directions, exits, move
move = {
n = "n",
ne = "ne",
e = "e",
se = "se",
s = "s",
sw = "sw",
w = "w",
nw = "nw",
u = "u",
d = "d",
["in"] = "in",
out = "out",
north = "n",
northeast = "ne",
east = "e",
southeast = "se",
south = "s",
southwest = "sw",
west = "w",
northwest = "nw",
up = "u",
down = "d",
}
directions = {
"n",
"north",
"ne",
"northeast",
"e",
"east",
"se",
"southeast",
"s",
"south",
"sw",
"southwest",
"w",
"west",
"nw",
"northwest",
"u",
"up",
"d",
"down",
"in",
"out"
}
exits = gmcp.Room.Info.exits
local go = move[direction]
if table.contains(directions, direction:lower()) and not exits[go] then
cecho("\n<red>Can't go that way dummy. Try again!")
denyCurrentSend()
end
end
Could probably have been done better, but I'm sick, so whatever.
Signature!
Will try and add in a fix when I can.
Edit: Ok, fixed.
function noMove(_, direction)
local directions, exits, move
move = {
n = "north",
ne = "northeast",
e = "east",
se = "southeast",
s = "south",
sw = "southwest",
w = "west",
nw = "northwest",
u = "up",
d = "down",
["in"] = "in",
out = "out",
north = "north",
northeast = "northeast",
east = "east",
southeast = "southeast",
south = "south",
southwest = "southwest",
west = "west",
northwest = "northwest",
up = "up",
down = "down",
}
directions = {
"n",
"north",
"ne",
"northeast",
"e",
"east",
"se",
"southeast",
"s",
"south",
"sw",
"southwest",
"w",
"west",
"nw",
"northwest",
"u",
"up",
"d",
"down",
"in",
"out"
}
exits = getRoomExits(gmcp.Room.Info.num)
local go = move[direction]
if table.contains(directions, direction:lower()) and not exits[go] then
cecho("\n<red>Can't go that way dummy. Try again!")
denyCurrentSend()
end
end
Bluh, current version errors in manses unless you've mapped them and trying to fix it will take a bit. Anyone wanting to take a shot at it can.
Signature!
if tonumber(matches[2]) < tonumber(matches[3]) then
hypotenuse = tonumber(matches[3])
leg = tonumber(matches[2])
else
hypotenuse = tonumber(matches[2])
leg = tonumber(matches[3])
end
local sqrt = hypotenuse^2 - leg^2
local n = math.sqrt(sqrt)
echo("\n"..n)
Using Mudlet and M&MF.
I want to be able to add 10 whitetea, amalgamate whitetea, and once mm.bals.equilibrium is reached, get whitetea from alembic. My thoughts are to use this as an alias, or loop, so that I am not constantly typing all three commands, but rather running a script to hand them for me, as long as I have the commodities.
Has anybody created such a looper? I have been toying with ideas, but im not really getting any closer, so thought id ask. I am relearning LUA again, so falling short on what I used to know.
sm add outr 10 whitetea|add 10 whitetea|amalgamate whitetea
sm add get 10 whitetea from alembic
Otherwise, there is, if you read up on m&mf's documentation (http://m-mf.github.io/m-mf/) a way to use m&mf's queuing system using mm.doadd, something like this maybe:
mm.doaddfree("outr 10 whitetea")
mm.doaddfree("add 10 whitetea)
mm.doadd("amalgamate whitetea")
mm.doadd("get 10 whitetea from alembic")