aircdll - our DLL for mIRC
Copyright (C) 2001, 2002 Gustavo Picon
v30130


Functions:



All functions will return:
	"+<code> [string]" on a success or
	"-<code> [string]" on a failure



SetTitle <hwnd> [string]
	The SetTitle function changes the text of the specified window's title
	bar (if it has one). If the specified window is a control, the text of
	the control is changed. Note that if you modify the title of a mIRC's
	MDI Window, the Switchbar text for that window won't be modified,
	because mIRC handles the switchbar internally.

	Return values:
	"+OK"
	"-BADWIN Invalid HWND"

	$dll(aircdll.dll, SetTitle, $window(Status Window).hwnd MyStatus)
	$dll(aircdll.dll, SetTitle, $window(@blah).hwnd new text)



GetTitle <hwnd>
	The GetTitle function returns the text of the specified window's title
	bar (if it has one). If the specified window is a control, the text of
	the control is returned.

	Return values:
	"+OK"
	"-BADWIN Invalid HWND"

	$dll(aircdll.dll, GetTitle, $window(Status Window).hwnd)
	$dll(aircdll.dll, GetTitle, $window(@blah).hwnd)



SetMircTitle <string>
	Changes the mIRC's window title bar.

	Return values:
	"+OK"

	$dll(aircdll.dll, SetMircTitle, MyScript v0.001)



GetMircTitle
	Returns the mIRC's window title bar.

	Return values:
	"+OK"

	$dll(aircdll.dll, GetMircTitle, -)



GetWindowsDir
	The GetWindowsDir function retrieves the path of the Windows directory.
	The Windows directory contains such files as Win32-based applications,
	initialization files, and help files.

	Return values:
	"+OK"

	$dll(aircdll.dll, GetWindowsDir, -)



GetSystemDir
	The GetSystemDir function retrieves the path of the system directory.
	The system directory contains such files as dynamic-link libraries,
	drivers, and font files.

	Return values:
	"+OK"

	$dll(aircdll.dll, GetSystemDir, -)



GetTempDir
	The GetTempDir function retrieves the path of the Temp directory.
	The Temp directory is the directory designated for temporary files.

	Return values:
	"+OK"

	$dll(aircdll.dll, GetTempDir, -)



HideMenuBar
	Hides the mIRC menubar.

	Return values:
	"+OK"

	$dll(aircdll.dll, HideMenuBar, -)



ShowMenuBar
	Restores the mIRC menubar.

	Return values:
	"+OK"
	"-BADMENU Stored Menu handle is messed up :/"

	$dll(aircdll.dll, ShowMenuBar, -)



MatchTokString <wildstring>
	Stores a string to be used later with the MatchTok function

	Return values:
	"+OK <wildstring>"

	$dll(aircdll.dll, MatchTokString, join #*;visit www*;*xxx*)



MatchTok <+flags> <tokchar> <string>
	Returns the token from the string previously stored with MatchTokString
	that matches the string given. The "tokchar" parameter is the ascii
	value of the character separating the tokens.
	Flags:
	[+r]	the function will consider these characters: , .:-"'()[]_!?
		as spaces (very useful, believe me)
	[+c]	the function will look for case-sensitive matches only
	Notes: if you are going to use this function to match irc text (swearing
	protection, spam protection, etc), you should $strip() the text first and
	then use the +r flag in this function.

	Return values:
	"+OK <token>"
	"-TOKCHAR Invalid token character number"
	"-FOUND No token matched the string"

	$dll(aircdll.dll, MatchTok, +r 59 %somestring)



PickColor [DefColor] [CustomColor1] ... [CustomColor16]
	Creates a Color dialog box that enables the user to select a color. The RGB
	value of the selected color is returned.
	[DefColor]	Default color
	[CustomColorX]	Custom Colors, a [DefColor] parm must be given
	The function stores the parameters given, so if it is called again with missing or
	no parms, the previous parms will be used. If no parms are given and there are no
	previous calls to the function, all parms will default to rgb "0" (black).
	All colors are expressed in rgb numeric values (0-16777215). mIRC's $rgb() function
	may be useful for you.
	
	Return values:
	"+OK <rgbcolor>"
	"-CANCEL User didn't click the OK button"

	$dll(aircdll.dll, PickColor, 125789 45 6423 7456123 789)
	$dll(aircdll.dll, PickColor, )



Flood <desc> <inc> <max> <secs> [+flags]
	This function is the reason why I wrote this dll. Use it to
	replace your inaccurate and slow scripted $flood routine.
	<desc>	is a description of the event you want to control,
		for example: "textflood,*!*@some.host.com"
	<inc>	is the increment for the event, normally it will be
		"1", but if you want to control the bytes sent as PRIVMSG
		in a certain amount of time, you may want to use $len($1-)
		as <inc>
	<max>	is the maximum number allowed before triggering a flood
	<secs>	is the number of seconds used as an interval
	[+k]	if you use the +k flag, the flood counter won't be unset
		after a trigger
	[+t]	if you use the +t flag, the flood counter will increase but
		the flood won't trigger (useful for some script settings like
		"don't trigger on away" or "don't trigger if lagged")
	
	Return values:
	"+FLOOD <count> <secs> <max>" if a flood is triggered or
	"+OK    <count> <secs> <max>" if a flood is not triggered
		count is the current flood count
		secs if the interval since the first event for this counter
	"-INC Invalid inc value"
	"-MAX Invalid max value"
	"-SECS Invalid secs value"
	"-DESC Invalid description"

        ;For a text flood protection:
        ON @*:TEXT:*:#:{
          ; kick on 8 lines in 10 seconds
          var %f = $dll(aircdll.dll, Flood, $+(textfloodL, $chr(44), $wildsite) 1 8 10)
          if (+FLOOD* iswm %f) { !kick $chan $nick Text Flood: $gettok(%f, 2, 32) lines in $gettok(%f, 3, 32) seconds }
          else {
            ; if the previous flood wasn't triggered...
            ; kick on 800 bytes in 12 seconds
            var %f = $dll(aircdll.dll, Flood, $+(textfloodB, $chr(44), $wildsite) $len($1-) 800 12)
            if (+FLOOD* iswm %f) { !kick $chan $nick Text Flood: $gettok(%f, 2, 32) bytes in $gettok(%f, 3, 32) seconds }
          }
        }



