mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2005
Posts: 20
E
Erebus Offline OP
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Mar 2005
Posts: 20
Hello,

mIRC can generally have a lot of on text: events without problems, even if they are regular expressions, wildcards etc. The problem is, I would like to be able to have a dynamic command system on my bot, rather than having to create the commands myself.

These commands may vary in format, so they would probably need to be in the regular expression form.

My question is, is there any good way to do this? What I am guessing I would need to do is load into memory all the different regular expressions for commands, and what to do if they are called. However, would running regular expression on every single line of text in a number of busy channels cause some problems within scripting? Would it be any worse than having them manually defined? Is there any good way to go about this?

Thanks smile

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
I know very little about regualar expressions, but from what i have seen, they dont normally cause any significant delay, but could cause huge delays depending on the regex.

You could reduce significantly your overhead by maybe using ON *:TEXT:!*:#: and having all of your commands begin with !, a simple wild match well then only allow !<text> to be compared to the regex's of the actual commands.

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
The easiest way to handle this is by giving all commands some specific prefix, such as !. That way you can just match !* in a single on text event and very easily do whatever's necessary from there. It's simple to work with and efficient because you're using a straightforward match which will filter out 99.9% of all regular IRC chat without having to process the entire line.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
if you want to make the commands variable why not just use : variables ? :tongue:
on *:TEXT:%trigger:%channel:/msg $nick you triggered %trigger on %channel


$maybe

Link Copied to Clipboard