Skip to content

Addons_New_Template

Sven Roelse edited this page Nov 25, 2020 · 7 revisions

Template

; #= placeyouridhere -rs
; ########################################
; Peace and Protection
; PnP <Addon name> (standard addon)
; ########################################

#.ppa.info off
[addon]
name=
group=
popup=
author=
version=
url=
email=
id=placeyouridhere
ppver=4.22
config=
help=
unload=
vars=
vars2=
windows=
dialogs=
timers=
sockets=
hashcid=
hashpnp=
[files]
1=
[other]
1=
[notes]
1=
[menu]
1=
[nicklist]
1=
[query]
1=
[channel]
1=
[interfaces]
bot=
#.ppa.info end

on *:LOAD:{
  ; PnP check
  if (!$_ispnp) {
    echo 4 -ati2 *** This addon requires Peace and Protection by pai to use.
    echo 4 -ati2 *** You can download Peace and Protection at http://www.kristshell.net/pnp/
    .timer -mio 1 0 .unload -rs " $+ $script $+ "
    halt
  }
  ; Invalid load method check
  if (!$istok($_cfgx(addons,ids),$readini($script,n,addon,id),32)) {
    .timer -mio 1 0 .unload -rs " $+ $script $+ "
    dispa Unloading ' $+ $script $+ ' $chr(40) $+ addon is not properly loaded; use /addon to load it $+ $chr(41)
    halt
  }
}

Explanation

As you can see Pai wraps the meta and configuration data pertaining to the file in group #.ppa.info (/help Groups). Within this group she creates an INI file layout with [section] and key=item pairs. This allows her to easily reference the information within.

[Addon] Explanation
name= Friendly name of the addon.
group= group=Core for addons that are included within PnP.
popup= Name of the popup that is displayed under menubar > PnP > Addons
author= The creator of the addon.
version= The version of the addon.
url= The webpage / home of the addon or author.
email= Send support emails here.
id= The internal ID of the addon.
ppver=4.22 Set this to 4.22. If set below 4, then upon loading the addon, file addon320.mrc is loaded as well. See Addon.mrc - L73
config= Specify alias for configuration.
help= Specify alias for help.
unload= This alias is run when the addon is uninstalled.
vars= The unset command is run against these specified vars when the addon is uninstalled. See /help /unset
vars2= The `set command is run against these specified vars when the addon is uninstalled. Space delimited.
windows= These windows are closed when the addon is uninstalled. Space delimited.
dialogs= These dialogs are closed when the addon is uninstalled. Space delimited.
timers= These timers are turned off when the addon is uninstalled. Space delimited.
sockets= These sockets are closed when the addon is uninstalled. Space delimited.
hashcid= These cid specific hashes are deleted (wildcard ok). Space delimited.
hashpnp= These hash items under hash table pnp are deleted (wildcard ok). Space delimited.
[Files] Explanation
1= Start with 1= and increment as necessary. First item is always the actual .ppa file. When clicking on Delete in the addon dialog, all files under [Files] and [Other] are deleted.
[Other] Explanation
1= See above.
[Notes] Explanation
1= Start with 1= and for every new paragraph increment it. Put your information about the addon here. Gets displayed in the addon dialog.
[Menu] Explanation
1= This builds a popup menu under PnP > Addons > Addon name
[Nicklist] Explanation
1= This builds a popup menu when you right-click a nick.
[Query] Explanation
1= This builds a popup menu when you right-click in a query.
[Channel] Explanation
1= This builds a popup menu when you right-click in a channel.
[Interfaces] Explanation
bot= Bot interface. Used in opcmd.mrc.

Notes from the author(pai) as taken from webarchive/pairc.com

1. PPA file addon section

2. PPA file other section

3. Combining the PPA file and the script

4. Common PnP commands

5. PnP hashes

6. Adding to popup menus

7. Signals

8. DCC queueing

9. More...

10. Reference

1. PPA FILE, [ADDON] SECTION

Every addon must have an associated PPA file. That file may contain the entire addon, or just the addon information. The PPA file is an ini-format file with at least an [addon] section and a [files] section. The [addon] section-

[addon]
name=Name of your addon
author=Author name
version=1.00
url=http://www.website.com/
[email protected]
popup=Popup name
id=addonid
ppver=4.22
config=
help=
unload=
vars=
windows=
dialogs=
timers=
sockets=
vars2=
hashcid=
hashpnp=

The 'name', 'author', 'version', 'url', and 'email' items should be self-explanitory. 'version' doesn't need to be numeric, but if you release a new version, it should have a version value that is 'greater' than the previous version.

'popup' is the title used when listing your addon, in the Addons menu in the menubar popups.

'id' is a unique id that identifies your addon. Use letters only, please, and make it fairly unique- 'davemp3script', not 'mp3'.

'ppver' is the lowest version of PnP the addon will run on.

'config' is an alias to run for configuring the addon. 'help' is an alias to run for addon help. 'unload' is an alias to call when unloading the addon. This alias can /halt to cancel the unload.

When unloading the addon, any variables listed in 'vars', windows listed in 'windows', dialogs listed in 'dialogs', timers in 'timers', and sockets open, in 'sockets', will be freed automatically. This keeps you from having to write this cleanup code yourself, and keeps addons from leading bits of themselves after being unloaded. Wildcards and multiple items (space-delimited) are allowed.

'vars2' lists variables to clear from PnP's configuration. (see `set, in commands, later.) Wildcards are not allowed. 'hashcid' lists hash items to delete from all pnp.cid hashes. (see hashes, later.) Wildcards are allowed. 'hashpnp' lists hash items to delete from the 'pnp' hash. Wildcards are allowed. (again this is all done during unload)

