Need some help with your MUD client? Forgot your password? Get help here.
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.
-
Tarax the Terrible
- Myth
- Posts: 1331
- Joined: 09 Mar 2010 20:33
- Location: UK
Post
by Tarax the Terrible » 13 Jun 2017 01:28
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.
-
Attachments
-
- zmud cw.png (12.01 KiB) Viewed 3981 times
-
Tarax the Terrible
- Myth
- Posts: 1331
- Joined: 09 Mar 2010 20:33
- Location: UK
Post
by Tarax the Terrible » 13 Jun 2017 01:40
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
-
Tarax the Terrible
- Myth
- Posts: 1331
- Joined: 09 Mar 2010 20:33
- Location: UK
Post
by Tarax the Terrible » 13 Jun 2017 02:02
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 (118.08 KiB) Viewed 3980 times
-
- ugly.png (137.82 KiB) Viewed 3980 times
-
Zugzug
- Veteran
- Posts: 233
- Joined: 20 May 2017 15:25
Post
by Zugzug » 13 Jun 2017 07:14
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.
-
Shanoga
- Wizard
- Posts: 193
- Joined: 03 Mar 2014 13:03
- Location: US West
Post
by Shanoga » 13 Jun 2017 09:05
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 299 times
-
- Exit Colors.xml
- (1.45 KiB) Downloaded 280 times
-
Tarax the Terrible
- Myth
- Posts: 1331
- Joined: 09 Mar 2010 20:33
- Location: UK
Post
by Tarax the Terrible » 13 Jun 2017 13:20
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.
-
Tarax the Terrible
- Myth
- Posts: 1331
- Joined: 09 Mar 2010 20:33
- Location: UK
Post
by Tarax the Terrible » 13 Jun 2017 21:02
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.
-
Makfly
- Champion
- Posts: 615
- Joined: 04 Mar 2010 00:36
Post
by Makfly » 01 Jul 2017 21:59
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.
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
-
Tarax the Terrible
- Myth
- Posts: 1331
- Joined: 09 Mar 2010 20:33
- Location: UK
Post
by Tarax the Terrible » 01 Jul 2017 23:46
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 224 times
-
Makfly
- Champion
- Posts: 615
- Joined: 04 Mar 2010 00:36
Post
by Makfly » 02 Jul 2017 11:02
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
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/