Page 2 of 2

Re: Mudlet help

Posted: 13 Jun 2017 01:28
by Tarax the Terrible
Looking for a mudlet function similar to what #colorword did in zmud.

Screenshot of an example set of colour triggers from my zmud settings.
You can see it was pretty simple. the @colourLevelX were variables I set.

I have searched for an answer and the closest I can find is deleting the line, but since I was only colouring the start of the line deleting it all wouldn't be ideal.

Any suggestions?

Code: Select all

You can also add color to your new lines with these functions.
In Cmud: #cw or %ansi
Example
Pattern:
^~(guild~)
Script:
#cw blue

The cw stands for color word. Also note the tildes is to keep cmud from thinking its part of a script and you want it to fire only when you see (guild) exactly.

For %ansi you could use;

Pattern:
^You have regained balance on all limbs.$
Script:
#sub {%ansi(white)Balance gained: %ansi(yellow) ALL LIMBS}

This would make it to where you'd no longer see You have regained balance on all limbs. And instead you'd see.
(in white) Balance gained:(in yellow) ALL LIMBS.

For mudlet the function is the same as deleting it above but putting cecho("") with it as well
Pattern:
^You have regained balance on all limbs.$
Script:
selectString(matches[1], 1)
deleteLine()
cecho("/nBalance gained:ALL LIMBS")

This is the mudlet equivalent of the cmud example above. Also note the \n makes it to where it appears on its own line.

PS Just noticed I probably had seriously beats and soundly beat the wrong way around in the order.

Re: Mudlet help

Posted: 13 Jun 2017 01:40
by Tarax the Terrible
Think this function might be the answer.
http://wiki.mudlet.org/w/ColorAll

Is there a way to set it up so I can just call the function instead of having to include it in full for each trigger?

Code: Select all

function colorAll(word, color, back, italic, under,bold, noCase)
--word is the string to search for
--color is fg color, either in name or "r,g,b" string
--back is bg color, either in name of "r,g,b" string
--italic is boolean italics
--under is boolean underlining
--bold is boolean bold format
--noCase is boolean. if true, matches word on a no-case pattern
 
   if noCase then word = word:genNocasePattern() end
   local startpos = 0
   local endpos = 0
   while true do
      startpos, endpos = string.find(getCurrentLine(), "%f[%w]"..word.."%f[%W]", endpos)
      if not startpos then break end
      selectSection(startpos-1, endpos-startpos+1)
      if color then
         if color_table[color] then
            fg(color)
         else
             local c = color:split(",")
             setFgColor(c[1],c[2],c[3])
         end
      end
      if back then
         if color_table[back] then
            bg(back)
         else
             local b = back:split(",")
             setBgColor(b[1],b[2],b[3])
         end
      end
      if under then
         setUnderline(true)
      end
      if italic then
         setItalics(true)
      end
      if bold then
         setBold(true)
      end
   end
end

Re: Mudlet help

Posted: 13 Jun 2017 02:02
by Tarax the Terrible
I can get it to work, but it is a bit ugly having all that script in each trigger?
Trigger is that function then calling it.

Re: Mudlet help

Posted: 13 Jun 2017 07:14
by Zugzug
Tarax the Terrible wrote:I can get it to work, but it is a bit ugly having all that script in each trigger?
Trigger is that function then calling it.
It may not be a "coded" trigger, but I do this:

http://prntscr.com/fj41jg

Notice the checkmark in bottom right section - "Highlight"

Whenever I encounter a new form of saying (like the minstrels) and especially one that changes from time to time, I just point my halberd at the person and politely ask them to sing 20-30 lines of "Aaaa-aaaa-aaa" for me. I believe the number of substrings you can trigger like that from one trigger is unlimited.

Re: Mudlet help

Posted: 13 Jun 2017 09:05
by Shanoga
Tarax,

I'm not sure exactly which color thing you are working on right now, but I am using the attached trigger to add some color to conversations. I still need to add a lot of conversation types...

I just took a few minutes and made a really ugly attempt at an exit highlighter that uses what looks to be a lot less code.

Re: Mudlet help

Posted: 13 Jun 2017 13:20
by Tarax the Terrible
Zugzug wrote:
Tarax the Terrible wrote:I can get it to work, but it is a bit ugly having all that script in each trigger?
Trigger is that function then calling it.
It may not be a "coded" trigger, but I do this:

http://prntscr.com/fj41jg

Notice the checkmark in bottom right section - "Highlight"

Whenever I encounter a new form of saying (like the minstrels) and especially one that changes from time to time, I just point my halberd at the person and politely ask them to sing 20-30 lines of "Aaaa-aaaa-aaa" for me. I believe the number of substrings you can trigger like that from one trigger is unlimited.
I am working on the colours for normal hits.
you barely scrape up to hammer etc.

lol the highlight option is nice and simple, dumb that I missed that! Will be able to use that for the majority of what I am looking for. Tho I do like underlining the top level hits.

Re: Mudlet help

Posted: 13 Jun 2017 21:02
by Tarax the Terrible
I talked to the guys on the mudlet discord. Found out if you have a function declared in a script you can just call it in aliases and triggers. That is pretty dang cool.

Re: Mudlet help

Posted: 01 Jul 2017 21:59
by Makfly
I downloaded the client very recently to see if it wasn't time to ditch my old zMud for something a little more up to date. I really liked the layout of this setup, although I would like a tab'ed chatwindow as well.
Image

I downloaded all the packages on the pbworks site, but they didn't really add up to something as nifty as the above.
Does anyone have a package or group of packages that could make Mudlet look like the setup above including a tab'ed chatwindow?
Or if it can be done with just the ones shared on the pbworks site, then maybe some directions on how to set it up :-)

Re: Mudlet help

Posted: 01 Jul 2017 23:46
by Tarax the Terrible
The main thing that looks nifty above is the hairetikos-panel.
I didn't put it on pbworks yet cus there is a TON of other stuff included that are more personal aliases and triggers.
It is from the "for genesis" file shared on the forum.

Attached the file here again

Re: Mudlet help

Posted: 02 Jul 2017 11:02
by Makfly
Tarax the Terrible wrote:The main thing that looks nifty above is the hairetikos-panel.
I didn't put it on pbworks yet cus there is a TON of other stuff included that are more personal aliases and triggers.
It is from the "for genesis" file shared on the forum.

Attached the file here again
Thank you. I'll try it out and see if I can get it working. One of the main things I guess, is how to resize and move things around some.

Also if it does have a lot of person things in it, maybe we can sift those things out and save a new package that can be shared instead?