Page 1 of 1

Chat Filter

Posted: Sat Nov 13, 2010 11:25 am
by jduartedj
Hi,

I've been looking and I can't find anything to do what I need.
I need to get a warning if someone whispers me or chats on guild chat or even says with a certain content, The idea is to get a warning if anyone calls me out or asks me if i'm a bot then I could answer with a random phrase and say something like: "I'm not in the mood now" and either log out or leave.

I've found some relevant events at RoM wiki (the link provided in rom-bot's wiki) but how can I catch those events?
And if rom-bot can't catch events then maybe do a RoM addon that canc cacth them and somehow comunicate w/ rom-bot, directly or indirectly!

Something like:
1--Addons catches event and check its
2--if it contains any of the given strings then tell rom-bot
3--if the comunication is not to interrupt the bot immeadiatly then it is saved in a global and the bots check such global in a given event, say onLeaveCombat as an example.
4--if it has been triggered then respond with a random adequate phrase and load a diff path or simply log out.

(the response part could be managed by the addon instead, it might be simpler)
note: the response would have to wait like a random rest time like 3-5 secs to seem natural!

Re: Chat Filter

Posted: Mon Nov 15, 2010 2:53 am
by rock5
At the moment rombot can't catch events and addons can't communicate directly with rombot. I guess you could save some event data in a variable and have rombot check it every now and then.

Re: Chat Filter

Posted: Mon Nov 15, 2010 4:57 am
by swietlowka
would be nice also if that addon could handle wrihting down chat data to and external file to see who said what and when...
also another way of notify f/e with a text to phone or smt would be awsome, makes us almost undetectable :)
anyway, im not into lua stuff, but i probably could help, need only some "project manager" :)

Re: Chat Filter

Posted: Mon Nov 15, 2010 7:29 am
by jduartedj
rock5 wrote:At the moment rombot can't catch events and addons can't communicate directly with rombot. I guess you could save some event data in a variable and have rombot check it every now and then.
So I see it's the HARD way or nothing...

I know this is far-fetched but would it be possible for rom-bot to "read" an addon from memory? That could "enable" the listen on event...

Ok thx anyway

Re: Chat Filter

Posted: Mon Nov 15, 2010 9:30 am
by rock5
jduartedj wrote:I know this is far-fetched but would it be possible for rom-bot to "read" an addon from memory? That could "enable" the listen on event...

Ok thx anyway
1. The addon detects an event.
2. The addon stores that information somewhere.
3. Rombot will need to check the information periodically to see if an event has occurred.

If you want to read it from memory instead of using a variable I guess the addon could add the info to a macro and rombot could read it like RoMScript() does.

Actually I'm working on write and read macro functions at the moment.

Re: Chat Filter

Posted: Mon Nov 15, 2010 10:11 am
by jduartedj
rock5 wrote:
1. The addon detects an event.
2. The addon stores that information somewhere.
3. Rombot will need to check the information periodically to see if an event has occurred.

If you want to read it from memory instead of using a variable I guess the addon could add the info to a macro and rombot could read it like RoMScript() does.

Actually I'm working on write and read macro functions at the moment.

as for 3. I think looking into using threads w/ micromacro could also be useful here for an event-checking thread.

as for the rest I think it is a brilliant idea! But i have no experience building an addon. If you'd like me to work on this w/ you just say so or point me in some direction.

thanks ;)

Re: Chat Filter

Posted: Mon Nov 15, 2010 10:12 am
by swietlowka
same here, just need some direction of what should be done and im into it ;)

Re: Chat Filter

Posted: Mon Nov 15, 2010 10:43 am
by rock5
There are guides for creating basic addons. Search for them.

Basically, you need a basic in game frame that you create in an xml doc. It's needed to watch events.
You need to register the events you want to watch, usually in the frames onload event.
You need code in an lua file to execute when the events happen.
And you need a toc file to list the files that need to be loaded, namely the xml and lua file.

Re: Chat Filter

Posted: Mon Nov 15, 2010 1:13 pm
by jduartedj
rock5 wrote:There are guides for creating basic addons. Search for them.

Basically, you need a basic in game frame that you create in an xml doc. It's needed to watch events.
You need to register the events you want to watch, usually in the frames onload event.
You need code in an lua file to execute when the events happen.
And you need a toc file to list the files that need to be loaded, namely the xml and lua file.
thx a lot! ill look it up