Wrieh Posted March 29, 2010 Share Posted March 29, 2010 (edited) Hey, i use the IRCScript called ''IRCEcho" Here is the script: --// VRockers MTASA IRC Echo \\-- --//--- Created by VRocker ---\\-- --//------- Functions: -------\\-- -- ircInit() - Initializes the module with the resource so it can be used -- ircOpen( IP, Port, Nick, Channel, [ Password ] ) - Readys a connection to a specified IRC Server. Returns IRCConnection -- ircDisconnect( IRCConnection ) - Disconnects from the IRC Server -- ircMessage( IRCConnection, text ) - Sends a message to the current IRC channel -- ircNotice( IRCConnection, Nick, text ) - Sends a notice to Nick -- ircChangeNick( IRCConnection, newNick ) - Changes the bots nickname to newNick -- ircJoin( IRCConnection, channel ) - Joins a channel -- ircPart( IRCConnection, channel) - Parts a channel -- ircRaw( IRCConnection, text ) - Sends raw commands to the IRC Server -- ircIsVoice( IRCConnection, szChan, szNick ) - Checks if the nickname is voiced on the channel -- ircIsHalfop( IRCConnection, szChan, szNick ) - Checks if the nickname is a half op on the channel -- ircIsOp( IRCConnection, szChan, szNick ) - Checks if the nickname is an op on the channel -- ircIsSuper( IRCConnection, szChan, szNick ) - Checks if the nickname is a super op on the channel -- ircIsOwner( IRCConnection, szChan, szNick ) - Checks if the nickname is an owner on the channel -- ircGetStatus( IRCConnection, szChan, szNick ) - Returns the status of the person ( 0 = no status, 5 = owner ) --//-------- Callbacks: -------\\-- -- irc_onConnecting( IP, Port ) - Called when the IRC connection is connecting -- irc_onConnected() - Called when the server is connected -- irc_onDisconnected() - Called when the server loses connection to the IRC server -- irc_onFailedConnection() - Called when the server loses connection to the IRC server -- irc_onPrivMsg( nick, text ) - Called when somebody speaks in the current channel or PMs the bot -- irc_onNotice( nick, text ) - Called when the bot is sent a notice -- irc_onJoin( nick, channel ) - Called when a user enters the channel -- irc_onPart( nick, channel ) - Called when a user leaves the channel -- irc_onQuit( nick, text ) - Called when a user quits IRC -- irc_onNickChange( oldNick, newNick ) - Called when somebody changes their nickname -- irc_onRaw( text ) - Called when an unrecognised IRC command is recieved root = getRootElement() szChans = {} function onResourceStart( res ) ircInit( ) if ( res == getThisResource () ) then pIRC = ircOpen( "irc.gtanet.com", "6667", "Partyandco", "#Partyandco" ) szChans[ pIRC ] = "#Partyandco" end if pIRC then ircMessage( pIRC, szChans[ pIRC ], "Resource Started: " .. getResourceName( res ) ) end end function onResourceStop( res ) if ( res == getThisResource () ) then if pIRC then ircDisconnect( pIRC ) pIRC = nil end end if pIRC then ircMessage( pIRC, szChans[ pIRC ], "Resource Stopped: " .. getResourceName( res ) ) end end function onPlayerJoin() if pIRC then ircMessage( pIRC, szChans[ pIRC ], "5* " .. getPlayerName( source ) .. " Have joined the server." ) end end function onPlayerQuit( reason ) if pIRC then ircMessage( pIRC, szChans[ pIRC ], "5* " .. getPlayerName( source ) .. " Have left the server. (" .. reason .. ")" ) end end function onPlayerChat( text ) if pIRC then ircMessage( pIRC, szChans[ pIRC ], "12" .. getPlayerName( source ) .. ": " .. text ) end end function onPlayerWasted( ammo, attacker, weapon, bodypart ) if pIRC then local causeOfDeath = getWeaponNameFromID ( weapon ) if attacker then if attacker == source then ircMessage( pIRC, szChans[ pIRC ], "3" .. getPlayerName( attacker ) .. " killed himself. (" .. causeOfDeath .. ")" ) else ircMessage( pIRC, szChans[ pIRC ], "3" .. getPlayerName( attacker ) .. " killed " .. getClientName( source ) .. ". (" .. causeOfDeath .. ")" ) end else ircMessage( pIRC, szChans[ pIRC ], "3" .. getPlayerName( source ) .. " died. (" .. causeOfDeath .. ")" ) end end end --// Callbacks \\-- function irc_onConnecting( szIP, usPort ) outputServerLog( "Connecting to IRC (" .. szIP .. ":" .. tostring( usPort ) .. ")" ) end function irc_onConnected() outputServerLog( "IRC Connected!" ) end function irc_onDisconnected() outputServerLog( "IRC Disconnected \"{SMILIES_PATH}/icon_sad.gif\" alt=\"\" title=\"Sad\" />" ) end function irc_onPrivMsg( szChannel, szNick, szText ) outputServerLog( "IRC <> " .. szNick .. ": " .. szText ) if string.find( szText, "!say" ) == 1 then outputChatBox(szNick .. " [iRC]: " .. string.sub( szText, 6 ) ) elseif string.find( szText, "!players" ) == 1 then ircMessage( pIRC, szChannel, "4There are currently " .. getPlayerCount() .. " players connected" ) end end function irc_onNotice( szFrom, szTo, szText ) outputServerLog( "IRC Notice <> " .. szFrom .. ": " .. szText ) if szFrom == "NickServ" then if string.find( szText, "This nickname is registered" ) then ircMessage( pIRC, "nickserv", "NORMAL IS HERE PASS" ) end end end function irc_onJoin( szChan, szNick ) outputServerLog( "IRC <> " .. szNick .. " joined " .. szChan ) end function irc_onPart( szChan, szNick ) outputServerLog( "IRC <> " .. szNick .. " left " .. szChan ) end function irc_onQuit( szNick ) outputServerLog( "IRC <> " .. szNick .. " quit IRC." ) end function irc_onRaw( text ) --outputServerLog( text ) end function irc_onNickChange( oldNick, newNick ) outputServerLog( "IRC <> " .. newNick .. " changed their nick to " .. oldNick ) end addEventHandler( "onResourceStart", root, onResourceStart ) addEventHandler( "onResourceStop", root, onResourceStop ) addEventHandler( "onPlayerJoin", root, onPlayerJoin ) addEventHandler( "onPlayerQuit", root, onPlayerQuit ) addEventHandler( "onPlayerChat", root, onPlayerChat ) addEventHandler( "onPlayerWasted", root, onPlayerWasted) Whats wrong with it? I started my server with the loaded module. And he says this script is loaded to. But when i try to run it my server restarts?? And i cant see anything happening on IRC I use btw ServerFFS> Edited March 30, 2010 by Guest Link to comment
robhol Posted March 29, 2010 Share Posted March 29, 2010 https://forum.multitheftauto.com/viewtop ... 91&t=27027 You fail at making it easy for people to help you... Link to comment
Xierra Posted March 30, 2010 Share Posted March 30, 2010 Well, at first you try the script and then tell us what's wrong. use --[lua][/lua] Link to comment
MCvarial Posted March 30, 2010 Share Posted March 30, 2010 Serverffs uses linux and there is no irc module for linux. Link to comment
Jumba' Posted March 30, 2010 Share Posted March 30, 2010 Serverffs uses linux and there is no irc module for linux. https://wiki.multitheftauto.com/wiki/Modules/IRCEcho Link to comment
MCvarial Posted March 31, 2010 Share Posted March 31, 2010 Yes back in the DP2.3 days, Vrocker didn't update that page apparently Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now