I've been working on porting over all my Mush scripts to Mudlet, and so far, I've been pretty pleased. Everything's more or less worked with just some minor tweaks, and I really like the look of the client.
One of my favorite highlights though I'm not sure how to go about making happen in mudlet. Basically, I just want the contents of my 'target' variable to be highlighted whenever it's displayed. I remember this was a little tricky in Mush, but I got it to work, and what I did I'm not able to just 'port' over.
I'd appreciate any help... thanks!
Variable Contents as a Trigger
Re: Variable Contents as a Trigger
Little trick here too, see http://mudlet.git.sourceforge.net/git/g ... ing-howtos
Re: Variable Contents as a Trigger
Got it, thanks Vadi.
One more hopefully quick question, didn't think it warranted it's own topic... I can't get newlines after the prompt to work properly for me, I've played with a number of the settings to no avail.
Here's what I'm getting... various lines, especially room titles are displaying on the same line as the previous prompt. I even tried echoing a newline in my prompt trigger, but it would actually get sent _after_ the room title, which seemed really odd. An example, I added an "echo("hi\n") first thing in my prompt trigger, and this is what I would get:
Here's what I'm just seeing otherwise:
One more hopefully quick question, didn't think it warranted it's own topic... I can't get newlines after the prompt to work properly for me, I've played with a number of the settings to no avail.
Here's what I'm getting... various lines, especially room titles are displaying on the same line as the previous prompt. I even tried echoing a newline in my prompt trigger, but it would actually get sent _after_ the room title, which seemed really odd. An example, I added an "echo("hi\n") first thing in my prompt trigger, and this is what I would get:
Code: Select all
6380h, 5538m, 21900w cexkdb-The mines of Moghedu. (Moghedu)hi
Code: Select all
Code: Select all
6380h, 5538m, 21900w cexkdb-The mines of Moghedu. (Moghedu)
An enormous cavern carved into the surrounding stone creates the immediate surroundings. From the ceiling, huge, thick stalactites hang down almost
halfway to the ground, the girth at their tops as big as the ancient trees in the Aalen. Mining tools are propped against the walls. The ends of the
picks are jabbed into the ground and their handles jut up in odd angles, casting strange shadows about the huge cavern walls. Several dirty mining
carts stand here, empty of the precious ores they contain during their daily work. Two sets of railtracks dip down steeply into the murky depths
directly ahead.
You see exits leading south and down.
6380h, 5538m, 21900w cexkdb-
6218h, 5566m, 21900w cexkdb-
Re: Variable Contents as a Trigger
Looks like you are using a proxy client like Mudbot for a mapper probably. You have to configure Mudbot to properly forward telnet GA events. There is an option somewhere.
Re: Variable Contents as a Trigger
I'm using Vadi's mapper on Achaea. Not sure what I'd need to config with it. I've been using the same setup with Mush for quite a while, and never had an issue with newlines.
Re: Variable Contents as a Trigger
ok, so I tried your workaround for variable highlighting and I have one small issue with it: it only highlights the first capture of the variable.
I would like it to be recursive through the entire line, highlighing each occurance of the captured variable. Any ideas?
I would like it to be recursive through the entire line, highlighing each occurance of the captured variable. Any ideas?
Re: Variable Contents as a Trigger
Not difficult. You can loop through all matches of your target on the current line with while selectString(target, numofmatch+1) > -1 then highlight.
Re: Variable Contents as a Trigger
Ok, so try as I might, I can't seem to get this code to work in a tempTrigger. Think you could post some more specific code to make this work directly from a temp trigger?
Re: Variable Contents as a Trigger
I'd really like to see this functionality in Mudlet.
As it stands, I have a trigger in MUSHclient that matches a variable.
Match: \b(!@enemies)\b
Color: red
Regex: y
Enemies Variable: 1800 names(words) separated by |
Running that trigger with Mushclient, it outputs and highlights correctly the full list of 1800 names, in less than a second.
Attempting the same trigger on Mudlet:
Match:\b (list of names)\b
Type: Regex
Color: Red
To color the entire list of 1800 names, it took mudlet :
From 00:36:47.215 to 00:39:12.379
I tried doing a log with the replay function, but without the trigger enabled it just pops up like normal, and doesn't show how long it ACTUALLY took for the output to be processed.
As it stands, I have a trigger in MUSHclient that matches a variable.
Match: \b(!@enemies)\b
Color: red
Regex: y
Enemies Variable: 1800 names(words) separated by |
Running that trigger with Mushclient, it outputs and highlights correctly the full list of 1800 names, in less than a second.
Attempting the same trigger on Mudlet:
Match:\b (list of names)\b
Type: Regex
Color: Red
To color the entire list of 1800 names, it took mudlet :
From 00:36:47.215 to 00:39:12.379
I tried doing a log with the replay function, but without the trigger enabled it just pops up like normal, and doesn't show how long it ACTUALLY took for the output to be processed.
Re: Variable Contents as a Trigger
@Rakon - If you make the variable a table where each entry is a name then you could do the following:
That should output the contents of your enemies variable separated by commas, and since you don't need to use regexp matching it should be alot quicker.
Code: Select all
for i, name in ipairs(enemies) do
echo(name)
if i ~= #enemies then echo(", ") else echo(".") end
end