From WikiChip
Editing mirc/variables
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.
Latest revision | Your text | ||
Line 187: | Line 187: | ||
In many occasions you may need to save individualized data (data for a particular user or channel for example). Dynamic variables allow you to do just that. A dynamic variable's name usually consists of a static part (a part that doesn't change) and a dynamic part (the part that changes). | In many occasions you may need to save individualized data (data for a particular user or channel for example). Dynamic variables allow you to do just that. A dynamic variable's name usually consists of a static part (a part that doesn't change) and a dynamic part (the part that changes). | ||
− | === | + | === Saving Values === |
− | The basic syntax to | + | The basic syntax to save a dynamic variable is: |
<syntaxhighlight lang="mirc">set %<static_part> $+ <dynamic_part> | <syntaxhighlight lang="mirc">set %<static_part> $+ <dynamic_part> | ||
Line 196: | Line 196: | ||
Although you can omit the static part out, its strongly discouraged because variables should have a meaningful name that explains their purpose. | Although you can omit the static part out, its strongly discouraged because variables should have a meaningful name that explains their purpose. | ||
− | |||
− | |||
Let's take a look at an example: | Let's take a look at an example: | ||
Line 215: | Line 213: | ||
# mIRC evaluates the identifier $nick to "John" and $2 to blue<br /><syntaxhighlight lang="mirc">set %color. $+ John blue</syntaxhighlight> | # mIRC evaluates the identifier $nick to "John" and $2 to blue<br /><syntaxhighlight lang="mirc">set %color. $+ John blue</syntaxhighlight> | ||
# mIRC will then append "John" to "%color." Before executing the /set command, thus the final variable looks like this:<br /><syntaxhighlight lang="mirc">%color.John blue</syntaxhighlight> | # mIRC will then append "John" to "%color." Before executing the /set command, thus the final variable looks like this:<br /><syntaxhighlight lang="mirc">%color.John blue</syntaxhighlight> | ||
+ | |||
=== Retrieving Values === | === Retrieving Values === |