Modules/IRCEcho/ircIsSuper: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ {{ModuleFunction|IRCEcho}} Can be used to check if the user has superops (aka Protection) or higher ==Syntax== <syntaxhighlight lang="lua"> function ircIsSuper ( IRCConnection irc, string chan...) |
No edit summary |
||
Line 17: | Line 17: | ||
function irc_onPrivMsg( szChannel, szNick, szText ) | function irc_onPrivMsg( szChannel, szNick, szText ) | ||
if string.find( szText, "!ban" ) == 1 then | if string.find( szText, "!ban" ) == 1 then | ||
if ( ircIsSuper( pIRC, | if ( ircIsSuper( pIRC, szChannel, szNick ) ) then | ||
local thePlayer = getPlayerFromNick(string.sub(szText, 5)) | local thePlayer = getPlayerFromNick(string.sub(szText, 5)) | ||
if (thePlayer) then | if (thePlayer) then |
Latest revision as of 19:19, 13 January 2008
This function is provided by the external module IRCEcho. You must install this module to use this function. | |
Can be used to check if the user has superops (aka Protection) or higher
Syntax
function ircIsSuper ( IRCConnection irc, string channel, string nick )
Required arguments
- irc: The IRCConnection
- channel: The channel that you want to check on
- nick: The person that you want to check on
Example
Example 1: This script can be used from irc, so that people with superops or higher can use !ban
function irc_onPrivMsg( szChannel, szNick, szText ) if string.find( szText, "!ban" ) == 1 then if ( ircIsSuper( pIRC, szChannel, szNick ) ) then local thePlayer = getPlayerFromNick(string.sub(szText, 5)) if (thePlayer) then banPlayer( thePlayer ) end end end end