PDA

View Full Version : mm_ircbot


ScratchMonkey
11th August 2005, 06:58
This looks intriguing. Any hints on how to use it and what to look out for? I'm guessing it sends events to an IRC channel, but it also looks like it accepts rcon commands from the channel.

ScratchMonkey
11th August 2005, 07:10
Looks like it's not ready for prime time. Lots of stuff that still needs fleshing out, ie. event handlers to echo the events to the IRCServer object, which itself hasn't been instantiated yet.

K
11th August 2005, 07:23
Yes that shouldnt have been in there, 3am forgetfull me.

ScratchMonkey
11th August 2005, 07:38
No prob, nice to see what's coming, anyway.

ScratchMonkey
17th August 2005, 12:35
Any news? I saw over in the bf2cc forum that you'd been testing this in their channel.

K
17th August 2005, 12:42
Got to do some work on it last night. There's a few problems with missing modules which might cause issues ( you cant use select :) ) I'll continue to test.

If you have any ideas on what you would like to see from this let me know.

ScratchMonkey
17th August 2005, 12:47
Can you link to the missing modules somehow? I strace'd bf2 to see how it searched for modules and I recall it looked in relatively logical places local to the user, but not in the system paths.

K
17th August 2005, 12:52
Its a system built in one so unfortunately its not that easy.
I've requested it gets included in 1.03 and I've got a dirty workaround in atm which seems to be working.

bS!
18th August 2005, 07:42
I also created an IRCbot for ModManager (which runs from the BF2 server(and came across the ' no select' problem. I implemented a workaround which seems to work fine :)

the bot can be started and stopped by rcon and reports the match as it is being played.

it's also configurable using the rcon or con file.

I have not yet implemented all of the events yet but that is just a matter of time. what i got now is:

(dis)connects
kill messages
revive messages (usable somehow)
chat messages
death messages ( no real use except for suicide)
spawn messages ( no real use)
timeleft announced at set intervals
ticket/score updates are announced at set intervals.

what is reported is configurable and i have also implemented a 'courtesy' policy for the chat messages. For private clan channels you could display your own team/squad messages.

Still tricky though because it's kinda cheat sensitive unless it would report with a delay which is also an option.

If you are interested I can post the source.

As I side project I am also working on a matchreport proxy which runs on the bf2 server. Much like the rcon service , the output is similar to that of the ircbot but it needs to be parsed by external clients. In case an ircbot will consume to much resources.

Maybe it's best to just build a report module which logs the match into a buffer and then plug other modules into it like the IRCBot or the proxy client.

my 2 cents

ScratchMonkey
18th August 2005, 10:10
I found an entry online yesterday about Python's select command and it said it's implemented only on Unix-like systems. Perhaps it's missing from BF2 because it wouldn't be available on Win32?

bS!
18th August 2005, 10:19
Select on windows uses another method.

The standalone version of my bot IS working on my WinXP computer (with ActiveState Python installation) using the select module.

It's just missing from the bf2 package.

K
18th August 2005, 10:26
Great Bs! You wanna post a link :)

ScratchMonkey
18th August 2005, 10:37
http://www.google.com/search?hl=en&q=python+select+library&btnG=Google+Search

I think I just misinterpreted it. Here's the "official" doc:

http://docs.python.org/lib/module-select.html

So Windows has it, but it's limited to use on sockets. In this case, that's sufficient.

Note that I was familiar with the API back in SunOS 4 days, long before Linux.

K
18th August 2005, 11:43
They both have it but its in effect a dll linkage module and not a pure python module so you cant just add a py file and make it work. As I understand it the built in python interpreter would need to be recompiled to add it ( which is what we have requested for 1.03 )

bS!
18th August 2005, 12:01
I was planning to use the async.chat module but without select it can't be imported.

I'm now using a non-blocking socket and the bf2 update() method to read (64 bytes buffer using try/except), push in my own keep-alive function whenever it hits a PING from the irc server; this way the bot won't timeout when it's idle.

ScratchMonkey
18th August 2005, 12:14
Is it safe to block within BF2? Does the interpreter run in a different thread or can you spawn another thread that can safely block?

I would think you could use compiled Python, as long as you provide separate binaries for both OS's (3 if you include Linux64). But I'm not real familiar with how 3rd party module loading works in Python.

If you haven't done so yet, try stracing bf2 and have it attempt to load a non-existent module. It's instructive to see the paths referenced as it searches for the module. I use something like this:

strace -o /tmp/bf2-strace.txt bf2

Just patch your start.sh temporarily to do that.

The resulting log will be very large and will slow down bf2 a lot, so you wouldn't use it for normal operation, but it's very useful for reverse engineering this kind of thing.

bS!
18th August 2005, 12:17
Originally posted by ScratchMonkey
Is it safe to block within BF2? Does the interpreter run in a different thread or can you spawn another thread that can safely block?

Blocking will result in a gameserver freeze.

K
18th August 2005, 13:20
Its not something I want to get into as there can and often are additional hooks in the interpreter itself for these modules so unless they are enabled on compile forget it.

P.S. I do know how to trace apps and theres a lot simpler way than that in python :D

Hailo
6th September 2005, 14:59
Hi,

I am wondering if you will be releasing your mmIRC bot you have been working on. Do you have a website I can come a see?

Thanks in advance.

K
6th September 2005, 15:16
Its not finished yet as I've had no free time :(

Hailo
6th September 2005, 15:20
Cool, no worries mate.

I am running "Dreambot" (http://dreambot.eurion.com/) on my channel atm. It is a mIRC bot and I leave this running on my game server.

Would your bot be using the "!" to identify its commands? (just worried about conflicts with the other bot I have)

Cheers for the quick reply too :D

K
6th September 2005, 15:26
yes it would

Ram2000
16th September 2006, 23:22
Hi i am also VERY intrested in this I have this one working but its LOCAL would be great if there was something server side ESP for wars.
well be keeping an eye out for a completion date. thanks K

brightside
17th September 2006, 08:53
once again, holy thread ressurection batman :p

Ram2000
18th September 2006, 09:20
once again, holy thread ressurection batman :p

Well if its something thats usefull it was worth bringing back to live Robin :p