Jump to content

[REL][Mini-Missions] Irc Echo System


[MM]Stuart

Recommended Posts

NOTES: You will need JDK to compile the Irc bot

What It does ?

Well this adds a irc echo to your server using mysql.

The download includes a resource and a Irc bot which is made in java using the pircbot plugin

It also includes 1 irc command !m [Message] to talk ingame

How to set it up:

-Firstly you need to create a mysql database and 2 tables

first on called "irccmds" and 3 feilds like this

ID bigint auto_increment

Cmd varchar

Args varchar

and then another table called "echo" with 2 feilds like this

ID bigint auto_increment

Message varchar

They you need to open up server.lua in the [MM]Echo folder and edit

local SqlHost = "localhost" -- Change this to your mysql host
local SqlUser = "root" -- Change to your mysql user
local SqlPass = ""	-- change to your mysql pass
local SqlDataBase = "" -- Change to ur mysql db

to your host user etc

Also open the irc bot folder and open the SQL.java file and edit

theses to yours

public static String HOST = "localhost";
public static String DB = "";
public static String user = "root";
public static String pass = "";

finally open MyBot.java

and edit theses

public String Channel = "#asdfghsdfgg";
public String BotName = "[MM]EchoBot";

atfer that run compile the bot (compile.bat) and then run it

Note if restarting the bot it is best to empty the table "echo" first this also works for linux :)

Feel free to report any bugs I will try can fix them if I have time

Here is the download link

https://community.multitheftauto.com/index.html?p ... ils&id=596

Credits

-Me (Scripting)

-djlobo (idea) couldn't of done with out him xD

Edited by Guest
Link to comment

Perfect team Stu :>

This system was tested on our server wich handle around 20+ players all the day, without any problems so far.

Then as far as i and stu noticed people started asking for this, we discussed and decided to share with everyone.

Now having a linux server on mta + echo is not a problem.

Eheh

(PS: Mysql can handle max 29 Querys per second. Adjust the timer to refresh the chat on the resource in order to dont waste you much resources if your server has much players, we decided that refreshing the irc every 2000ms is a considerable value and no one will die. ).

Link to comment

Testing now :D

Edit:Some 'bugs' to list. The compile .bat has the program files for x64 systems AND this requires jdk apparently. I am now downloading and installing JDK to attempt to compile.

Edit2: All bats have x64 directory. Make 2 bats for dumb people I suggest. And maybe binaries for Windows users cause most are dumb ?

Edit3: Problems connecting to a different IRC server. I want to use rizon but it stops at 'please wait while we process your connection' Much googling lead to the conclusion of no IDENT.

Link to comment
Nice idea, but going through a database for something like this is unnecessary and cumbersome - however, until someone manages to put together a linux-compatible IRC module, this is an OK solution.

Well some might know that we come from samp to mta for something like 3 weeks, and we was in need of irc system then we come out with this as like you say "temporary" solution until the irc module be fixed on linux.

I dont want in any way to advertise, however if anyone wants to see this working can join on #mini-missions on gta network.

Link to comment

Here a few things to help you out

JDK Download link: http://java.sun.com/javase/downloads/index.jsp

Compiler.bat

javac -classpath pircbot.jar;. *.java
pause

java -classpath pircbot.jar;. MyBotMain
pause

Also this maybe helpful for people

http://docs.sun.com/app/docs/doc/820-22 ... p-2?a=view

as for it not connecting to the server I'm not sure on that but I will look in to it at some point :)

Link to comment
I'm not sure about using mysql here. For me, it isn't a good idea, server makes bigger bandwith >.> When I turned it on on my server, there was "omgwtflolsuperlal" lagzzz... It's better to use a lua irc library :P

This is mostly for linux users as there is no irc plugin working for linux at the moment

Link to comment
I'm not sure about using mysql here. For me, it isn't a good idea, server makes bigger bandwith >.> When I turned it on on my server, there was "omgwtflolsuperlal" lagzzz... It's better to use a lua irc library :P

This is mostly for linux users as there is no irc plugin working for linux at the moment

Also see us as example piotr1, our server is allways almost full ( 25+ players ) and we didtn had any problems with bandwith, also im pretty sure the irc plugin would do spend more bandwith then this, one more time you can see our irc as example to see this working like a charm #mini-missions

Link to comment
I re-opened the Java console and the echo bot started spamming messages that were recorded when the IRC script was first launched. How to fix that?

Close again the bot, go to the table ,and click on bottun "Clean" it will clean all entrys on table, then reconnect again the bot.

Link to comment
  • 2 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...