These unload items are entirely optional- you're free to write your own cleanup in the unload alias.

2. PPA FILE, OTHER SECTIONS

The PPA file must also have a [files] section. It must list all files to load for the addon. For example-

[files] 1=addon1.mrc 2=addon2.mrc

No pathnames are needed. You can also include a list of other files that aren't actually loaded-

[other] 1=stuff.txt 2=morestuff.txt

These files are listed in addon info, and can be deleted with the 'Delete addon' button, but are not actually loaded as scripts. Do not list the PPA file under [other].

[notes] 1=blah 2=blah

You can include notes here, that will be shown in the addon information dialog.

3. COMBINING THE PPA FILE AND THE SCRIPT

Most addons only need a single script file, and can safely include the PPA data right inside the script. Simply name your script with a PPA extension, and add the data at the top. Stick the data in a #group that is off. For example-

; This is my addon script
; blah blah

#ppainfo off
[addon]
name=Name of your addon
author=Author name
version=1.00
url=http://www.website.com/
[email protected]
popup=Popup name
id=addonid
ppver=4.21
[files]
1=myaddon.ppa
[notes]
#ppainfo end

; (script code goes here)

Save this as myaddon.ppa, and you will have a self-contained addon file.

You do not have to stick the script in the PPA file- this is optional, merely recommended if you only need one script file.

4. COMMON PNP COMMANDS

For your addon to work with PnP, it should use the following commands when appropriate.

/dispa [text]
/disps [text]
/disp [text]

Displays text to active (dispa) or status (disps) window using PnP's echo routines. /disp will display to whichever window is selected for showing CTCP/DNS/away events in configuration.

/dispr [window] [text]

Displays text to a specific window. Window can be -a or -s for active/status windows.

