Modules/bIRC/ircDestroyBot

From Multi Theft Auto: Wiki
Revision as of 18:17, 29 July 2009 by Awwu (talk | contribs) (Created page with '{{ml_birc}} __NOTOC__ This function is used to destroy a created {{ml_birc|ircbot}}. After deletion, the ircbot pointer will nolonger be valid. If ircbot is connected, it will be…')
(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 destroy a created ircbot. After deletion, the ircbot pointer will nolonger be valid. If ircbot is connected, it will be disconnected from the server.

Syntax

bool ircDestroyBot ( ircbot theBot )

Required Arguments

  • theBot: The ircbot which will be destroyed.

Returns

Returns true if ircbot was successfully destroyed, false otherwise.

Example

This example creates an ircbot called DummyBot on resource start and destroys the bot once the resource has stopped.

function resourceStart()
    theBot = ircCreateBot ( "DummyBot" )
end
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource() ), resourceStart )

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

See Also

Bot functions

Creation

Connection

Other

IRC functions

Channel

User

Communication

Other