----------------------------------------------------------
Title: "Dynamic Popups"
Author: Martyr2
Updated: December 10, 2000
Written for [#clan-x-scripterz]
----------------------------------------------------------

Dynamic: adj. Characterized by continuous change, activity, or progress. 

	This definition is at the heart of what we refer to as

"Dynamic Popups." Which are popups that continously change depending
on circumstances, commands, or events that happen within a window of
mIRC. The easiest way to do dynamic popups is to use the remote to
produce popup menus. This ability is summarized in the help file.
*Note: This type of remote scripting only works in .mrc files, not
the standard .ini file format. menu channel { Topic .subtopic:/command } Now, the idea behind this is to take these popups and put them
within group markers. That way our commands can enable and disable
the groups as we need them to change. We will show you how to do
this for when you are not an op, and then change your popups when
you become opped. Giving you the ability to produce "When op only"
popups. Lets begin by using our popup example from up top. We will place
it into a "group" and set that group to on. So that way when we
first open the channel popup, we will see regular user commands.
Then upon being opped, it will disable this group and enable our op
only popup commands. If you are unfamiliar with how groups work,
please refer to the mIRC help file for futher information. #group.regular.user on menu channel { Regular User Controls .subtopic:/command } #group.regular.user end #group.op.user off menu channel { Op User Controls .subtopic:/command } #group.op.user end Ok, these two groups will be our two versions for the same
popup. The first one is enabled since we start out as a regular
user. The second one is our special "ops only" popup which is
disabled now because we are a regular user. Now when we are opped
by someone, the event called "on OP" is activated and when we are
deopped by someone, the event called "on Deop" is activated. So we
will use these two events to determine if we are opped or not.
Again, if you are not familiar with events, refer to the help file. on *:OP:#: { if ($opnick == $me) { .disable #group.regular.user .enable #group.op.user } } on *:Deop:#: { if ($opnick == $me) { .disable #group.op.user .enable #group.regular.user } } The first event responds to an opping on the channel, and if
that person is you, it will disable the regular group and enables
the op group. If you are the one being deopped, like in the second
event, then it will disable op group and enable regular user group.
By enabling and disabling these groups, you are litterally
activating and disactivating the popup commands in your remote file.
To test this, you would go into a channel... right click your
channel popups and you should see your regular user commands. Then
have someone op you, right click on your channel popups again, you
should now see your op commands. Then again have someone deop you
and right click, you should see regular commands are back. While this is very simplistic in nature, its intensions was for
demostration purposes and is not always the best way to tackle the
task you may want to do. Its an idea on how dynamic popups work. For
working with chanserv opping you, such as dalnet, try incorparating
in a "on Serverop" command along with these two events.

Another Way:

Another way to do dynamic popups is through the use of the $iif identifier. This is often the most common form for those interested and truly the easiest to understand. Many scripters will recommend this version rather than the other for several reasons; its cleaner, neater, and easier to understand.

One thing you must understand about popups is that when you open one, it triggers and resolves any of the identifiers used in the formation of that popup once. This simple realization gives the $iif its power for making things dynamic. We will make a simple popup using an away feature. The code is below...


Away System
.$iif($away == $true, You are away, You are NOT away):/echo -a See how it changes?

Now if you place the above code in your channels popup and hit ok, then go and select your channel popup by right clicking the channel, you will see it has an "Away System" feature. You select the arrow and depending if you are marked as away, shows an option that reads either "You are away" or "You are NOT away." If you select the option it will echo to the active screen the message "See how it changes?"

You can test it by typing /away into any window you like. Either making you go away or making you come back. Then repeat the procedure with the popup. You will see the message then read the opposite choice.

With the use of $iif you can have it trigger commands, enable/disable groups, or write out messages. Its an excellent method for creating little markers to tell you which options are on and off. To fully understand this example, please be sure to famaliarize yourself with the use of the $iif identifier in the help file.

Conclusion:

	The purpose of dynamic popups is to give you the ability to 
customize your popups automatically given what your current
situation is. It saves popup space, provides the ability to add
extra features, and allows you to have better control for finding
the options you need; when you need them. For changing one feature,
it is recommended that you have at least two groups, one on and one
off, events to trigger enabling and disabling of these groups, and
neatly written remote popups. http://www.team-clanx.net or join our channel #clan-x-scripterz .::(Martyr2)::. © 2000 Clan-X-Scripterz