Raised This Month: $ Target: $400
 0% 

nIRC - An AMXX irc-bot


Post New Thread Reply   
 
Thread Tools Display Modes
naeo
Member
Join Date: Apr 2006
Old 08-18-2009 , 13:15   Re: nIRC - An AMXX irc-bot
Reply With Quote #101

I wont upload a new version but you can easily make the changes.
This is what you do:

Open up nirc.sma with your favorite editor(amxx-studio work well, but notepad will do)

Find the line that says: public handle_teamsay(id)
Now look down a couple lines until you find the line that says: new message[129];

Paste this right after that line:
Code:
new ip[50];get_user_ip(id,ip,50,1);
Do the same inside handle_say

Once done open save and close. Now open nirc_config.inc in the same editor and find the line that says: #define IRC_T_TSAY

On the 6 lines from IRC_T_TSAY to IRC_S_SAY you will need to make some adjustments.(Adding ip before message)

I'm not sure if this board supports colorcoding so i'm uploading the 6 lines of code you need to replace in the config.

Hope it works.
Attached Files
File Type: inc config_mods.inc (792 Bytes, 147 views)
__________________
naeo is offline
obiwan
Junior Member
Join Date: Sep 2008
Old 08-18-2009 , 13:37   Re: nIRC - An AMXX irc-bot
Reply With Quote #102

Code:
				switch(team)
				{
					case 1: format(irc_pend[irc_nextpend],PENDBUF_LEN,IRC_T_SAY);
					case 2: format(irc_pend[irc_nextpend],PENDBUF_LEN,IRC_CT_SAY);
					default: format(irc_pend[irc_nextpend],PENDBUF_LEN,IRC_S_SAY);
				}
lines 222-227

error :

Quote:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Error: Undefined symbol "ip" on line 224
Error: Invalid expression, assumed zero on line 224
Warning: Expression has no effect on line 224
Error: Invalid statement; not in switch on line 225
Warning: Expression has no effect on line 225
Error: Expected token: ";", but found ":" on line 225
Error: Invalid expression, assumed zero on line 225
Error: Too many error messages on one line on line 225

Compilation aborted.
6 Errors.
Could not locate output file C:\Documents and Settings\nirc\nirc_0.5\nirc.amx (compile failed).
obiwan is offline
naeo
Member
Join Date: Apr 2006
Old 08-18-2009 , 14:46   Re: nIRC - An AMXX irc-bot
Reply With Quote #103

You didnt add this in both functions:
new ip[50];get_user_ip(id,ip,50,1);

Re-read my last post.
__________________
naeo is offline
obiwan
Junior Member
Join Date: Sep 2008
Old 08-18-2009 , 15:04   Re: nIRC - An AMXX irc-bot
Reply With Quote #104

works, sorry.

it shows like that

Quote:
#10:*DEAD* (Szoky): IP - message
how to make it

Quote:
#10:*DEAD* (Szoky - IP in green color): message
could you also add command "!ip" list player name with IP.


@edit

i have got another idea - how about just show ip of player on JOIN and LEAVE (and !ip command) i think it lags if it shows IP with every command

Last edited by obiwan; 08-18-2009 at 15:10.
obiwan is offline
naeo
Member
Join Date: Apr 2006
Old 08-19-2009 , 08:49   Re: nIRC - An AMXX irc-bot
Reply With Quote #105

Look up mirc colorcodes and add them in config where needed.

Look at @players function.. That will display all the info you need.

About adding ip on join\quit: Just do the same changes as I showed you in the last post. I will not go into detail, since you should be able to figure it out by yourself.
All you have to do is find the function that is printing the message you want changed, and add this at the toplevel:
new ip[50];get_user_ip(id,ip,50,1);

Then change the appropriate define in the config.

Hope you get it working.
__________________
naeo is offline
obiwan
Junior Member
Join Date: Sep 2008
Old 08-19-2009 , 09:49   Re: nIRC - An AMXX irc-bot
Reply With Quote #106

works, thank you - you could add it to new version (or i can upload mine :])

another suggestion :

"!cs" shows

Quote:
16:12 < suka_do_bicia> Players[10/19] @ de_dust: Sznurek, scracer_n0,
ECT|PedrON, Maciek93 // PUL ROKA PRZERFY, $$WilCzUr$$,
Bodzio, s, Krexo, Halius, MP4.HT # TroLlEk,
what about

Quote:
16:12 < suka_do_bicia> Players[10/19] Rounds [CT 9/TT 5] @ de_dust: Sznurek, scracer_n0,
ECT|PedrON, Maciek93 // PUL ROKA PRZERFY, $$WilCzUr$$,
Bodzio, s, Krexo, Halius, MP4.HT # TroLlEk,
rounds i mean wins by each side.

Last edited by obiwan; 08-19-2009 at 10:15.
obiwan is offline
puttsmobiles
Senior Member
Join Date: Mar 2009
Location: Chicago
Old 08-19-2009 , 18:58   Re: nIRC - An AMXX irc-bot
Reply With Quote #107

One question.

What sets a private admin channel and what sets a public channel?
puttsmobiles is offline
Send a message via AIM to puttsmobiles Send a message via MSN to puttsmobiles Send a message via Yahoo to puttsmobiles Send a message via Skype™ to puttsmobiles
naeo
Member
Join Date: Apr 2006
Old 08-20-2009 , 03:38   Re: nIRC - An AMXX irc-bot
Reply With Quote #108

Obiwan: I will not help you make more changes. You should be able to figure out how to do it yourself. The plugin was made to be easily customizable, so have fun :-)

puttsmobiles: irc_secchan. It's at top in config. please read comments.

irc_mychan is the bots main channel(For admin use)

If you are interested:
You can easily join more channels using perform. Then you can make other plugins to send data to that channel (Like nWORD plugin does)
__________________
naeo is offline
tripc
Senior Member
Join Date: Aug 2006
Old 09-18-2009 , 00:53   Re: nIRC - An AMXX irc-bot
Reply With Quote #109

How can I make a command that print the nicks of all the people in my channel?
tripc is offline
naeo
Member
Join Date: Apr 2006
Old 09-21-2009 , 07:18   Re: nIRC - An AMXX irc-bot
Reply With Quote #110

No. the bot is designed to not know who is in channel.
Making the bot understand who is is channel is a big task.
However if you want to try to implement it yourself, have a look here: http://irchelp.org/irchelp/rfc/chapter4.html#c4_2_5

If you are only planning on using the names for one thing it may not be as hard as I imagine..

Then you could just send out a names message whenever requested, and when it returns parse it and do whatever.

Hope that helps
__________________
naeo is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:32.


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