Mushclient Questions

by Esano

Back to Mechanic's Corner.

Ayisdra2009-06-18 05:19:01
QUOTE (Dynami @ Jun 18 2009, 12:41 AM) <{POST_SNAPBACK}>
I am having trouble finding a compass plug-in for MUSH. I remember hearing of one, but I can't find it on the forums. Can anyone direct me to where I can find it? Thanks!


http://forums.lusternia.com/index.php?showtopic=8903
Everiine2009-06-18 05:36:15
I know this is out there somewhere, but it's late, I'm tired, and my eyes already hurt.

I have MUSH highlight my targets. So if I set my target as "sandojin", "sandojin" appears in bright yellow letters. Is there a way that, when I set my target as "sandojin", it will not only highlight "sandojin", but also "sandojins"?
Unknown2009-06-18 11:11:25
You can alter your pattern to add the optional 's' at the end of the word, but that obviously only works for the one plural case (i.e., not wolves or platypuses). If you can live with that, then your new pattern would be "\\b(@!target)s?\\b".
Everiine2009-06-18 16:28:19
QUOTE (Zarquan @ Jun 18 2009, 07:11 AM) <{POST_SNAPBACK}>
You can alter your pattern to add the optional 's' at the end of the word, but that obviously only works for the one plural case (i.e., not wolves or platypuses). If you can live with that, then your new pattern would be "\\b(@!target)s?\\b".

Thanks! thumup.gif

Now, uh, what if I did want it to highlight wolf and wolves? Not that I have a need to right now, but I figure it can't hurt to be more informed : halo.gif .
Unknown2009-06-18 17:26:19
It'd be tricky, definitely. You wouldn't want to just match on every word and then check in your function whether or not you need to change the style or keep the existing one. You'd probably end up making a few triggers with exceptions and then enabling them from your targeting alias as needed.
Shaddus2009-06-19 02:56:10
I lost a bunch of my hand made triggers that someone walked me through. I had a large amount of my defs set to where (for instance) instead of showing "Your blood is clotting by the power of Kingdom" it would omit that, and instead show {Kingdom} in a colour I set into the trigger. I know it's colournotes, but how do I go about doing that?

I'm also looking to replace the "You have regained equilibrium" message with something, how would I do that?
Ayisdra2009-06-19 03:49:18
I want to spilt a series of characters and numbers and place these into an Array that I read from a table. So say my table reads out
CODE
"Type"="potion"
"Cost"="2 percent power"
"Herbs"="8 galingale 2 sargassu 1 juniper 1 yarrow"


I want to place the 'Herbs' into the Array. So the 8 would be in index 0, galingale in index 1, 2 in index 2 and so on.

