Mushclient Questions

by Esano

Back to Mechanic's Corner.

Mirami2010-10-08 23:01:44
Woohoo, that got it to work! Thanks!
Unknown2010-10-12 13:51:22
Is there anything which can let me repeat something x times?

Something along the lines of
Repeat("nod", 5)

Which will do
nod nod nod nod nod
Unknown2010-10-12 13:56:20
You can make a script function/alias to do that very easily.
CODE
function Repeat(cmd, max)
  for i=1,max do
    Execute(cmd)
  end
end
vorld2010-10-12 15:47:56
match="ff"
enabled="y"
ignore_case="y"
sequence="100"
>
outskin all lovashi
outskin yig
outskin olormi
outskin flahti
outskin augorum
fleshcall fleshwork
world.doafter 3
fleshcall skin marble
world.doafter 3
fleshcall eyes silver
world.doafter 3
fleshcall legs legnthen
world.doafter 3
fleshcall ears lengthen


match="fll"
enabled="y"
sequence="100"
>

Is there a reason only the first fleshcall only works?
Unknown2010-10-12 17:13:04
If you're using VBscript, its
CODE
DoAfter 3, "fleshcall skin marble"

If you're using Lua, its
CODE
DoAfter(3, "fleshcall skin marble")


Also, your lengthen is mispelled for your legs.

Edit:
QUOTE (Zarquan @ Oct 12 2010, 09:56 PM) <{POST_SNAPBACK}>
You can make a script function/alias to do that very easily.
CODE
function Repeat(cmd, max)
  for i=1,max do
    Execute(cmd)
  end
end

Looking at this line:
for i=1,max do

What does the i refer to? From what I understand, that line means that if i is equal from 1 to the number input at max, am I right?
vorld2010-10-12 17:18:33
Ah thanks I'm using lua btw
Unknown2010-10-12 17:35:18
In a for-loop, you need a control variable to hold the current increment. In this case, i isn't used for anything more than that, but you could use it to print out which iteration you're on each time through.
Unknown2010-10-12 18:02:19
QUOTE (Zarquan @ Oct 13 2010, 01:35 AM) <{POST_SNAPBACK}>
In a for-loop, you need a control variable to hold the current increment. In this case, i isn't used for anything more than that, but you could use it to print out which iteration you're on each time through.

OK, I thought I understood the for statement. I'll have to go read up on it again.

Edit: Oh, I think I get it. i to a for statement is just like how k,v is to a pairs statement, right?
Edit2: In that case, does that mean that i is just arbitrary? I can use
for count = 1,max do
as well, right?
Unknown2010-10-12 18:20:15
Yes, you can call it anything. i is just the accepted norm in simple for loops.
Zhov2010-10-12 23:23:21
One note. Don't try to change the control variable from inside the for loop. It's considered Not Goodâ„¢.

Here's the alias I use for multiple actions:

CODE

     match="^\\s*#(\\d+)\\s+(.+)\\s*$"
   enabled="y"
   group="aliases"
   regexp="y"
   send_to="12"
   ignore_case="y"
   sequence="100"
  >
  for i = 1, %1, 1 do
  Execute ("%2")
end -- for

  


Then I just do, say:
#10 give quinotaur to zarquan

I can also use it in aliases/triggers, by sending to execute.
Dysolis2010-10-14 07:05:15
Probably a basic question but how do you highlight in Mush? If I wanted to highlight something doing to something?
Vathael2010-10-14 12:16:10
You create a new trigger with the trigger being what you want to highlight and on the bottom right side of that trigger screen there is a box to change the color of it. There are a handful of preset colors like red fg/black bg or you can make a custom color for it as well.
Dysolis2010-10-15 04:42:04
I found the box thanks! now what if I wanted something like this A fluttering madfly darts into the ear of Faragan who stumbles about with eyes wild with fear. Instead of having Faragan's name I used @script_Target to hope that the same message would work with all targets though that didn't seem to be the case.
Zhov2010-10-18 22:18:26
QUOTE (Dysolis @ Oct 15 2010, 12:42 AM) <{POST_SNAPBACK}>
I found the box thanks! now what if I wanted something like this A fluttering madfly darts into the ear of Faragan who stumbles about with eyes wild with fear. Instead of having Faragan's name I used @script_Target to hope that the same message would work with all targets though that didn't seem to be the case.

A. It must be a MUSHclient variable, not a Lua one
B. You must have 'expand variables' checked
C. If you have a bar-delimited list, (A|B|C|D) or any other regex information (such as \\b or quantifiers) you must use @!varname instead of @varname
D. If the variable's case won't always match the case of the name in the pattern, you must have 'ignore case' checked

Also note that this only works for triggers, not aliases. I know you have a trigger, just throwing it out there in case it comes up later.
vorld2010-10-19 16:07:04
QUOTE (vorld @ Oct 12 2010, 10:47 AM) <{POST_SNAPBACK}>

match="flf"
enabled="y"
ignore_case="y"
sequence="100"
>
outskin all lovashi
outskin yig
outskin olormi
outskin flahti
outskin augorum
fleshcall fleshwork
DoAfter (3, "fleshcall skin marble")
DoAfter (3, "fleshcall eyes silver")
DoAfter (3, "fleshcall legs lengthen")
DoAfter (3, "fleshcall ears lengthen")

Is there a reason only the first fleshcall only works?

Still not working changed it too.
Unknown2010-10-19 16:12:54
Firstly, set the alias to Send to Script.
Then, everything that you want to send normally, do this:
CODE
Send("outskin all lovashi")

And lastly, with the way you have setup your timers, all of them will be sent after 3 seconds. What you have to do is this:
CODE
DoAfter (3, "fleshcall skin marble")
DoAfter (6, "fleshcall eyes silver")

And so on and so forth.
vorld2010-10-19 16:19:44
Ah OK. That's what I was doing wrong. so 3 6 12 then 15?
Edit:
hrm now Treant is giving me an error.
Run-time error
World: Treant
Immediate execution
:1: attempt to call global 'send' (a nil value)
stack traceback:
:1: in main chunk
Unknown2010-10-19 18:24:21
Lua is case-sensitive, so don't use "send" when you mean "Send"...
vorld2010-10-19 19:01:27
Fixed. I didn't know lua was case sensitive. Go figure tho.
vorld2010-10-24 17:14:46
Your flesh is not prepared for transformations.
Your skin is normal.
Your eyes are normal.
Your legs are normal.
Your ears are normal.
Your belly is normal.
Your nose is normal.
Your torso is normal.
Your hands are normal.
Your throat is normal.
Your mouth is normal.
Your aura is normal.

is there a way to show what things do like eyes are silver fleshform hypnotize target etc?