Sakr2010-07-15 09:41:06
So I'm reading the tutorials on how to create scripts triggers and aliases. Now what I can't exactly find is what does the signs used mean?
like the most common things I've seen are the following signs:
< >
/
{ }
%
^
*
what do these signs mean when it comes to scripting, and could an example be brought out of each one? And are there anything else that I might have forgotten?
Thanks in advance
like the most common things I've seen are the following signs:
< >
/
{ }
%
^
*
what do these signs mean when it comes to scripting, and could an example be brought out of each one? And are there anything else that I might have forgotten?
Thanks in advance
Lendren2010-07-15 10:22:35
In which client?
Sakr2010-07-15 11:22:10
it makes a difference between clients? I'm sorry, but Nexus and Mush would be awesome please.
Calixa2010-07-15 11:39:01
QUOTE (Falcon @ Jul 15 2010, 11:41 AM) <{POST_SNAPBACK}>
So I'm reading the tutorials on how to create scripts triggers and aliases. Now what I can't exactly find is what does the signs used mean?
like the most common things I've seen are the following signs:
< >
/
{ }
%
^
*
what do these signs mean when it comes to scripting, and could an example be brought out of each one? And are there anything else that I might have forgotten?
Thanks in advance
like the most common things I've seen are the following signs:
< >
/
{ }
%
^
*
what do these signs mean when it comes to scripting, and could an example be brought out of each one? And are there anything else that I might have forgotten?
Thanks in advance
Just off the top of my head, this is how they are mostly used:
<> are less and greater then (like in maths) or container tags if they enclose a word
/ is divide by
{} are also container tags
% is the leftover after a division, like if you'd do 5 divided by 2 which is 2,5. then 5%2 is 0,5.
^ is power of, like 3^2 is 9.
* is a multiplication, or can be used as a joker sign in a string.
Your best bet for Mush is to search the help files for (mathematical) operators and basic functions (if statement ect.)
Hope that helps a bit.
Unknown2010-07-15 11:41:34
For MUSHclient, you'll want to look at a Lua syntax guide, actually. The special characters can mean different things in different contexts, so it would be better if you had specific examples of code you don't understand or things you want to learn to code.
And, 5 % 2 is 1, not 0.5. You never get a fractional modulus.
And, 5 % 2 is 1, not 0.5. You never get a fractional modulus.
Ssaliss2010-07-15 11:42:04
QUOTE (Calixa @ Jul 15 2010, 01:39 PM) <{POST_SNAPBACK}>
Just off the top of my head, this is how they are mostly used:
<> are less and greater then (like in maths) or container tags if they enclose a word
/ is divide by
{} are also container tags
% is the leftover after a division, like if you'd do 5 divided by 2 which is 2,5. then 5%2 is 0,5.
^ is power of, like 3^2 is 9.
* is a multiplication, or can be used as a joker sign in a string.
Your best bet for Mush is to search the help files for (mathematical) operators and basic functions (if statement ect.)
Hope that helps a bit.
<> are less and greater then (like in maths) or container tags if they enclose a word
/ is divide by
{} are also container tags
% is the leftover after a division, like if you'd do 5 divided by 2 which is 2,5. then 5%2 is 0,5.
^ is power of, like 3^2 is 9.
* is a multiplication, or can be used as a joker sign in a string.
Your best bet for Mush is to search the help files for (mathematical) operators and basic functions (if statement ect.)
Hope that helps a bit.
If we assume we're talking mathematical symbols here, % is called "modulo" and is the remainder. I.e. 5%2=1.
Sakr2010-07-15 11:43:44
alright! thank you guys
Anisu2010-07-15 12:06:42
QUOTE (Falcon @ Jul 15 2010, 11:41 AM) <{POST_SNAPBACK}>
So I'm reading the tutorials on how to create scripts triggers and aliases. Now what I can't exactly find is what does the signs used mean?
like the most common things I've seen are the following signs:
< >
/
{ }
%
^
*
what do these signs mean when it comes to scripting, and could an example be brought out of each one? And are there anything else that I might have forgotten?
Thanks in advance
like the most common things I've seen are the following signs:
< >
/
{ }
%
^
*
what do these signs mean when it comes to scripting, and could an example be brought out of each one? And are there anything else that I might have forgotten?
Thanks in advance
I am assuming you mean in trigger patterns in that case we must make a difference between normal triggers where * is a wildcard,every wildcard sends a value to a temporary variable depending on it's position first * is %1 second %2 and so on. In normal trigger patterns @varname puts the variable name in there, I believe all else gets treated as string value.
which is why you call on Regex patterns explained here: http://www.regular-expressions.info/reference.html
Mushclient's own explenation on trigger patterns: http://www.gammon.com.au/mushclient/funwithtriggers.htm
BTW when using regex wildcards do not automaticly capture, to capture you will have to use (). Eg (\\w+) will check that the pattern has a word value there, and only trigger if it does, but also captures the word. Just \\w+ will still cause the trigger to fire, but not capture the value. Captured values are assigned to %1, %2 ..%99
For scripting in mush: http://www.lua.org/manual/5.0/manual.html (for easier just google learning lua or something)
and http://www.gammon.com.au/scripts/function.php
ps. this is only for mush since Nexus is evil
Sakr2010-07-15 12:27:33
I heard people say nexus is evil before. Why is that?
Unknown2010-07-15 12:37:54
It's slower. It has a ceiling on how many triggers and aliases you can make. It sometimes loses all your settings. It's much less customizable. It uses its own proprietary scripting language...
Lillie2010-07-15 13:12:01
...and when it's all you've used in your 5 years of playing IRE's, it puts a chain on your mind and keeps tempting you to come back to it when you try to switch to a proper client.
(trying again to make the change over to mushclient; it's going more smoothly this time, though, thanks to CS220 )
(trying again to make the change over to mushclient; it's going more smoothly this time, though, thanks to CS220 )
Placeus2010-07-15 13:51:51
If you see the characters all jumbled up, someone is probably swearing at you.
Felicia2010-07-15 16:59:24
QUOTE (Placeus @ Jul 15 2010, 09:51 AM) <{POST_SNAPBACK}>
If you see the characters all jumbled up, someone is probably swearing at you.
@Falcon —
I started learning the basics of Lua with this list of tutorials: http://lua-users.org/wiki/TutorialDirectory
If checking the reference manual seems a touch confusing at first, try browsing the tutorial there. I've found it to be very informative and surprisingly easy to follow.
Unknown2010-07-15 17:02:43
Well, for reference:
Nexus:
I still use Nexus because I can't seem to grasp Lua. I'm dumb.
Nexus:
- These brackets { } are used to enclose certain other symbols when used in triggers, usually to match words/numbers/lines. You can use * for wildcard matching, % for matching numbers, and a few others.
Example: {<}You remove a canvas backpack.{>} The {<} {>} tells Nexus to match the exact line "You remove a canvas backpack." and then trigger another command. (For anti-theft, the triggered command would probably be "wear backpack12345" or whatever.) - On their own, the >> serves the same function as a semicolon does in MUSHClient (Lua?). It tells the client to start a new line and send a new command. Doing "nightsight >> stance legs" in Nexus is equivalent to "nightsight; stance legs" in MUSH.
- The $ symbol is used for variables. If you have a "target" variable, then all your scripting is going to use $target to identify it. For example: the alias "cbl" (contraction of Cast BLast) would be written out " cast blast $target "
- The # symbol is used for changing variables on the fly. Using the previous example, if your "target" variable was currently set to "fink" and you wanted to change it to "gnome", then you would enter in the prompt " #set target gnome " (exactly as-is, without quotation marks).
I still use Nexus because I can't seem to grasp Lua. I'm dumb.
Unknown2010-07-15 19:03:30
There's a regex creation and test program for the iPad.
Now if only there was mudlet for iPad... *daydream*
Now if only there was mudlet for iPad... *daydream*
Neos2010-07-15 19:23:02
QUOTE (Jello @ Jul 15 2010, 03:03 PM) <{POST_SNAPBACK}>
There's a regex creation and test program for the iPad.
Now if only there was mudlet for iPad... *daydream*
Now if only there was mudlet for iPad... *daydream*
This conversation was already had on the mudlet clan. iPad is bad for you. Gives you AIDS and addles your brain.
Ilyssa2010-07-15 20:21:10
QUOTE (Jello @ Jul 15 2010, 09:03 PM) <{POST_SNAPBACK}>
There's a regex creation and test program for the iPad.
Now if only there was mudlet for iPad... *daydream*
Now if only there was mudlet for iPad... *daydream*
There's probably some kind of client for IPad. I use one on my phone even though the small keyboard and screen are almost as restricting as the fact that I cannot fight , set a trigger, or an alias. Get me Mudlet on a portable device like the IPad and I may consider buying one. But let's think: a portable device that let's you access the internet, run programs and applications, and is also useful for showing off and maybe, and this is a big maybe, -maybe- you will actually use it at work some time.
Congratulations. I give you the laptop.
Unknown2010-07-15 20:30:09
QUOTE (Ilyssa @ Jul 15 2010, 04:21 PM) <{POST_SNAPBACK}>
There's probably some kind of client for IPad. I use one on my phone even though the small keyboard and screen are almost as restricting as the fact that I cannot fight , set a trigger, or an alias. Get me Mudlet on a portable device like the IPad and I may consider buying one. But let's think: a portable device that let's you access the internet, run programs and applications, and is also useful for showing off and maybe, and this is a big maybe, -maybe- you will actually use it at work some time.
Congratulations. I give you the laptop.
Congratulations. I give you the laptop.
Plenty of iphone telnet/ssh apps... You -can- connect, I'm sure. But it would be little more than LACC(Lusternia As a Chat Client) at that point.
Calixa2010-07-15 20:37:07
QUOTE (Zarquan @ Jul 15 2010, 01:41 PM) <{POST_SNAPBACK}>
And, 5 % 2 is 1, not 0.5. You never get a fractional modulus.
Err, that's right, I never was very good with maths.
Sakr2010-07-15 21:37:05
QUOTE (Lillie @ Jul 15 2010, 04:12 PM) <{POST_SNAPBACK}>
...and when it's all you've used in your 5 years of playing IRE's, it puts a chain on your mind and keeps tempting you to come back to it when you try to switch to a proper client.
(trying again to make the change over to mushclient; it's going more smoothly this time, though, thanks to CS220 )
(trying again to make the change over to mushclient; it's going more smoothly this time, though, thanks to CS220 )
egh my problem is that since I am at university, they blocked access to Lusternia's ports. Rather, they only allowed access to a few ports. So I tend to jump around computers a lot to go on Lusternia, and it's easier to access the nexus client than to carry a flash disk with mush/treant/ and a few set of plugins that are haphazardly put together.