Flood2 <desc> <inc> <floodtype> [+flags] [network] [#channel]
	I really recommend you using this function instead of the normal
	'Flood' function. To do so, you must save your flood settings using
	the 'FloodOptSet' function first. This is like 8 times faster than
	getting the flood settings from your script (using variables, hash
	tables, ini files, etc) and passing them to the old 'Flood' function.
	The <desc>, <inc> and [+flags] parameters are the same as in the
	'Flood' function, but in 'Flood2' the [+flags] parameter can also take
	these two flags:
	[+n]	You must use this if you are using the [network] parameter
	[+c]	You must use this if you are using the [#channel] parameter

	The priorities used to get the valid settings are:
	1. Channel/network specific setting
	2. Channel specific setting
	3. Network specific setting
	4. Default, global setting
	This means that if you use the 'Flood2' function with both the [network] and
	the [#channel] parameters, the dll will look for a channel/network setting
	first, if there is no valid channel/network setting, a channel specific setting
	will be used, then a network specific setting, and then the default setting.
	If there is no valid setting for <floodtype>, an error will be returned.

	Note:	You can use the 'Flood' and the 'Flood2' functions with the same
		flood counter.
	Tip:	You can use the [network] or the [#channel] parameters to do different
		stuff, like userlevel specific flood settings or things like that.
		Be creative.

	Return values:
	"+FLOOD <count> <secs> <max>" if a flood is triggered or
	"+OK    <count> <secs> <max>" if a flood is not triggered
		count is the current flood count
		secs if the interval since the first event for this counter
	"-INC Invalid inc value"
	"-MAX Invalid max value"
	"-SECS Invalid secs value"
	"-DESC Invalid description"
	"-TYPE Invalid Flood Type"
	"-OFF Flood setting off"
	"-ERR Flood setting not found"

        $dll(aircdll.dll, Flood, $+(textfloodL, $chr(44), $wildsite) 1 textfloodL)
        $dll(aircdll.dll, Flood, $+(textfloodL, $chr(44), $wildsite) $len($1-) textfloodB +c #lamest)
        $dll(aircdll.dll, Flood, $+(textfloodL, $chr(44), $wildsite) $len($1-) textfloodB +n EFnet)
        $dll(aircdll.dll, Flood, $+(textfloodL, $chr(44), $wildsite) $len($1-) textfloodB +nc Undernet #lamest)



FloodExpire
	This function will remove all the expired flood counters

	Return values:
	"+OK <removed> <remaining>"
		removed is the number of removed entries
		remaining is the number of remaining entries

	$dll(aircdll.dll, FloodExpire, -)



FloodDel <desc>
	This function will remove a flood counter.

	Return values:
	"+OK"
	"-DESC Invalid description"
	"-NOTFOUND Flood entry not found"

	$dll(aircdll.dll, FloodDel, $+(textfloodL, $chr(44), $wildsite))



FloodDelMatch <match>
	This function will remove all the matching flood counters with a
	matching description.

	Return values:
	"+OK <removed> <remaining>"
		removed is the number of removed entries
		remaining is the number of remaining entries
	"-MATCH Invalid match expression"

	$dll(aircdll.dll, FloodDelMatch, textflood*)



FloodGet <desc>
	Returns the flood count for an entry.

	Return values:
	"+OK <count>"
	"-DESC Invalid description"
	"-NOTFOUND Flood entry not found"

	$dll(aircdll.dll, FloodGet, $+(textfloodL, $chr(44), $wildsite))



FloodCount
	Returns the number of flood nodes

	Return values:
	"+OK <nodes>"

	$dll(aircdll.dll, FloodCount, -)



FloodClear
	Clears the entire flood list.

	Return values:
	"+OK <removed_nodes>"

	$dll(aircdll.dll, FloodClear, -)



FloodOptSet <floodtype> <max> <secs> [+ncd] [network] [#channel]
	Sets a flood setting.
	<max>	is the maximum number allowed before triggering a flood
	<secs>	is the number of seconds used as an interval
	[+n]	You must use this if you are using the [network] parameter
	[+c]	You must use this if you are using the [#channel] parameter
	[+d]	The flood setting is disabled

	Return values:
	"+OK"
	"-FLAGS Invalid Flags"
	"-MAX Invalid max value"
	"-SECS Invalid secs value"
	"-TYPE Invalid Flood type"

	$dll(aircdll.dll, FloodOptSet, textfloodL 8 10)
	$dll(aircdll.dll, FloodOptSet, textfloodB 800 12 +c #lamest)
	$dll(aircdll.dll, FloodOptSet, textfloodB 800 12 +n Undernet)



FloodOptDel <floodtype> [+nc] [network] [#channel]
	Clears a flood setting.

	Return values:
	"+OK"
	"-TYPE Invalid Flood type"
	"-ERR Flood setting not found"

	$dll(aircdll.dll, FloodOptDel, textfloodL)
	$dll(aircdll.dll, FloodOptDel, textfloodL +c #lamest)



FloodOptDelMatch <match> [+nc] [network|*netmask*] [#channel|*chanmask*]
	Clears the matching flood settings

	Return values:
	"+OK <removed_options>"
	"-TYPE Invalid Flood type"

	$dll(aircdll.dll, FloodOptDelMatch, textflood*)
	$dll(aircdll.dll, FloodOptDelMatch, * +c #lamest)
	$dll(aircdll.dll, FloodOptDelMatch, ctcp* +nc ???net *mirc*)



FloodOptGet <floodtype> [+nc] [network] [#channel]
	Returns the specified flood settings: "max secs"

	Return values:
	"+OK <max> <secs> <state>"
	"-TYPE Invalid Flood type"
	"-ERR Flood setting not found"

	$dll(aircdll.dll, FloodOptGet, textflood)
	$dll(aircdll.dll, FloodOptGet, textflood +c #lamest)
	$dll(aircdll.dll, FloodOptGet, textflood +n DALnet)
	$dll(aircdll.dll, FloodOptGet, textflood +nc Undernet #lamest)



FloodOptGets <floodtype> [+nc] [network] [#channel]
	Returns the specified flood settings: "max secs"
	The priorities used to get the valid settings are:
	1. Channel/network specific setting
	2. Channel specific setting
	3. Network specific setting
	4. Default, global setting

	Return values:
	"+OK <max> <secs> <state>"
	"-TYPE Invalid Flood type"
	"-ERR Flood setting not found"

	$dll(aircdll.dll, FloodOptGets, textflood)
	$dll(aircdll.dll, FloodOptGets, textflood +c #lamest)
	$dll(aircdll.dll, FloodOptGets, textflood +n DALnet)
	$dll(aircdll.dll, FloodOptGets, textflood +nc Undernet #lamest)



FloodOptGetMatch <match> <N> [+nc] [network] [#channel]
	Returns the Nth matching flood setting. If N is 0, returns the
	number of matching settings.

	Return values:
	"+OK <count>"    if N is 0
	"+OK <type> <max> <secs> [+flags] [network] [chan]"
	"-TYPE Invalid Flood type"
	"-NUM Invalid Match Number"
	"-"NOMATCH No match found""

	$dll(aircdll.dll, FloodOptGet, textflood 5)
	$dll(aircdll.dll, FloodOptGet, textflood 0 +c #lamest)
	$dll(aircdll.dll, FloodOptGet, textflood 3 +n DALnet)
	$dll(aircdll.dll, FloodOptGet, textflood 2 +nc Undernet #lamest)



FloodOptNetchan <N>
	Returns the matching network/channel with flood settings. If N is 0
	the number of network/channels with flood settings will be returned.

	Return values:
	"+OK <count>"    if N is 0
	"+OK [+cn] [network] [chan]"
	"-NUM Invalid Match Number"
	"-"NOMATCH No match found""

	$dll(aircdll.dll, FloodOptNetchan, 5)
	$dll(aircdll.dll, FloodOptNetchan, 0)



FloodOptCount
	Returns the number of flood settings

	Return values:
	"+OK <total>"

	$dll(aircdll.dll, FloodOptCount, -)



FloodOptClear
	Clears the entire flood settings list.

	Return values:
	"+OK <removed_items>"

	$dll(aircdll.dll, FloodOptClear, -)



FloodOptLoad <file>
	Loads a flood settings file previously saved by 'FloodOptSave'

	Return values:
	"+OK <entries_loaded>"
	"-FILE Invalid File"
	"-NOFILE File not found or invalid"
	"-OPEN Couldn't open file."
	"-FOPTFILE Invalid Flood Options File"

	$dll(aircdll.dll, FloodOptLoad, settings\floodprot.ini)



FloodOptSave <file>
	Saves the flood settings to a file.

	Return values:
	"+OK <entries_saved>"
	"-FILE Invalid File"
	"-OPEN Couldn't open file."

	$dll(aircdll.dll, FloodOptSave, settings\floodprot.ini)



OptTableAdd <table>
	Creates a settings table

	Return values:
	"+OK"
	"-TABLE Invalid table name"
	"-DUP There is already a table with that name"
	
	$dll(aircdll.dll, OptTableAdd, mainsettings)



OptTableDel <table>
	Removes a settings table

	Return values:
	"+OK"
	"-TABLE Invalid table name"
	"-NOTFOUND Table not found"
	
	$dll(aircdll.dll, OptTableDel, mainsettings)



OptTableDelMatch <*table*>
	Removes the matching setting tables

	Return values:
	"+OK <removed> <remaining>"
	"-MATCH Invalid match expression"
	
	$dll(aircdll.dll, OptTableDelMatch, main*)



OptTableCount
	Returns the number of stored setting tables

	Return values:
	"+OK <total>"
	
	$dll(aircdll.dll, OptTableCount, -)



OptTableClear
	Removes all the setting tables

	Return values:
	"+OK <removed_tables>"
	
	$dll(aircdll.dll, OptTableClear, -)



OptTableLoad <table> <file>
	Loads a table settings file previously saved by 'OptTableSave' to the
	specified table.

	Return values:
	"+OK <entries_loaded>"
	"-TABLE Invalid table name"
	"-FILE Invalid File"
	"-NOFILE File not found or invalid"
	"-OPEN Couldn't open file."
	"-OPTFILE Invalid Options File"

	$dll(aircdll.dll, OptTableLoad, mainsettings settings\main.ini)



OptTableSave <table> <file>
	Saves the settings table to a file.

	Return values:
	"+OK <entries_saved>"
	"-TABLE Invalid table name"
	"-FILE Invalid File"
	"-OPEN Couldn't open file."
	
	$dll(aircdll.dll, OptTableSave, mainsettings settings\main.ini)



OptSet <table> <+[nc]> [network] [#channel] <item> [data]
	Addas an item to an existing setting table.
	Flags:
	[+n]	You must use this if you are using the [network] parameter
	[+c]	You must use this if you are using the [#channel] parameter

	Return values:
	"+OK"
	"-TABLE Invalid table name"
	"-FLAGS Invalid flags"
	"-ITEM Invalid item name"
	
	$dll(aircdll.dll, OptSet, scriptoptions + checklaginterval 10)
	$dll(aircdll.dll, OptSet, mainsettings +n Dalnet autojoin #aIRC #lamest)
	$dll(aircdll.dll, OptSet, blah +c #aIRC bitchmode TRUE)
	$dll(aircdll.dll, OptSet, bleh +nc Efnet #lamest stuff data)



OptDel <table> <+[nc]> [network] [#channel] <item>
	Removes an item from a setting table

	Return values:
	"+OK"
	"-TABLE Invalid table name"
	"-ITEM Invalid item name"
	"-ERR Setting not found"
	
	$dll(aircdll.dll, OptDel, bleh +nc Efnet #lamest stuff)



OptDelMatch <table> <+[nc]> [network|*netmask*] [#channel|*chanmask*] <*item*>
	Removes the matching items from a setting table

	Return values:
	"+OK <removed_items>"
	"-TABLE Invalid table name"
	"-ITEM Invalid item name"
	
	$dll(aircdll.dll, OptDelMatch, bleh +nc *net #* *mode)



OptGet <table> <+[nc]> [network] [#channel] <item>
	Returns the data of an item in a setting table.

	Return values:
	"+OK [data]"
	"-TABLE Invalid table name"
	"-ITEM Invalid item name"
	"-ERR Setting not found"
	
	$dll(aircdll.dll, OptGet, bleh +nc Efnet #lamest stuff)



OptGets <table> <+[nc]> [network] [#channel] <item>
	Returns the data of an item in a setting table.
	The priorities used to get the valid settings are:
	1. Channel/network specific setting
	2. Channel specific setting
	3. Network specific setting
	4. Default, global setting
	This means that if you use the 'OptGets' function with both the [network] and
	the [#channel] parameters, the dll will look for a channel/network setting
	first, if there is no valid channel/network setting, a channel specific setting
	will be used, then a network specific setting, and then the default setting.

	Return values:
	"+OK [data]"
	"-TABLE Invalid table name"
	"-ITEM Invalid item name"
	"-ERR Setting not found"
	
	$dll(aircdll.dll, OptGets, bleh +nc Efnet #lamest stuff)



OptGetMatch <table> <+[nc]> [network] [#channel] <item> <N>
	Returns the Nth matching setting. If N is 0, returns the number of
	matching settings.

	Return values:
	"+OK <count>"   if N is 0
	"+OK <item> <+flags> [network] [channel] [data]
	"-TABLE Invalid table name"
	"-ITEM Invalid item name"
	"-NUM Invalid Match Number"
	"-NOMATCH No match found"
	
	$dll(aircdll.dll, OptGetMatch, bleh +nc *net #* *mode 0)



OptNetchan <table> <N>
	Returns the matching network/channel with settings in the table. If N is
	0 the number of network/channels with settings will be returned.

	Return values:
	"+OK <count>"   if N is 0
	"+OK [+flags] [network] [channel]"
	"-TABLE Invalid table name"
	"-NUM Invalid Match Number"
	"-NOMATCH No match found"
	
	$dll(aircdll.dll, OptNetchan, blah 5)
	$dll(aircdll.dll, OptNetchan, bleh 0)



OptCount <table>
	Returns the number of items in a setting table

	Return values:
	"+OK <count>"
	"-TABLE Invalid table name"
	
	$dll(aircdll.dll, OptCount, bleh)



OptClear <table>
	Removes all the items in a table. It WON'T remove the table itself. If
	you want to remove a table, use the 'OptTableDel' function

	Return values:
	"+OK <count>"
	"-TABLE Invalid table name"
	
	$dll(aircdll.dll, OptClear, bleh)



UserNetwAdd <Network>
	Adds a network-specific Userlist Table. Note that there is a global
	userlist table called "-"

	Return values:
	"+OK"
	"-NETW Invalid Network"
	
	$dll(aircdll.dll, UserNetwAdd, Undernet)



UserNetwDel <Network>
	Removes a network-specific Userlist Table. The global userlist table
	can't be removed.

	Return values:
	"+OK"
	"-NETW Invalid Network"
	"-FOUND Network setting not found"
	
	$dll(aircdll.dll, UserNetwDel, DALnet)



UserNetwGet <Network|N>
	Retrieves the number of the Nth userlist table

	Return values:
	"+OK <network>"
	"-NUMBER Invalid number"
	"-FOUND Entry not found"
	
	$dll(aircdll.dll, UserNetwGet, 3)
	$dll(aircdll.dll, UserNetwGet, EFnet)



UserNetwCount
	Retrieves the number of userlist tables. The number is _always_ > 0
	because of the global "-" table.

	Return values:
	"+OK <total>"
	
	$dll(aircdll.dll, UserNetwCount, -)



UserNetwClear
	Removes all the network specific userlist tables. It won't remove the
	global "-" table. This function will return the number of removed tables.

	Return values:
	"+OK <removed>"
	
	$dll(aircdll.dll, UserNetwClear, -)



UserAdd <Network|-> <Handle>
	Adds a user to the list.

	Return values:
	"+OK"
	"-HANDLE Invalid Handle"
	"-DUP That handle is already in the list"
	
	$dll(aircdll.dll, UserAdd, foonet Newuser)



UserDel <Network|-> <Handle>
	Removes a user from the list.

	Return values:
	"+OK"
	"-HANDLE Invalid Handle"
	"-NOTFOUND Handle not found in the list"
	
	$dll(aircdll.dll, UserDel, foonet Newuser



UserRen <Network|-> <oldHandle> <Handle>
	Renames a user in the list

	Return values:
	"+OK"
	"-OLD Invalid old handle"
	"-NEW Invalid new handle"
	"-NOTFOUND Handle not found in the list"
	"-DUP There is already a user with the new handle"
	
	$dll(aircdll.dll, UserRen, foonet Oldname Newname)



UserCount <Network|->
	Returns the number of users in the list

	Return values:
	"+OK <total>"
	
	$dll(aircdll.dll, UserCount, foonet)



UserGet <Network|-> <N>
	Returns the Nth user in the list.

	Return values:
	"+OK <handle>"
	"-NUM Invalid Index Number"
	"-NOUSER No user for that index"
	
	$dll(aircdll.dll, UserGet, foonet 2)



UserIs <Network|-> <Handle>
	Returns 1 or 0 depending if the user is in the userlist

	Return values:
	"+OK 1"   if the user is in the userlist
	"+OK 0"   if the user is not in the userlist
	
	$dll(aircdll.dll, UserIs, foonet someuser)



UserChrecAdd <Network|-> <Handle> <Channel>
	Adds a channel record to a user

	Return values:
	"+OK"
	"-USER No such user"
	"-CHAN Invalid Channel"
	"-DUP Duplicated channel record for the user"
	
	$dll(aircdll.dll, UserChrecAdd, foonet someuser #lamest)



UserChrecDel <Network|-> <Handle> <Channel>
	Removes a channel record from a user

	Return values:
	"+OK"
	"-USER No such user"
	"-CHAN Invalid Channel"
	"-CHREC No such channel record for the user"
	
	$dll(aircdll.dll, UserChrecDel, foonet someuser #lamest)



UserChrecGet <Network|-> <Handle> <N>
	Gets the name of the Nth channel for a user. Is N is 0, gets the total
	number of channels for a user.

	Return values:
	"+OK <total>"    if N is 0
	"+OK <channel>"
	"-USER No such user"
	"-NUM Invalid Index Number"
	"-NOCHAN No channel for that Index"
	
	$dll(aircdll.dll, UserChrecGet, foonet someuser 4)
	$dll(aircdll.dll, UserChrecGet, foonet someuser 0)



UserChrecIs <Network|-> <Handle> <Channel>
	Returns 1 or 0 depending if there is a channel record for a user.

	Return values:
	"+OK 1"   if the user is in the userlist
	"+OK 0"   if the user is not in the userlist
	"-USER No such user"
	"-CHAN Invalid Channel"
	
	$dll(aircdll.dll, UserChrecIs, foonet someuser #lamest)



UserFlagsSet <Network|-> <handle> <+[flags]> [chan]
	Sets flags to a user, flags can be assigned to a channel or be global

	Return values:
	"+OK"
	"-USER No such user"
	"-FLAGS Invalid Flags"
	"-CHAN Invalid Channel"
	
	$dll(aircdll.dll, UserFlagsSet, foonet someuser +ao #lamest)
	$dll(aircdll.dll, UserFlagsSet, foonet someuser +k)



UserFlagsGet <Network|-> <handle> [chan]
	Returns the flags assigned to a user

	Return values:
	"+OK [flags]"
	"-USER No such user"
	"-CHAN No such channel record for the user"
	
	$dll(aircdll.dll, UserFlagsGet, foonet someuser #lamest)
	$dll(aircdll.dll, UserFlagsGet, foonet someuser)



UserFlagsGets <Network|-> <handle> [chan]
	Returns the flags assigned to a user
	If a channel is given, the function will check for channel-specific flags first,
	then for global flags.

	Return values:
	"+OK <flags>"
	"-USER No such user"
	
	$dll(aircdll.dll, UserFlagsGets, foonet someuser #lamest)
	$dll(aircdll.dll, UserFlagsGets, foonet someuser)



UserFlagsGetd <Network|-> <handle> [chan]
	Returns the flags assigned to a user.
	If a channel is given, the function will return the channel flags and the global
	flags concatenated.

	Return values:
	"+OK <flags>"
	"-USER No such user"
	
	$dll(aircdll.dll, UserFlagsGetd, foonet someuser #lamest)
	$dll(aircdll.dll, UserFlagsGetd, foonet someuser)



UserEntrySet <Network|-> <handle> <type> <string>
	Sets an entry for a user, type can be one of:
	COMMENT INFO LASTON PASS BOTADDR BOTFL CONSOLE DCCDIR FWD FSTAT

	Return values:
	"+OK"
	"-USER No such user"
	"-TYPE Invalid entry type"
	"-DATA Invalid data"
	"-DUPHOST That hostmask is already assigned to a user."
	
	$dll(aircdll.dll, UserEntrySet, foonet someuser COMMENT comment for the user)



UserEntryDel <Network|-> <handle> <type [N]>
	Removes an entry from a user, type can be one of:
	COMMENT INFO LASTON PASS BOTADDR BOTFL CONSOLE DCCDIR FWD FSTAT HOSTS XTRA
	When removing HOSTS or XTRA entries, an index N must be given.

	Return values:
	"+OK"
	"-USER No such user"
	"-TYPE Invalid entry type"
	"-NUMBER Invalid number"
	"-MATCH No such entry"
	
	$dll(aircdll.dll, UserEntryDel, foonet someuser COMMENT)
	$dll(aircdll.dll, UserEntryDel, foonet someuser XTRA 3)



UserEntryGet <Network|-> <handle> <type [N]>
	Returns the value of an entry from a user, type can be one of:
	COMMENT INFO LASTON PASS BOTADDR BOTFL CONSOLE DCCDIR FWD FSTAT HOSTS XTRA
	When retrieving HOSTS or XTRA entries, an index N must be given.
	If N is 0, the number of HOSTS or XTRA entries will be returned

	Return values:
	"+OK [data]"
	"-USER No such user"
	"-TYPE Invalid entry type"
	"-NUMBER Invalid number"
	"-MATCH No such entry"
	
	$dll(aircdll.dll, UserEntryGet, foonet someuser COMMENT)
	$dll(aircdll.dll, UserEntryGet, foonet someuser XTRA 3)



UserEntrySetW <Network|-> <handle> <"HOSTS"|"XTRA"> <word> <string>
	Sets an entry for a user, type must be HOSTS or XTRA

	Return values:
	"+OK"
	"-USER No such user"
	"-WORD Invalid word"
	"-TYPE Invalid entry type"
	"-DATA Invalid data"
	"-DUPHOST That hostmask is already assigned to a user."
	
	$dll(aircdll.dll, UserEntrySetW, foonet someuser XTRA created $ctime)



UserEntryDelW <Network|-> <handle> <"HOSTS"|"XTRA"> <word>
	Removes an entry from a user, type must be HOSTS or XTRA

	Return values:
	"+OK"
	"-USER No such user"
	"-WORD Invalid word"
	"-TYPE Invalid entry type"
	"-MATCH No such entry"
	
	$dll(aircdll.dll, UserEntryDelW, foonet someuser XTRA created)



UserEntryGetW <Network|-> <handle> <"HOSTS"|"XTRA"> <word>
	Retrieves an entry from a user, type must be HOSTS or XTRA

	Return values:
	"+OK [data]"
	"-USER No such user"
	"-WORD Invalid word"
	"-TYPE Invalid entry type"
	"-MATCH No such entry"
	
	$dll(aircdll.dll, UserEntryGetW, foonet someuser XTRA created)



UserHost2Flags <Network|-> <address> [channel]
	Returns the flags for the user that matches the address given.
	The address should be a full address.
	If a channel is given, the function will check for channel-specific flags first,
	then for global flags.

	Return values:
	"+OK <handle> [flags]"
	"-MATCH There is no user matching that address"
	
	$dll(aircdll.dll, UserHost2Flags, foonet nick!blah@host.com #lamest)
	$dll(aircdll.dll, UserHost2Flags, foonet nick!blah@host.com)



UserHost2FlagsD <Network|-> <address> [channel]
	Returns the flags for the user that matches the address given.
	The address should be a full address.
	If a channel is given, the function will return the channel flags and the global
	flags concatenated.

	Return values:
	"+OK <handle> <flags>"
	"-MATCH There is no user matching that address"
	
	$dll(aircdll.dll, UserHost2FlagsD, foonet nick!blah@host.com #lamest)
	$dll(aircdll.dll, UserHost2FlagsD, foonet nick!blah@host.com)



UserHost2Handle <Network|-> <address>
	Returns the handle of the user that matches the address given.
	The address should be a full address.

	Return values:
	"+OK <handle>"
	"-MATCH There is no user matching that address"
	
	$dll(aircdll.dll, UserHost2Handle, foonet nick!blah@host.com)



UserLastonSet <Network|-> <handle> <where> [when]
	Sets the LASTON user field for a user. If the <where> parameter is a channel
	and the user has a channel entry for that channel, the LASTON info for the
	channel will also be updated. If you give the function a [when] parameter, it
	must be a valid CTIME number. If no when parameter is given, the current ctime
	will be used.

	Return values:
	"+OK"
	"-USER No such user"
	"-WHERE Invalid location"
	"-WHEN Invalid ctime number"
	
	$dll(aircdll.dll, UserLastonSet, foonet someuser #lamest)
	$dll(aircdll.dll, UserLastonSet, foonet someuser partyline [ $ctime ] )



UserLastonGet <Network|-> <handle> [channel]
	Returns the LASTON info for a user in ctime format

	Return values:
	"+OK <ctime>"
	"-USER No such user"
	"-CHAN No laston record for that channel"
	"-LASTON Unknown laston Info"
	
	$dll(aircdll.dll, UserLastonGet, foonet someuser #lamest)
	$dll(aircdll.dll, UserLastonGet, foonet someuser)



UserSetChanInfo <Network|-> <handle> <channel> <info>
	Sets a channel info field for a user.

	Return values:
	"+OK"
	"-USER No such user"
	"-CHAN Invalid Channel"

	$dll(aircdll.dll, UserSetChanInfo, foonet someuser #lamest blah blah)



UserGetChanInfo <Network|-> <handle> <channel>
	Retrieves a channel info field from a user.

	Return values:
	"+OK [info]"
	"-USER No such user"
	"-CHAN Invalid Channel"

	$dll(aircdll.dll, UserGetChanInfo, foonet someuser #lamest)



UserDelChanInfo <Network|-> <handle> <channel>
	Removes a channel info field from a user.

	Return values:
	"+OK [info]"
	"-USER No such user"
	"-CHAN Invalid Channel"

	$dll(aircdll.dll, UserGetChanInfo, foonet someuser #lamest)



UserLoad <Network|-> <file>
	Loads a users settings file previously saved by 'UserSave'

	Return values:
	"+OK <users_loaded> <file_lines>"
	"-FILE Invalid File"
	"-NOFILE File not found or invalid"
	"-OPEN Couldn't open file."
	"-UFILE Invalid Userfile"

	$dll(aircdll.dll, UserLoad, foonet settings\users.ini)



UserSave <Network|-> <file>
	Saves the users settings to a file.

	Return values:
	"+OK"
	"-FILE Invalid File"
	"-OPEN Couldn't open file."

	$dll(aircdll.dll, UserSave, foonet settings\users.ini)



UserIbeiAdd <Network|-> +<i|b|e|I>[s] <channel|-> <mask> <creator> <created>...
            ...<expire> <lastactive> <comment>
	Adds an ibeI (ignore, ban, exempt or Invite) entry to the userlist. Ignores
	can't be channel specific.
	The +s flag means that it will be a sticky entry. If the "expire" parm
	is 0, it means that the entry is permanent.
	If the "created" parm is "0", the current time will be used.
	If channel is "-", it means that the entry is global.

	Return values:
	"+OK"
	"-FLAGS Invalid Flags"
	"-TYPE Invalid ibeI type"
	"-MASK Invalid Mask"
	"-CREATOR Invalid creator"

	$dll(aircdll.dll, UserIbeiAdd, foonet +b #lamest *!*@* tabo $ctime 0 0 lameness)
	$dll(aircdll.dll, UserIbeiAdd, foonet +i - *!*blah@*.net tabo $ctime 0 0 flood)



UserIbeiDel <Network|-> +<i|b|e|I> <channel|-> <mask>
	Removes an ibeI (ignore, ban, exempt or Invite) entry from the userlist.

	Return values:
	"+OK"
	"-FLAGS Invalid Flags"
	"-TYPE Invalid ibeI type"
	"-MASK Invalid Mask"
	"-ERR Entry not found"

	$dll(aircdll.dll, UserIbeiDel, foonet +b #lamest *!*@*.aol.com)
	$dll(aircdll.dll, UserIbeiDel, foonet +i - *!*blah@*.something.net)



UserIbeiGet <Network|-> +<i|b|e|I> <channel|-> <mask>
	Retrieves an ibeI (ignore, ban, exempt or Invite) entry from the
	userlist.

	Return values:
	"+OK <mask>:[+]<expire>:<creator>:<set_time>:<comment>"
	  for ignores, the [+] symbol means that the entry is permanent
	"+OK <mask>:[+]<expire>[*]:+<set_time>:<lastset>:<creator>:<comment>"
	  for bans, exempts and Invites, the [+] symbol means that the
	  entry is permanent, the [*] symbol means that the entry is sticky
	"-FLAGS Invalid Flags"
	"-TYPE Invalid ibeI type"
	"-MASK Invalid Mask"
	"-ERR Entry not found"

	$dll(aircdll.dll, UserIbeiGet, foonet +b #lamest *!*@*.aol.com)
	$dll(aircdll.dll, UserIbeiGet, foonet +i - *!*blah@*.something.net)



UserIbeiGetn <Network|-> +<i|b|e|I> <channel|-> <entry_number>
	Retrieves the Nth ibeI (ignore, ban, exempt or Invite) entry from the
	userlist. If "entry_number" is 0, the number of entries is returned.

	Return values:
	"+OK <number>" if "entry_number" was 0
	"+OK <mask>:[+]<expire>:<creator>:<set_time>:<comment>"
	  for ignores, the [+] symbol means that the entry is permanent
	"+OK <mask>:[+]<expire>[*]:+<set_time>:<lastset>:<creator>:<comment>"
	  for bans, exempts and Invites, the [+] symbol means that the
	  entry is permanent, the [*] symbol means that the entry is sticky
	"-FLAGS Invalid Flags"
	"-TYPE Invalid ibeI type"
	"-NUMBER Invalid Number"
	"-ERR Entry not found"

	$dll(aircdll.dll, UserIbeiGetn, foonet +b #lamest 5)
	$dll(aircdll.dll, UserIbeiGetn, foonet +i - 3)



UserIbeiMatch <Network|-> +<i|b|e|I> <channel|-> <address>
	Finds the best match (if any) for an address in an ibeI list. If you
	give a channel, the function will look for a match in the channel list
	first, if there isn't any, it will look in the global list "-".

	Return values:
	"+OK <mask>:[+]<expire>:<creator>:<set_time>:<comment>"
	  for ignores, the [+] symbol means that the entry is permanent
	"+OK <mask>:[+]<expire>[*]:+<set_time>:0:<creator>:<comment>"
	  for bans, exempts and Invites, the [+] symbol means that the
	  entry is permanent, the [*] symbol means that the entry is sticky
	"-FLAGS Invalid Flags"
	"-TYPE Invalid ibeI type"
	"-ADDRESS Invalid Address"
	"-NOMATCH No entry matched the address"

	$dll(aircdll.dll, UserIbeiMatch, foonet +b #lamest *!*@*.aol.com)
	$dll(aircdll.dll, UserIbeiMatch, foonet +i - *!*blah@*.something.net)



UserIbeiCount <Network|-> +<i|b|e|I> <channel|->
	Returns the number of ibeI entries for a channel.

	Return values:
	"+OK <count>"
	"-FLAGS Invalid Flags"
	"-TYPE Invalid ibeI type"
	"-FOUND Channel not found"

	$dll(aircdll.dll, UserIbeiCount, foonet +b #lamest)
	$dll(aircdll.dll, UserIbeiCount, foonet +i -)



UserIbeiExpire <Network|->
	Removes all the expired entries for a network.

	Return values:
	"+OK <removed_entries>"

	$dll(aircdll.dll, UserIbeiExpire, foonet)
	$dll(aircdll.dll, UserIbeiExpire, -)



UserIbeiChanCount <Network|-> +<i|b|e|I>
	Returns the number of channels with custom ibeI settings.
	There will be always >=1 channels because of the "-" channel

	Return values:
	"+OK <count>"
	"-FLAGS Invalid Flags"
	"-TYPE Invalid ibeI type"

	$dll(aircdll.dll, UserIbeiChanCount, foonet +b)
	$dll(aircdll.dll, UserIbeiChanCount, foonet +i)



UserIbeiChanDel <Network|-> +<i|b|e|I> <Channel>
	Removes a channel from a ibeI table. You can't remove the "-" channel.

	Return values:
	"+OK"
	"-FLAGS Invalid Flags"
	"-TYPE Invalid ibeI type"
	"-CHAN Invalid channel"
	"-FOUND Channel not found"

	$dll(aircdll.dll, UserIbeiChanDel, foonet +b #lamest)



UserIbeiChanGet <Network|-> +<i|b|e|I> <Channel|N>
	Returns the Nth channel in a ibeI list.

	Return values:
	"+OK <channel>"
	"-FLAGS Invalid Flags"
	"-TYPE Invalid ibeI type"
	"-CHAN Invalid channel"
	"-FOUND Channel not found"

	$dll(aircdll.dll, UserIbeiChanGet, foonet +b #lamest)



UserIbeiMod <Network|-> +<i|b|e|I> <channel|-> <mask> <field> <value>
	Modifies the value of a field in an ibeI entry. A field must be one
	of:
	- creator    (string)
	- comment    (string)
	- created    (ctime)
	- expire     (ctime)
	- lastactive (ctime)
	- sticky     (boolean)
	

	Return values:
	"+OK <channel>"
	"-FLAGS Invalid Flags"
	"-TYPE Invalid ibeI type"
	"-MASK Invalid Mask"
	"-CREATOR Invalid creator"
	"-CREATED Invalid created value."
	"-EXPIRE Invalid expire value."
	"-LASTACTIVE Invalid lastactive value."
	"-FIELD Unknown field for an ibeI entry"
	"-ERR Entry not found"

	$dll(aircdll.dll, UserIbeiMod, foonet +b #lamest *!*@~*.net creator tabo)
	$dll(aircdll.dll, UserIbeiMod, foonet +b #lamest *!*@~*.net lastactive $ctime)



UserCopy <<Network|-> <handle>> <<Network|-> <handle>> <+[o]>
	Copies a user from a network table to another. It can be used to copy
	the user to the same network table, but another handle must be used.
	If the target user exists, the default behavior is just to update the
	fields that exist in the source user and doesn't exist in the target
	user. If the +o option is used, all the info from the source user will
	be copied to the target user.
	Note that if you want a exact copy of the source user, you must UserDel
	the target user first, then call UserCopy.

	Return values:
	"+OK"
	"-NETW1 Invalid Source Network"
	"-USER1 Invalid Source User"
	"-NETW2 Invalid Target Network"
	"-USER2 Invalid Target User"
	"-SAME The source and target netw/user are the same"

	$dll(aircdll.dll, UserCopy, - idiot FOOnet lOsEr +o)
	$dll(aircdll.dll, UserCopy, DALnet blah - bleh +)



winamp <cmd> [parms]
	Sends a command to winamp. This will work with winamp 2.x.
	Commands:
	  prev              (previous track button)
	  play              (play button)
	  pause             (pause/unpause button)
	  stop              (stop button)
	  next              (next track button)
	  rew5              (fast rewind 5 seconds)
	  fadestop          (fadeout and stop)
	  ffwd5             (fast forward 5 seconds)
	  plstart           (start of playlist)
	  openurl           (open url dialog)
	  stopatend         (stop after current track)
	  plend             (go to end of playlist)
	  fileinfo          (open file dialog)
	  visoptions        (open visualization options)
	  vispluginoptions  (open visualization plug-in options)
	  vispluginrun      (execute current visualization plugin)
	  titlescroll       (toggle title autoscrolling)
	  winshade          (toggle windowshade)
	  plshade           (toggle playlist windowshade)
	  double            (toggle doublesize mode)
	  visible           (toggle main window visible)
	  minibrowser       (toggle minibrowser)
	  easymove          (toggle easymove)
	  repeat            (toggle repeat)
	  shuffle           (toggle shuffle)
	  jump2time         (open jump to time dialog)
	  jump2file         (open jump to file dialog)
	  skinsel           (open skin selector)
	  vispluginconfig   (configure current visualization plugin)
	  skinreload        (reload current skin)
	  exit              (close winamp)
	  plback10          (move back 10 tracks in playlist)
	  cdplay            (play audio cd)
	  eq                (toggles the EQ window)
	  pl                (toggles the playlist window)
	  volup             (turns the volume up a little (1%))
	  voldown           (turns the volume down a little (1%))
	  fileplay          (pops up the load file(s) box)
	  prefs             (pops up the preferences)
	  ontop             (toggles always on top)
	  about             (pops up the about box)
	  version           (retrieves the version of winamp running)
	  plclear           (clears winamp's internal playlist)
	  plplaysel         (begins play of selected track)
	  isplaying         (returns the status of playback, if the returned
	                     value is 1, winamp is playing, if it's 3, winamp
	                     is paused, else, playback is stopped)
	  getoutputtime <i> (if <i> is 0, returns the position in milliseconds
	                     of playback. if <i> is 1, returns current data
	                     length in seconds. returns -1 if not playing or on
	                     error)
	  jumptotime <time> (seeks within the current track, <time> is in ms)
	  plwrite           (writes the current playlist in
	                     <winampdir>\winamp.m3u and returns the current
	                     position in the playlist, the first entry in the
	                     playlist is number 0)
	  plsetpos <pos>    (sets the playlist position to the position in
	                     <pos>, the first entry in the playlist is number
	                     0)
	  setvol <vol>      (sets the volme to <vol> which can be between 0
	                     (silent) and 255 (maximum))
	  setpan <pan>      (sets the panning to <pan>, which can be between 0
	                     (all left) and 255 (all right).)
	  plgetlength       (returns the length of the current playlist, in
	                     tracks)
	  plgetpos          (returns the position in the current playlist, in
	                     tracks, the first entry in the playlist is number
	                     0)
	  gettrackinfo <i>  (returns info about the current playing track.
	                     returns samplerate (i.e. 44) if <i> is set to 0,
	                     bitrate if <i> is set to 1, and number of channels
	                     if <i> is set to 2)
	  geteqdata <data>  (Retrieves one element of equalizer data, based on
	                     what 'data' is set to.
	                     0-9  The 10 bands of EQ data. Will return 0-63
	                          (+20db - -20db)
	                     10   The preamp value. Will return 0-63
	                          (+20db - -20db)
	                     11   Enabled. Will return zero if disabled,
	                          nonzero if enabled.
	                    )
	  seteqdata <data>  (to set an element of equalizer data, simply query
	                     which item you wish to set using the message above
	                     (geteqdata), then call this message with data)
	  restartwinamp     (restarts winamp)
	  plpos2entry <N> <file.m3u>  (returns the file of the Nth entry in a
	                               .m3u playlist, the first entry in the
	                               playlist is number 0. To get the
	                               filename of the current track, you call
	                               the plwrite command, it will return a
	                               number, then you call plpos2entry with
	                               the number returned in plwrite as the
	                               first parameter, and
	                               <winampdir>\winamp.m3u as the second
	                               parameter)

	Return values:
	"+OK [return_value(command-specific)]"
	"-WINAMP There is no winamp session open"
	"-NUMBER Parameter must be a valid number"
	"-PLPOS Invalid playlist position number"
	"-PLAYLISTFILE Invalid M3U Playlist File"
	"-PLNOTFOUND Playlist entry not found for that index number"
	"-CMD Invalid command"

	$dll(aircdll.dll, winamp, play)
	$dll(aircdll.dll, winamp, setvol 150)



DllInfo
	Returns some info about the dll.

	Return values:
	"+OK aircdll <VERSION> (C) Gustavo Picon (http://www.airc.ws)"

	$dll(aircdll.dll, DllInfo, -)
