AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   irc bot (https://forums.alliedmods.net/showthread.php?t=155698)

Nyuszy 04-25-2011 14:02

irc bot
 
how can i make a simple irc bot?

i try this, but it don't work:

Code:
#include <amxmodx> #include <sockets> new socket public plugin_init() {     irc_connect()         register_concmd("irc_msg", "msg")     register_concmd("irc_con", "connect_bot") } irc_connect() {     new error = 0     socket = socket_open("irc.******.net", 6667, SOCKET_TCP, error)         if(error > 0)     {         new fail[64]         formatex(fail, 63, "Socket Error: %i", error)         set_fail_state(fail)         return PLUGIN_HANDLED     }         return PLUGIN_CONTINUE } public connect_bot(id) {     new message[255]     formatex(message, 254, "USER bot 0 bot :bot^nNICK bot^nJOIN #chan^n")     socket_send(socket, message, 254) } public msg(id) {     socket_send(socket, "PRIVMSG #chan :welcome message^n", 64) } public plugin_end() {     socket_send(socket, "QUIT :Plugin reset^n", 64) }

SonicSonedit 04-25-2011 14:28

Re: irc bot
 
Are you sure that you send correct packets to correct irc server adress?
Also this will probably help you: http://forums.alliedmods.net/showthread.php?t=57951

Nyuszy 04-25-2011 14:45

Re: irc bot
 
Quote:

FFAC/Tool support 3 im service : msn, aim and icq.
:(

SonicSonedit 04-25-2011 14:52

Re: irc bot
 
The basis for socket coding is the same - whatever you use: aol, irc, msg - it's all same, you just send different values with socket_send. Read the goddamn FFAC/Tool code before posting sad smiles.

Nyuszy 04-25-2011 16:39

Re: irc bot
 
but it don't helps me... :(


All times are GMT -4. The time now is 20:01.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.