How would I go about doing this. (and another, not really that important, question: Do Lua arrays start at index 0?)
Unknown2009-06-19 05:23:20
QUOTE (Shaddus Mes'ard @ Jun 18 2009, 10:56 PM) <{POST_SNAPBACK}>
I lost a bunch of my hand made triggers that someone walked me through. I had a large amount of my defs set to where (for instance) instead of showing "Your blood is clotting by the power of Kingdom" it would omit that, and instead show {Kingdom} in a colour I set into the trigger. I know it's colournotes, but how do I go about doing that?

I'm also looking to replace the "You have regained equilibrium" message with something, how would I do that?

Trigger whatever it is you want to omit, preferably with regex, such as ^Your blood is clotting by the power of Kingdom\\.$ You want to send a ColourNote that looks like: "ColourNote ("textColour", "", "blah")"... so regarding what you want for Kingdom, it would say ColourNote ("red", "", "{ Kingdom }"). Then you want to sent that to "Script (after omit)" and check the "Omit from output" box.

The same goes for "You have recovered equilibrium."
Unknown2009-06-19 09:08:02
QUOTE (Ayisdra @ Jun 18 2009, 11:49 PM) <{POST_SNAPBACK}>
I want to spilt a series of characters and numbers and place these into an Array that I read from a table. So say my table reads out
CODE
"Type"="potion"
"Cost"="2 percent power"
"Herbs"="8 galingale 2 sargassu 1 juniper 1 yarrow"


I want to place the 'Herbs' into the Array. So the 8 would be in index 0, galingale in index 1, 2 in index 2 and so on.

How would I go about doing this. (and another, not really that important, question: Do Lua arrays start at index 0?)



Using a function like this, you can split a string up into a table "array."
CODE
function string.split(str, pat)
  local t = {}
  local fpat = "(.-)" .. pat
  local last_end = 1
  local s, e, cap = str:find(fpat, 1)
  while s do
    if s ~= 1 or cap ~= "" then
  table.insert(t,cap)
    end
    last_end = e+1
    s, e, cap = str:find(fpat, last_end)
  end
  if last_end <= #str then
    cap = str:sub(last_end)
    table.insert(t, cap)
  end
  return t
end


Call it with your string and the delimiter (i.e., a space) to split up your string.
CODE
my_table = string.split(my_table, " ")



Oh, and Lua indexes start at 1, not 0.
Dynami2009-06-25 01:54:13
Recently, I have been trying to make a targetting alias, but it never works crying.gif . Can anyone help me make one? Thank you!
Shaddus2009-06-25 02:24:16
QUOTE (Dynami @ Jun 24 2009, 08:54 PM) <{POST_SNAPBACK}>
Recently, I have been trying to make a targetting alias, but it never works crying.gif . Can anyone help me make one? Thank you!

Not sure of your setup, but here's what I did on Imperian.

Make a variable for your target. "target" is what I'll use.

Set an alias to set your target: For instance,

QUOTE
X *


sends

QUOTE
setvariable "target", "%1"


And I think click the expand variables box.

then make another alias for your attack. For instance, set
QUOTE
ZZ

to
QUOTE
CAST BLAST @target


And make sure to expand those variables as well.

Then to target, use X "your target", like X RAT

and ZZ to attack (in this instance)
Dynami2009-06-25 04:48:16
QUOTE (Shaddus Mes'ard @ Jun 24 2009, 10:24 PM) <{POST_SNAPBACK}>
Not sure of your setup, but here's what I did on Imperian.

Make a variable for your target. "target" is what I'll use.

Set an alias to set your target: For instance,



sends



And I think click the expand variables box.

then make another alias for your attack. For instance, set

to


And make sure to expand those variables as well.

Then to target, use X "your target", like X RAT

and ZZ to attack (in this instance)

I did everything here, but I keep on getting a message saying "Variable "target" is not defined".
Isuka2009-06-25 04:56:39
QUOTE (Dynami @ Jun 24 2009, 06:54 PM) <{POST_SNAPBACK}>
Recently, I have been trying to make a targetting alias, but it never works crying.gif . Can anyone help me make one? Thank you!

CODE

require "serialize"
require "php"

targets = targets or {}

function targets:init()
self.current = php:Table()
targets:load()
end

function targets:load()
if not GetVariable("bsd_targets") then return end
loadstring(GetVariable("bsd_targets"))() -- creates tmpTargets table
for k,v in pairs(tmpTargets) do self.current = v end
tmpTargets = nil
end

function targets:save()
local tmpTargets = {}
for k,v in self.current:pairs() do tmpTargets = v end
SetVariable("bsd_targets",serialize.save("tmpTargets",tmpTargets))
end

function targets:get(name) return self.current or false end

function targets:set(name,val)
self.current = val:lower()
targets:save()
end


It's a way I came up with for tracking multiple types of targets, such as offensive, healing, partner and so forth.

The only limitation i have with it comes in the form of target coloring. Mush doesn't let you color on the fly, you have to set up a specific trigger that will change the color every time a match is made, no matter what. Otherwise I'd just capture every word and test it against multiple target types to associate with colors.
Unknown2009-06-25 11:05:58
QUOTE (Dynami @ Jun 25 2009, 12:48 AM) <{POST_SNAPBACK}>
I did everything here, but I keep on getting a message saying "Variable "target" is not defined".


Have a look at my tutorial page and see if those instructions help you any better.
Dynami2009-06-25 15:58:22
QUOTE (Zarquan @ Jun 25 2009, 07:05 AM) <{POST_SNAPBACK}>
Have a look at my tutorial page and see if those instructions help you any better.

Thank you! The instructions were really simple to follow content.gif.
Ayisdra2009-06-28 02:05:15
The gray bar in MUSHclient under the textbox (the 'info' box?)....what exactly is it and how do put text in it? I have seen it been use before...(in Ethelon's free system?)
Unknown2009-06-28 13:26:30
Everiine2009-07-01 03:13:31
Two questions:

How can I input the "bullet" symbol into something, like a news post or scroll, with MUSHclient, like:

QUOTE
ANNOUNCE NEWS #1344
Date: 6/18/2009 at 18:51
From: Estarra, the Eternal
To : Everyone
Subj: Misc. Bug Fixes

o CARTEL CATALOGUE allows reviewing a design.

o Fixed bug preventing Wild Nodes victory from halving power costs for
discretionary powers off prime.

o Night Shadowflight requires being on balance and equilibrium.

o Can no longer sip from containers in the floor.

o Random cure skills like Gedulah will no longer cure amputated arms.

o Glamours Conceal cannot be stacked on the same object.

o Acquisitio will no longer let those in pits get things on the ground.

o Music Fugue won't extend the target's song duration.

o You can now envenom using poisons in bottles.

o Snowballs will now melt over the course of a day. You can probe them
to see how melted they are.

Penned by My hand on the 12th of Dvarsh, in the year 238 CE.


Second, how can I have MUSHclient automatically turn websites into hyperlinks, like:
QUOTE
: Time to vote! http://www.lusternia.com/vote. Thanks!
Talan2009-07-01 04:57:32
1. Those bullet points are just letter o's.

2. Check the mush plugins, there's one to display hyperlinks. Instructions are at the bottom of the page. http://www.gammon.com.au/mushclient/plugins/
Everiine2009-07-01 14:21:11
QUOTE (Talan @ Jul 1 2009, 12:57 AM) <{POST_SNAPBACK}>
1. Those bullet points are just letter o's.

dry.gif Well don't I feel stupid.

QUOTE
2. Check the mush plugins, there's one to display hyperlinks. Instructions are at the bottom of the page. http://www.gammon.com.au/mushclient/plugins/

Will do.