/disprc [#chan] [text]
/disprn [nick] [text]

Displays text routed to a channel or query window. If the window is not open, it displays to active or status depending on settings. The channel or nickname will prefix the text in all circumstances. For example, /disprc #pnp test will show "[#pnp] test".

/disptc [window] [#chan] [text]
/disptn [window] [#chan] [text]

Displays text in the "[#chan] text" or "[nick] text" format like the previous commands, but allows you to specify a specific window to display to. This window can be -a or -s for active or status. Allows you to display "[#chan] text" but force it to go to active, status, or another window, etc.

/dispa-div
/disps-div
/dispr-div [window]

Display PnP's line separator to a window. Doesn't display it if one is already there, so you can call this even if you're not sure if one was already displayed and they won't "double up".

$:c1 $:c2 $:c3 $:c4 $:cerr

Returns the colors set in /theme, under PnP colors. c1 is the normal basic color used for pnp echos. These numbers do not include the Ctrl+K code.

$:s(text) $:h(text) $:q(text) $:w(text) $:b(text) $:t(text)

Various color identifiers. $:s is intended for single word/target highlighting- like a nickname, channel, or address. $:h is for longer text, like a topic. $:q is like $:h but adds single quotes to the string. $:w highlights the text in the error/warning color. $:b bolds the text. (using the /theme bold settings, so you should use this instead of hardcoding bold characters) $:t is intended for nickname targets specifically, and is basically a combination of $:s() and $:b() at the same time.

$:*

Returns the prefix set in /theme.

$:anp

Returns [ network ] or [ network : nick ] (IE a network prefix) for the current $cid- But ONLY if $cid differs from $activecid. This is AUTOMATICALLY used in the above /disp aliases- only use this if you manually /echo something and want to show a prefix for another network.

/`set [name] [value]
$hget(pnp.config,name)

Sets and retrieves PnP configuration items. Try to use addon-specific names, such as 'davemp3.setting'. You should use /`set, instead of /hadd, because this makes sure the setting is saved properly. Value is optional- an empty value will clear the setting.

$_isbot(nick)

Returns true if PnP recognizes the given nickname as a services bot- NickServ, ChanServ, X, etc. (Only on the appropriate networks)

/_whois.queue [nick] [display] [command]

This will perform a /whois on the given nickname, and call the given command when the whois is complete, with all data for that whois in the pnp.twhois.$cid hash. (where $cid is the current value of $cid.) 'display' should be 0 normmally, but you may put * or a window name here to display the whois if you don't want it hidden. The hash items are named after MTS items- nick, address, realname, wserver, serverinfo, text (away msg), chan. If user was not found, 'error' will be set in the hash.

/_q.userhost $_s2p(command1) $_s2p(command2) [nickname(s)]

This performs a /userhost on the nicknames (separate with spaces) and runs command1 for each result, or command2 for each result of 'no such user'. The commands must be run through the identifiers as listed (so the commands can contain spaces) The commands should use &n to represent the nickname, &a for the address, &h for the here/away flag, and &i for the ircop flag. For an example, type-

//_q.userhost $_s2p(Found: &n &a &h &i) $_s2p(Not found: &n) nickname

5. PNP HASHES

PnP makes the following hashes available at all times-

pnp- The pnp hash can be used to store small amounts of data. It is cleared
on exit.
pnp.[cid]- Data specific to a cid. For example, pnp.1 stores data for cid
1. It is cleared on exit. Any items beginning with a hyphen are also
cleared on connect/disconnect.
pnp.config- See /`set, in commands, above.

6. ADDING TO POPUP MENUS

You can add popups normally using mIRC's menu prefix. However, if you have only a couple popup items, you can add them to the 'Misc' menu by using the PPA file data again. Just add a section of that menu's name. For example-

[query]
1=Close:blah blah

This will add the 'Close' popup to the Misc. menu in query popups. The other titles are [nicklist], [channel], and [status]. It's recommended you use these if you only have one or two items to add, especially if they aren't used often.

[menu] is special- it is formatted the same, however the items are added to the Addons -> submenu under menubar popups, under the addon's name.

7. SIGNALS

PnP sends a number of /signals (see mIRC help on signal events) that your script can detect.

PNP.DRAGDROP [s|n] [window] [filename]

This is sent when a file is dropped on a channel/query/chat window. $1 is 's' if shift was held, 'n' otherwise. 'window' will be =nick for chats. 'filename' will NOT be surrounded in quotes. If your script processes the file, it should /halt. Otherwise, it should just do nothing, or /return. Make sure your signal event uses the & prefix, or checks $halted, to avoid processing a file that another script already did.

PNP.SELFPING [ticks] [duration]

Sent when a self ping returns, with ticks in $1 and a verbose duration in $2-.

PNP.STATUSOPEN [cid]

Sent when a new status window opens. Note that this is NOT called for the first status window that is open when mIRC starts.

PNP.STATUSCLOSE [cid]

Sent when a status window closes.

PNP.SIGNON

Sent when ALL signon routines are complete and MOTD is finished, and all server settings are loaded. A services addon (nickserv, chanserv, etc.) should NOT log in until this signal.

8. DCC QUEUEING

If you're writing a file-sharing addon, you can make use of PnP's built-in DCC queueing features. These features are setup (by the user) using the command /dcc queue, and are already used by PnP's XDCC and Sound addons.

To send a file, simply use-

/_send.dcc nickname filename

Do not place the filename in quotes. The alias will return a value in $result, according to the result-

Returns -1 if user already has enough queued files
Returns -2 if the entire queue is full
Returns -3 if no queueing has been enabled
Returns -4 if file not found
Returns -5 if file already queued to be sent to user
Returns -6 if file already currently being sent to user
Returns 0 if file was immediately sent to user
Returns n if file was queued (n is a positive number representing the
position in the queue- 1 is the next file to go out, etc.)

The queue automatically follows nick changes and cleans up according to the user's preferences. Some other queue commands-

/_cancel.dcc nickname

This cancels all queued DCCs to a user, and returns the number cancelled in $result.

$_count.dcc(nickname) or $_count.dcc

Returns the total number of queued DCCs to a user, or all users if no nickname is given.

$_pos.dcc(nickname)

Returns the position of the next queued DCC to a given user, in the queue.

$_cfgi(dccmaxsendone), $_cfgi(dccmaxsendall)
$_cfgi(dccmaxqone), $_cfgi(dccmaxqall)

These let you retrieve the queue settings, returning the max sends to one user, max sends to all users, max queued files to one user, and max queued files to all users. If dccmaxqall is zero, queueing has been disabled.

9. MORE...

Make sure you properly respect $halted and /halt and the & prefix in your events, where appropriate. As long as you don't do anything stupid like /unsetall, or name your aliases and variables with conflicting names, most normal mIRC code should run fine under PnP.

10. REFERENCE

The following information is a quick reference of almost all hashes, variables, configuration items, timers, etc. that PnP uses at this time. It is copied directly from my development notes, so please forgive the formatting and sparse descriptions.

HASHES

pnp.twhois.$cid
  collects whois data during a whois/whowas
pnp.qwho
  stores who queue data
  
  $cid.$chan = cmd for a queued /who on a channel
pnp.qwhois
  stores whois queue data
  
  $cid.$nick = window whois was performed from
pnp.qdns
  stores dns queue data
  
  $cid.:$nick = for queueing a nick (unset on disconnect)
  $cid.$address = for queueing an address
pnp.quserhost
  stores userhost queue data
  
  $cid.$1 = numbered item in a connection's queue
  $cid.head = position of first item in a connection's queue (where new ones are added)
  $cid.tail = position of last item in a connection's queue
pnp.ping.$cid
  stores ping data
  
  :nick = info on a pending ping for this nick- ticks window ctcp
  count.$chan = total count of pings for channel remaining
  total.$chan = total ping time received (ticks)
  reply.$chan = total ping replies received
  avg.$chan = average ping time so far (ticks)
pnp.pingret.$cid.$chan
  retains ping data
  
  last = number of last line stored
  $1 = line of data
pnp.$cid
  stores state data for a connection
  stuff unset on disconnect has name beginning with -hyphen
  
  away = away status and settings- oldnick awaytime modes reason...
  -titleavg.$chan = what to show in titlebar as average ping for that window
  net = current network name or 'offline'
  -self.lag = current self lag, display version
  -self.ticks = current/last self lag in ticks
  -sp.$1 = self ping tick values
  -sp.index = last self ping code sent
  -sp.count = countup of seconds from when we sent the last self ping
  -nickretake = nickname to retake
  -nickrc = nickname we are currently checking for retake
  -quithalt = tracks times we've quit before a disconnect, to hide later quits and note the disconnect was voluntary
  -servnick = nicknames of all services on this network
  -servaddr = addresses/access cmds of all services on this network; when setting this var replace ??? with blah.net
  -serv = codes of all service types supported on this network
  -servopt = service options codes
  -myself = my address
  -modes = max modes per line
  -feat = server features
  -target = max targets per msg on server
  -nicklen = max length of nickname
  -awayword.$site = if this site has used an awayword during this away period
  -awayword.! = if any nick has used an awayword in the last X seconds
  -awayremind.$site = if this site has been remined that we're away
  -awayremind.! = if any nick has been reminded that we're away in the last X seconds
  timedclose = queries to close on a timed basis (while away)
  title = current title display options
  -unbanscan.$chan = masks we are scanning a channel for to unban, space-separated
  -unbanfound.$chan = bans we found to unban during scan, space-separated
  -csacc.$chan = set to 'fop' when founder access is assumed and logged in
  oldrnick = old nick before random change
  -delayrnick = keeps us from random nick changing too often (due to protection)
  -last.msg = last priv msg received (extras addon)
  -last.ntc = last priv notice received (extras addon)
  -ezping.$nick = If we are currently ezping'ing nick
  -kstat.recentkick.$chan = addresses of recent kicks for kickstats to note a future ban
  -invited = channels we've been invited to that we're MODEing
  -invited2 = channels we've been invited to that we MODEed and we're awaiting a possible 329 raw (just to hide it)
  -invn.$chan = who invited us to a given channel
  -chaninfo = channels we are doing /chaninfo on
  -dwho.* = counts/data from most recent /who
  -namec.* = counts/data from most recent /names
  -servping.$server = server ping data
  -servmask = server masks we've pinged (and haven't replied)
  -ns.min = minimum hops during nearby server search
  -ns.max = maximum hops during nearby server search
  -ns.found = found nearby servers
  -notify.nick.$nick = actual nickname of a notify nick (proper case)
  -notify.waiting.$nick = 1 waiting on userhos 2 unnotify shown so don't show notify
  -notify.hid.$nick = true if we hid the notify for a given nick
  -notify.on.$nick = data on a notify nick, ctime address status (fail, etc?)
  -massjoin = mass join halts when this reaches too high
  -ircopchk.$chan = queues ircop checks for a channel until 5 or .5s
  nsinuse = nick in use on connect, stored until fully connected
  -queryni.$nick = true if query is not idle recently
  -chanidle.$chan = ctime of last time we joined/typed in channel
  -notifychk = queues notify checks until 5 or .5s
  -joining.$chan = 1 if joining channel (2 if waiting on join twice, 3 thrice, etc.)
  -joining2.$chan = 1 if waiting for raw 329 upon joining channel (2 if waiting on join twice, 3 thrice, etc.)
  -motd.req = true if requested a MOTD
  -keyattempt.$chan = current position in remembered keys we are trying
  -rawthrottle.$numeric = throttles a raw for 15 or so secs
  -repjoin = channels we are reattempting to join
  -signon = signon status
  -matched = server version that was matched during signon (cleared after signon complete)
  lastsound = last sound played publically
  leechcmds = current set of leech cmds
  -search.$site = user currently doing a sound search
  -xwacc.username = current xw username (logged in as)
  -xwacc.savenewpw = cmd to run to save new xw pw (not actually saved until x sends a confirmation notice)
  -xwacc.$chan = access in channel
  -xwacc.skip = skip all xw logins for now
  -xwacc.skip.$chan = skip xw logins to channel for now
  -xwacc.skipsplit = skip xw username logins when x joins, for now (because it's already joined another channel recently)
  -nsacc.skip.$nick = skip ns logins to nickname for now
  -portscan = true if in the middle of a portscan
  -listsilence = true if in the middle of a /silence list
  -servinfo = true if in the middle of a /info request
  -statsw = true if in a /stats w (ignoring most server notices)
  -linesep.signon = 1 during signon to show a disps-div as soon as a servernotice/motd begins; 2 if already shown linesep but still waiting for MOTD (so we can intercept MOTDs without begin-of-MOTD raws)
  -waitingback = number of /backs we're waiting on before sending another away
  -waitingaway = an /away to send after we receive all queued /backs
pnp
  stores state data, non-connection specific

  away = if away on ANY server, away settings- beepsoff soundsoff wasautoaway
  pager = pager setting
  logging = awaylogging enabled (on any connection that's away)
  awaylog = filename of awaylog
  awaylog.* = awaylog counts (global across all connections that are away)
  alog.$1 = awaylog viewing settings for a specific @awaylog window
  newpages = new pager messages (global across all connections that are away)
  totalpages = total pager messages (global across all connections that are away)
  clear.pager = true to clear pager when it closes
  lastsrec = last recently-seen item used (anywhere)
  addon.ids = ids of all loaded addons
  addon.i = interfaces used by all loaded addons
  addon.i.$1 = all addons using a given interface ($1)
  user = currently selected user profile
  ext = temp file 'extension' for this mirc
  opt.n$1 = option data from mirc.ini, cached
  in.flash = if currently flashing
  locked.title = locked titlebar contents
  title.note = titlebar note
  key.exp.$1 = when a given fkey expires
  chat.open.$nick = how a given dcc chat was opened (auto, ask, request, auto server, ask server)
  autoaway.count = time before auto away kicks in (dialog being open)
  dccping = dcc ping flood counter
  startupconnect = server to connect to on startup (used during startup sequence)
  colordlg = color clicked on in a dlg- dname did
  colorwait = color dlg mouse movement variable
  qpick.$1 = checkbox status of item $1 on quick pick popup
  qpick.cmd = cmd to run on quick pick popup
  detailsort = sorting method for server details window (not remembered on exit)
  portsort = sorting method for ports window (not remembered on exit)
  ev.def = caches default mirc events settings
  ev.$chan = caches mirc channel events settings
  hidden = true if any windows currently hidden
  picture.$1 = current filename shown in viewpic window $1
  calibrate.$1 = current position in directory for viewpic window $1
  sound.cont = true for continuous sound play
  pqa.soundtarg = last active window to use when playing to "active" from a queue/playlist
  grab.focus = true to grab application focus if lost (sec for a short time- 4 sec or so only)
  install.target = upgrade directory to install to (download to)
  install.dir = upgrade directory to d/l temp files to
  install.size = total size of all files to d/l
  install.pos = current byte position within all files to d/l
  install.set = current set of files being downloaded- space-delimited- each file is size/crc/url
  install.what = current file being downloaded (first token from install.set)
  install.filesize = filesize remaining of current file
  install.get = url of current file
  install.to = filename we're downloading to (in temp dir)
  install.line = current item being downloaded (a line from the data window of upgrades)
  qhelp.final = number of last quickhelp box
  qhelp.flip = flips between colors
  qhelp.last = number of last box flashed
  qhelp.n.$1 = type of quickhelp box
  qhelp.$1 = coords of quickhelp box
pnp.config
  stores configuration data

  show.fkeys = true to show fkeys with notify events
  nc.char = nickcompletion character(s)
  nci.char = inline nickcompletion prefix
  nc.cmd = whether to nick complete in cmds  
  strip.auto = to strip codes from all publically-sent text
  title.bar = to use pnp's titlebar display
  autoaway = if auto away is enabled
  autoaway.time = time before auto away triggers (sec)
  awaylog.perm = permanent away log
  awaylog.chan = level of channel events to log
  awaylog.msg = true to log priv msgs
  awaylog.close = 1 to close queries 20s after logging priv msgs, 2 to do so immediately
  awaywords = awaywords on or off
  awaywords.hl = trigger awaywords response on any triggering of highlight settings
  awaywords.words = awaywords comma separated
  awaywords.limit = limit awaywords/hl triggers to certain channels
  awaywords.chans = channels for these triggers to limit to
  away.remind = if away reminders are enabled
  popups.hideop = true to hide op cmds if not opped
  popups.1 = menu popup settings
  popups.2 = query popup settings
  popups.3 = channel popup settings
  popups.4 = nicklist popup settings
  popups.5 = status popup settings
  popups.6 = custom popup settings
  myflood.prot = self protection settings - bit 1 = ctcp prots on; 2 = dcc prots/accepts on; 4 = switch to random nick; 8 = reply to version ctcp; 16 = reply to other ctcps
  dcc.opt = autoaccept modes for dccs- $mid(usertype*2) (+0 chat +1 send) types- HERE 0 known 1 unknown AWAY 2 known 3 un 4 dccauth; value = 0 auto 1 ignore 2 ignore w/notice 3 ask
  ping.bulk = target window for bulk ping reply display- @Ping, *, none, -ai2, -si2
  ping.one = target window for single ping reply- *, -ai2, -si2
  ping.focus = @ping window focus- min, front, norm
  ping.retain = Retain channel ping replies for later
  lagtime = seconds before a user is colored as "lagged"
  show.pingcode = true to show numbers sent in ping ctcps
  xchat.cfg = extreme chat flood options
  xnotice.cfg = extreme notice flood options
  dccqueueclean = when to clean the DCC queue options
  kickstat = 0 off 1 on 2 quiet
  kickstat.kick = min kicks to show on join
  kickstat.ban = min bans to show on join
  docountry = show country codes in whois
  ezping.on = ezping enabled
  ezping.opt = ezping options
  ezping.reply = reply to send
  ezping.phrase = comma-separated ezping phrases
  copy.query = copy query msgs to active window
  op.notice = where to show op/etc notices- 0 chan 1 window 2 events window
  serv.notice = where to show services notices 0 normal 1 window 2 status
  reg.notice = where to show regular notices 0 normal 1 window 2 status
  event.*.$chan = where to show specific channel's events
  event.* = where to show all other channels' events
  flash.opt = flash options- position 1 query here 2 query away 3 msg here 4 msg away 5 chat here 6 chat away (0 = off 1 = on)
  lastseen.opt = last seen options
  whois.win = whois output window
  whois.nick = how to show nicks in whois
  whois.shared = show shared whois chans in bold
  themecol = color nicks in channel
  ns.autoupdate = autoupdate nickserv logins
  ns.autoghost = autoghost nickserv
  ns.autorecover = autorecover nickserv
  notify.win = window for notify display, or 'off'
  stricts[.$chan] = strictmode/topic settings
  stricttopic[.$chan] = stricttopic
  cflags[.$chan] = channel flags (in /protedit)
  chopt[.$chan] = channel options (in /config)
  wordk1.[$chan|*] = protect- wordkicks 1 list
  wordk2.[$chan|*] = protect- wordkicks 2 list
  pervscan.[$chan|*] = protect- perv scan list
  snotice.on = snotice filtering on
  snotice.f = snotice filters
  snotice.win = snotice display window
  wallop.on = wallop filtering on
  wallop.f = wallop filters
  wallop.win = wallop display window
  soundtarg = current window to play sounds to, by default
  soundtype = current sound type
  sound.trig = sound triggers
  sound.trigtype = type of sounds associated with sound cmds
  sound.textfile = most recent sound text file
  sound.grab = sound grab settings
  sound.grabchans = comma-delimited channels we will grab from
  sound.grabmatch = comma-delimited masks we will grab
  sound.sendchan = channels we allow leeching from
  sound.sendmatch = masks we allow leeching of
  sound.maxmatch = max matches to send on a search
  bracket.left = left public bracket
  bracket.right = right public bracket
pnp.recseen.$cid.$1
  stores recently seen channels, nicks, etc. for a connection
  $1 is a type
  each recent item is stored as it's own item; data varies by type
  item '*' stores list of recent items in order by name only
pnp.flood.$cid
  stores PERSONAL flood counts for a connection
  any flood counters NOT in this hash need to be cleared manually (in /defld)
  currently used by _genflood

  recd.seen = !seens within 20 sec
  recd.inv = invites within 30 sec
  recd.inv.$site = invites from site within 30 sec
  recd.page = pages received recently (flood prot)
  recd.page.$site = pages received recently from site (flood prot)
  recd.ver.$site = if received a VERSION from $site recently
  recd.echo = oversized ECHOs or PINGs within last 16 seconds
  recd.quick = CTCPs within last 3 seconds
  recd.ctcp = CTCPs within last 16 seconds
  recd.ctcp.$site = CTCPs from a $site within last 16 seconds
  recd.ctcpr = CTCP replies within last 3 seconds
  recd.ctcpr.$site = CTCPs from a $site within last 5 seconds
  recd.dcc = DCCs within last 16 seconds
  recd.dcc.$site = DCCs from a $site within last 16 seconds
  ignore.ctcp = True to ignore CTCPs (set when flood prot triggered)
  ignore.ctcp.$site = True to ignore CTCPs from a site
  ezping = Number ezping in last 16 sec
  dcc.$nick = dcc in-chat flood (not really cid specific but not really important)
  notice.$site = notice flood
  noticehalt.$site = ignore notices from site
  noticehalt.mass = ignore notices from all
  noticemass = next notice flood is considered a flood from -all- sites
  newquery = new query open flood
  newqueryhalt = ignore new queries
  leechflood = leech attempts
  leechflood.$site = leech attempts
  opme.$site = OPME cmds/related cmds
  spamremind.$site = reminded site for spam in past 30 sec
  spamremind = reminded users for spam in past 20 sec
pnp.flood.$cid.$chan
  stores CHANNEL flood counters and related items
  created/flushed when you join, killed on part/kick
  
  kicked.$nick = 10 sec delay to prevent kicking a user many times
  didstrict = 10 sec delay to prevent multiple strictmode enforcements
  stricttopic = counts strict topics recently, starts deopping users after 2
  strictmode = counts strict modes recently, starts deopping users after 2
  strictmodewait = waiting for MODE reply (324) before handling strictmode
  lastleave = addresses of 10 last user(s) to part/be kicked (most recent is first token)
  lastban = last 10 ban(s) made (most recent is first token)
  lastunban = last 10 unban(s) made (most recent is first token)
  mass.modes = mass modes being set
  mass.who = targets of mass modes
  mass.ovh = type of last mass mode o v or h (for servers where you can't mix modes)
  wait.$1.[$nick|$wildsite] = whether to wait on punishments temporarily ($1 = type of protection)
  act.$1.[$nick|$wildsite] = punishment currently being used on this user ($1 = type of protection)
  fld.$1.[$nick|$wildsite] = tracks flood counts ($1 = type of protection)
  fld.ctcp = flood count, all site ctcp flood (punished by wildsite)
  last.$nick = last line said by a user
  prot.text = if this channel is being protected (text)
  prot.ctcp = if this channel is being protected (ctcp)
  prot.misc = if this channel is being protected (misc)
  split.$nick = if nick was part of last split (as soon as a user from a split joins, all split users are cleared soon thereafter)
  xdcc.$site = XDCC request floods
pnp.qcommand
  queues commands to prevent flooding
pnp.about
  a few misc vars used while about dialog is open
pnp.kickstat
  kickstats
  item named after userid@address, slightly garbled
  data contains num kicks, num bans, address, kicker address, chan, ctime, reason
pnp.startup
  startup queue
  
  $1 = numbered item in startup queue
  head = position of first item in queue (where new ones are added)
  tail = position of last item in queue
  ticks = ticks when started
  firsttime = true if first time
  errors = error count
  ddeskip = timer to skip dde
pnp.dlgcolor.$dname
  stores dialog color items
  
  $did = color of did (0-16)
pnp.nickcol.$cid.$chan
pnp.nickflag.$cid.$chan
  stores nickname colors and color-related flags
  item is nickname
pnp.window.$active
  custom window settings
  
  select = to show select all item, and how many lines to skip if so
  copy = to show copy item
  window = to show window menu (was 'nolog' before)
  log = to show log menu
  help = to show help item
  remember = to remember position
  flags = flags window was opened with- -flags +flags otherstuff... (was main window var before)
  position = recorded position
  default = default position
  onclose = alias to call when window closes
pnp.lastseen.$network
  stores lastseen data for a network
  data = fulladdress ctime channel
  
  u$1 = userid lastseen
  n$1 = nickname lastseen
pnp.xwconfig
  xwconfig dialog data
  not net/cid/chan specific because only one dialog can open at a time currently
  
  chan = channel
  bot = bot name
  cid = cid of connection
  auto = 1 if autoop is enabled for new users
  deop = mass deop pro amt
  nickfld = nick flood pro amt
  flood = flood pro amt
  noop = no ops allowed
  alwaysop = always op bot
  oponly = op cmd only
  strictop = strictop on
  autotopic = autotopic on
  autojoin = autojoin flag on
  desc = description
  keywords = keywords
  url = url
  init = if currently in process of opening dialog
  receiving = if currently receiving NOTICE data
mts.load
mts.edit
mts.preview
mts.start
mts.temp
pnp.theme
pnp.events
pnp.preview.theme
pnp.preview.events
  Used in themeing for various purposes

TIMERS

.repjoin.$cid = repjoins for a connection
.startup.resume = restarts startup on error
.startup.ddeoops = fixes dde semaphor in case of error
.nickretake.$cid = nick retake check
.awayrep.$cid = repeating away message
.nicktoofast.$cid = reattempt nick after a nick too fast error
.dtqc.$cid = do timed query close (for queries while away)
.auth.$mask = removal of dcc auth for a user (mask replaces * with `, ? with ')
.dcc.queue = checks and updates the DCC queue
.antiidle = anti idle
.lagupdate = lagbar update
.lagbar = lagbar movement via dragging mouse
.kickstat.flush = saves kickstat data after changes
.qpickfin = used to cleanup quickpick popup vars
.ircop.uh.$cid.$chan = flushes userhost queue for ircop checks on join for a channel
.notify.uh.$cid = flushes userhost queue for notify
.cacheseen.$network = flushes lastseen data to disk
.nukedetect = detects nuke batch file is complete
.nukerepeat = repeats nuke batch file
.arpdetect = detects arp batch file is complete
.page.waiting = resets "waiting" page on theme dialog
.unban.$cid.$mask = timer to unban a ban (mask replaces * with `, ? with ')
.massmode.$cid.$chan = flushes mass mode changes for a CID/channel
.clearsplit.$cid.$chan = cleans split.* data from channel flood data (started when a user that -was- split joins)
.limitfresh.$cid.$chan = refreshes limit
.squeue = plays next song in queue
.quickflash = flashes quickhelp
.kill.progress = closes progress meter .5s after 100% reached
.movepic = picwin movement via dragging mouse
.xdccad = XDCC advertisement timer
.clear.whois.$cid = clears twhois.$cid even if there's an error
.config.msgpreview = shows msg preview in config dialog
.startsaveini = saves ini after startup (30s) when starting a second profile
.line.dance.$cid = runs queued cmds

SIGNALS

PNP.SELFPING <ticks> <duration...>
  called when a selfping returns
PNP.STATUSOPEN <cid>
PNP.STATUSCLOSE <cid>
  called when status window opens or closes (not called for first status window on startup)
PNP.SIGNON
  called after all services/features vars are set for a connection
PNP.TRANSLATE <language>
  called after a translation finishes- regenerate popups, vars, theme events, reset #groups
  also called any other time pnp files are dynamically updated
PNP.DRAGDROP [s|n] [window] [filename]

VARS

%=* = recent popup lists (not connection-specific)
%.* = temp variables
%:* = theme variables
%<* = list of channel we're protecting on any cid anywhere (* if list would be too long)
CONFIG\user\CONFIG.INI
  [cfg] is main section. Each entry is a configuration option-
  
  notify.match = hide/show/ext = Action on notify if address matches
  notify.nocheck = hide/show/ext = Action on notify if no addr check
  notify.fail = hide/show/ext = Action on notify if address check fails
  notify.beepmatch = t/f = Beep if notify and match
  notify.beepnocheck = t/f = Beep if notify and no addr check
  notify.beepfail = t/f = Beep if notify and fails
  unotify.match = hide/show/ext = Action on unnotify if matched
  unotify.nocheck = hide/show/ext = Action on unnotify if no addr check
  unotify.fail = hide/show/ext = Action on unnotify if failed
  unotify.part = t/f = True to show unnotifies in part color
  whois.q = t/f = True to show whois info in query/chat if open
  whois.focus = min/front/norm = Minimize @Whois, bring to front, or normal
  whois.retain = t/f = True to retain @Whois contents
  whois.serv = t/f = True to show extended server info
  show.names = 0/1/2 = 0 to hide names output on join, 1 for channel, 2 for status (on join)
  eroute = -ai2/-si2 = Where to route standard events (CTCPs etc)
  sptime = n = Time between self lag checks (auto) 0 for off
  spwarn1 = n = Time before first self lag warning
  spwarn2 = n = Time before second self lag warning
  motd.win = -si2/@MOTD = MOTD window
  motd.disp = on/off/changes = When to show MOTD (auto)
  verify.inv = t/f = True to verify invites are to legit channels
  away.pager = t/f/quiet = Default pager setting on away
  back.pager = t/f/quiet = Default pager setting when not away
  away.log = t/f = Default logging setting on away
  away.msg = t/f = True to /ame to chats/queries on away
  autoaway.log = t/f = Logging setting on auto away
  autoaway.pager = t/f/quiet = Pager setting on auto away
  autoaway.quiet = t/f = Set auto away quietly
  autoaway.ask = t/f = True to warn when setting autoaway
  away.allconnect = t/f = Away in all connections by default?
  away.chan = t/f = True to /ame to channels on away
  away.ignchan = t/f = True to ignore sending to certain channels
  away.ignchanlist = Channel list (comma-delimited) to not send away msg to
  away.ignidle = t/f = True to ignore sending to idle channels
  away.ignidletime = Minutes to be idle before ignoring that channel for away msg
  away.act = t/f = True to away as an action (false for a msg)
  away.beepoff = t/f = True to disable event beeps
  away.sndoff = t/f = True to disable sounds
  away.chnick = t/f = True to change nicks on away
  away.nick = Nickname used when away (&me& allowed)
  away.rep = t/f = True for a repeating away message
  away.delay = Repeating away message delay (in minutes)
  awaylog.clear = t/f = True to clear away log on new away (always on startup)
  awaylog.view = Default viewing options for awaylog
  umode = User mode (default)
  uaway = User mode while away
  reserve.fkey = 0/1/2 = 0 reserve F7 queue; 1 reserve F10 queue; 2 reserve none
  fill.chan = t/f = True to auto-fill channel menu (false to lock)
  num.chan = n = Number of entries in channel menu (0 to 15) affects auto-fill only
  b.ban = t/f = True for /b to /ban, false for /b to /back
  away.closeq = t/f = True to close queries on away
  away.deop = t/f = True to deop on away
  pager.classic = t/f = True for 'classic' pager window
  away.dq = t/f = True to enable dedicated query window when away
  nickcol = t/f = True to color nicklist
  texts = t/f = True to enable text scheme support (scheme is in text.dat)
  scan.flag = Default scan flags
  recent.auto = t/f = False to cycle through recent lists, True to auto-perform first one
  format.date = format to display date in
  format.time = format to display time in
  title.here = options for titlebar when here
  title.away = options for titlebar when away
  nc.ask = ask about multiple matches for any nick completion
  dc.1 = n = status doubleclick action
  dc.2 = n = query doubleclick action
  dc.3 = n = channel doubleclick action
  dc.4 = n = nicklist doubleclick action
  dc.5 = n = notify doubleclick action
  xquery.cfg = extreme query flood settings- on/off, total, secs
  flash.here = n = number of seconds to flash if here (0 = infinite)
  flash.away = n = number of seconds to flash if away (0 = infinite)
  dccmaxsendone = n = max dccs to one person (script-initiated)
  dccmaxsendall = n = max dccs to all (script-initiated)
  dccmaxqone = n = max dccs queued to one person
  dccmaxqall = n = max dccs queued total (0 for no queue)
  dccsendhide = t/f = true to hide script-initiated dcc sends
  dccqueuehide = t/f = true to hide dcc queue by default
  hidesplash = t/f = true to hide splash screen on startup
  topic.sep = separator used in /atopic (hidden setting)
CHOPT

Space seperated tokens, position defines setting
All settings defined for every channel present (no ? 'fallthrough' like cflags)
Settings 5-15 are 0 off 1 on
  
1   Default tempban seconds
2   Tempban type
3   Banmask ident
4   Banmask host
5   Check op status before cmds
6   Display note when chan prot triggered
7   Show clones on join
8   Delay between kicks
9   IRCop check on join
10  Show banned users
11  Whois on join
12  Only whois-on-join if opped
13  Don't whois on join if away
14  Show whois on join in channel
15  Cycle for ops? (may be null for off also)
CFLAGS

Space seperated tokens, position defines setting
Values of 0 off 1+ on ? to use global default

    Setting
    ---------
1   Act on X clones
2   Detect clones by ident only
3   Mode set on mass join flood (s2p)
4   Act on X nick changes...
5    ...in X seconds
6   Act on X bytes text...
7    ...in X seconds
8   Act on X lines text...
9    ...in X seconds
10  Act on X repeats...
11   ...in X seconds
12  Act on X notices...
13   ...in X seconds
14  Act on X% caps...
15   ...in X letters
16  (unused)
17  Act on X attribute codes...
18   ...in X seconds
19  Act on X attribute codes in one line
20  One topic treated as X text lines
21  One sound treated as X text lines
22  Scan for bad channels?
23  Enforce bans
24  Word kicks enabled (group 1)
25  Word kicks enabled (group 2)
26  (unused)
27  (unused)
28  Use CTCP points (if disabled, all = 1)
29  Act on X CTCP points from one site...
30   ...in X seconds
31  Act on X CTCP points from all sites...
32   ...in X seconds
33  CTCP points for PING
34  CTCP points for ECHO (or large PING)
35  CTCP points for TIME
36  CTCP points for VERSION
37  CTCP points for USERINFO
38  CTCP points for CLIENTINFO
39  CTCP points for SOUND
40  CTCP points for XDCC/?DCC
41  CTCP points for DCC
42  CTCP points for FINGER
43  CTCP points for other
44  CTCP points for replies
45  Self ban protection enabled
46  Act on X deops...
47   ...in X seconds
48  Act on X kicks...
49   ...in X seconds
50  Act if X users banned (from 2 or more bans)...
51   ...in X seconds
52  Act on X or more bans... (that ban people)
53   ...in X seconds
54  Detect +l 1
55  Detect +kl, +li, or +ki in one mode change
56  Self ban protection ignores !@ bans
57  Act on X JOINs/PARTs...
58   ...in X seconds
59  Enable mass join flood protect-
60  Act on X% joins...
61   ...at least X joins required...
62   ...no more than X joins required...
63   ...in X seconds
64  Enable limit protection-
65  Keep limit at X% extra...
66   ...at least X extra...
67   ...no more than X extra...
68   ...and refresh after X seconds
69  Ops immune
70  Voiced users immune
71  Text protections enabled
72  CTCP protections enabled (including DCC)
73  Other protections enabled
74  DCC protection on (invalid DCCs)
75  Seconds before next action
76  Seconds before resetting actions
77  Bitch mode enabled (known/unknown users)
78  Bitch mode for serverops
79  (unused)
80  Halfop users immune
Clone this wiki locally