Modules/bIRC/ircQuit

From Multi Theft Auto: Wiki
Revision as of 18:23, 29 July 2009 by Awwu (talk | contribs) (Created page with '{{ml_birc}} __NOTOC__ This function is used to disconnect an {{ml_birc|ircbot}} from a server. ==Syntax== <syntaxhighlight lang="lua"> bool ircQuit ( ircbot theBot, [ string quitMessage ] ) <…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Package-x-generic.png This function is provided by the external module Basic IRC Module. You must install this module to use this function.

This function is used to disconnect an ircbot from a server.

Syntax

bool ircQuit ( ircbot theBot, [ string quitMessage ] )

Required Arguments

  • theBot: The ircbot which will be disconnected.

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • quitMessage: A quit message to be displayed when quitting. By default it uses the quit message set by ircSetQuitMessage.

Returns

Returns true if passed arguments were valid, false otherwise.

Example

This example creates an ircbot called DummyBot and makes it connect to irc.gtanet.com server on resource start. When the resource stops, the bot is also disconnected from the server and destroyed.

function resourceStart()
    theBot = ircCreateBot ( "DummyBot" )
    ircConnect ( theBot, "irc.gtanet.com", 6667 )
end
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource() ), resourceStart )

function resourceStop()
    if theBot then
        ircQuit ( theBot )
        ircDestroyBot ( theBot )
    end
end
addEventHandler ( "onResourceStop", getResourceRootElement ( getThisResource() ), resourceStop )

See Also

Bot functions

Creation

Connection

Other

IRC functions

Channel

User

Communication

Other