Mudlet Questions

by Rika

Back to Mechanic's Corner.

Fuyu2011-04-02 09:56:40
QUOTE (Janalon @ Mar 30 2011, 11:35 AM) <{POST_SNAPBACK}>
What's the latest Mac release? And when will 2.0 be available for Mac?


I'm using 2.0 on a Mac..and it's working for me.suspicious.gif

How do I center an echo?thanks.
Vadi2011-04-02 13:36:27
centering: http://forums.mudlet.org/viewtopic.php?f=8...nter+echo#p3253

2.0 release candidates: http://forums.mudlet.org/viewtopic.php?f=5&t=1874

geyser: it comes with examples, importing and looking at the demos could be a good start!
Fuyu2011-04-02 18:44:11
QUOTE (Vadi @ Apr 2 2011, 09:36 PM) <{POST_SNAPBACK}>
centering: http://forums.mudlet.org/viewtopic.php?f=8...nter+echo#p3253

2.0 release candidates: http://forums.mudlet.org/viewtopic.php?f=5&t=1874

geyser: it comes with examples, importing and looking at the demos could be a good start!


For some reason, I'm getting an error (I copied the last code posted in the forums, which was in your post). It says something along the lines of "then" expected near "posthilit" around line 32.
Sylphas2011-04-02 19:55:16
If you don't need it as fancy as that, this will left/right/center align the given text

CODE
if function align(txt, size, loc)
  local text = tostring(txt)
  local newline = false

  if text:sub(-1) == "\\n" then
    text = text:sub(1, -2)
    newline = true
  end

  if text:len() > size then
    text = text:sub(1, size)
  elseif text:len() < size then
    if loc == "left" then
      text = text .. string.rep(" ", size - text:len())
    elseif loc == "center" then
      text = string.rep(" ", math.floor((size - text:len()) / 2 )) .. text .. string.rep(" ", math.ceil((size - text:len()) / 2 ))
    elseif loc == "right" then
      text = string.rep(" ", size - text:len()) .. text
    end
  end

  if newline then text = text .. "\\n" end
  return text
end
Fuyu2011-04-02 20:04:35
QUOTE (Sylphas @ Apr 3 2011, 03:55 AM) <{POST_SNAPBACK}>
insert code here


Will I be able to use text colors?

And..was able to activate the code. Tried to edit my balance message but it doesn't seem to fire.

calign("\\n\\nBALANCE REGAINED", {cap = "<--------", mirror = true, spacer = " ", inside = false, capColor = "", textColor = ""})
Sylphas2011-04-02 20:52:39
QUOTE (Fuyu @ Apr 2 2011, 04:04 PM) <{POST_SNAPBACK}>
Will I be able to use text colors?

And..was able to activate the code. Tried to edit my balance message but it doesn't seem to fire.

calign("\\n\\nBALANCE REGAINED", {cap = "<--------", mirror = true, spacer = " ", inside = false, capColor = "", textColor = ""})


Sure. All my code does is pad it with spaces and truncate it if it's too long. You can do whatever you want with the string that's returned. You can do things like cecho("" .. align("Test string", 25, "center"))
Sylphas2011-04-02 21:11:08
QUOTE (Vadi @ Apr 2 2011, 09:36 AM) <{POST_SNAPBACK}>
centering: http://forums.mudlet.org/viewtopic.php?f=8...nter+echo#p3253

2.0 release candidates: http://forums.mudlet.org/viewtopic.php?f=5&t=1874

geyser: it comes with examples, importing and looking at the demos could be a good start!


EDIT: I'll just dig through the Geyser LUA code, the comments do a much better job of being reference documents than the official documentation.
Fuyu2011-04-02 21:18:26
QUOTE (Sylphas @ Apr 3 2011, 04:52 AM) <{POST_SNAPBACK}>
Sure. All my code does is pad it with spaces and truncate it if it's too long. You can do whatever you want with the string that's returned. You can do things like cecho("" .. align("Test string", 25, "center"))


thanks!
Vadi2011-04-02 22:14:52
QUOTE (Sylphas @ Apr 2 2011, 05:11 PM) <{POST_SNAPBACK}>
EDIT: I'll just dig through the Geyser LUA code, the comments do a much better job of being reference documents than the official documentation.


Both of them were written by guy, so... whatever works! It's Lua though.
Morshoth2011-04-05 07:03:59
Didn't see anything about this in here, but maybe I missed it.

Are there any add-ons for announcing who enters your demesne? I don't care if it announces non-enemies, I just want to be able to turn it on and off, and to have it group them all together instead of multiple clt messages... If not, can somebody help me? I can't code for beans, most I have is one that announces separately each person entering the demesne, and don't know how to turn it on and off.
Unknown2011-04-05 11:01:06
QUOTE (Morshoth @ Apr 5 2011, 04:03 AM) <{POST_SNAPBACK}>
Didn't see anything about this in here, but maybe I missed it.

Are there any add-ons for announcing who enters your demesne? I don't care if it announces non-enemies, I just want to be able to turn it on and off, and to have it group them all together instead of multiple clt messages... If not, can somebody help me? I can't code for beans, most I have is one that announces separately each person entering the demesne, and don't know how to turn it on and off.


I've been trying to set this up... (so if there was any help I'd be interested too)
Vadi2011-04-05 15:55:01
I made a trigger for Viynain that compresses the things... only problem is how would you like the on and off thing to work. An alias (what name?) or a button or keybinding?
Zynna2011-04-05 16:27:59
I'd be interested. Probably alias ... Dw on / dw off (demesne watch)

dwset clt# to set clan it announces on.
Neos2011-04-05 16:48:31
I has, can give, though the work involved in setting it up takes a variable amount of time if you have Anisus org highlighter or not. Does require gmcp to be on if you want the area to be also announced.
-points to demesne tracking script mentioned in mudlet plugins-
Can just adapt the spectacles announcer that Vadi made or take mines, though mines cost credits. 5 only. Doesn't matter which you choose to take to me.
Sylphas2011-04-05 17:15:28
Ooo, gmcp has area? Why didnt I know this? O_o.
Unknown2011-04-05 17:30:53
GMCP gives you an area name which may differ from what's in the XML, but it also gives you the numeric area ID as part of a URL field (for most areas).
Morshoth2011-04-05 18:21:47
QUOTE (Vadi @ Apr 5 2011, 03:55 PM) <{POST_SNAPBACK}>
I made a trigger for Viynain that compresses the things... only problem is how would you like the on and off thing to work. An alias (what name?) or a button or keybinding?


An alias preferably
Vadi2011-04-05 19:45:29
I'll assume you like Zynna's suggestion, because you skipped out the part about naming and such...
Vadi2011-04-05 19:46:00
QUOTE (Sylphas @ Apr 5 2011, 01:15 PM) <{POST_SNAPBACK}>
Ooo, gmcp has area? Why didnt I know this? O_o.


Because you never looked at lua display(gmcp)!
Lilia2011-04-05 20:58:48
I add the requested features to my demesne announcer, but for some reason I can't upload it. confused.gif It's not too complicated, so contact me in game, I guess. (Tulemrah, not Lillia)