View unanswered posts | View active topics It is currently 21 Jan 2018 12:46

Forum rules


- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.



Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
Mudlet help 
Author Message
Myth
User avatar

Joined: 09 Mar 2010 20:33
Posts: 1331
Location: UK
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:
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.


Attachments:
zmud cw.png
zmud cw.png [ 12.01 KiB | Viewed 1310 times ]

_________________
http://genesisquests.pbworks.com/
Join up and help each other with Quests :)
13 Jun 2017 01:28
Profile
Myth
User avatar

Joined: 09 Mar 2010 20:33
Posts: 1331
Location: UK
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:
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

_________________
http://genesisquests.pbworks.com/
Join up and help each other with Quests :)


13 Jun 2017 01:40
Profile
Myth
User avatar

Joined: 09 Mar 2010 20:33
Posts: 1331
Location: UK
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.


Attachments:
ugly 1.png
ugly 1.png [ 118.08 KiB | Viewed 1309 times ]
ugly.png
ugly.png [ 137.82 KiB | Viewed 1309 times ]

_________________
http://genesisquests.pbworks.com/
Join up and help each other with Quests :)
13 Jun 2017 02:02
Profile
Wanderer

Joined: 20 May 2017 15:25
Posts: 60
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.


13 Jun 2017 07:14
Profile
Wizard
User avatar

Joined: 03 Mar 2014 13:03
Posts: 88
Location: US West
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.


Attachments:
Conversation Colors.xml [1.39 KiB]
Downloaded 31 times
Exit Colors.xml [1.45 KiB]
Downloaded 29 times
13 Jun 2017 09:05
Profile
Myth
User avatar

Joined: 09 Mar 2010 20:33
Posts: 1331
Location: UK
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.

_________________
http://genesisquests.pbworks.com/
Join up and help each other with Quests :)


13 Jun 2017 13:20
Profile
Myth
User avatar

Joined: 09 Mar 2010 20:33
Posts: 1331
Location: UK
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.

_________________
http://genesisquests.pbworks.com/
Join up and help each other with Quests :)


13 Jun 2017 21:02
Profile
Champion

Joined: 04 Mar 2010 00:36
Posts: 581
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 :-)

_________________
Mortimor Makfly - Gnomish Xeno-Anthropologist


01 Jul 2017 21:59
Profile
Myth
User avatar

Joined: 09 Mar 2010 20:33
Posts: 1331
Location: UK
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


Attachments:
For_Genesis_20130329b1.xml.zip [28.53 KiB]
Downloaded 33 times

_________________
http://genesisquests.pbworks.com/
Join up and help each other with Quests :)
01 Jul 2017 23:46
Profile
Champion

Joined: 04 Mar 2010 00:36
Posts: 581
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?

_________________
Mortimor Makfly - Gnomish Xeno-Anthropologist


02 Jul 2017 11:02
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 20 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.