Author | Message | Time |
---|---|---|
Undeference | Well... as I've decided that it would be a total waste of my time to write a bot of any kind (neural networks are not really 'bots' -- no offense implied), I figure it will be safe for me to post my ideas for the bot I was going to write (this was a few years back; before I took on a bunch of other stuff that I'm now pressed to finish -- by next year). Here is my most recent idea: [list][*]Application[list] [*]Socket handling [*]Protocol handling[/list] [*]External Scripting[list] [*]Users[list] [*]UserDB [*]User scripts [*]User logs[/list] [*]Command [*]Error handling[/list][/list] Basically, the bot is just a connection and anti-flood mechanism. Everything else is done using Perl modules. This will especially seem unattractive to Windows users because... Perl... ew, right? The reason Perl is the major candidate is for the following reasons:[list][*]Perl is not OS-specific (there's a Windows version and there's MacPerl, in addition to nix)[*]Perl is especially good for string manipulation, mainly due to its exceptionally good regex handling[/list]Another reason Perl is a good candidate is because you can use arbitrary command lines even on Mac and Windows. A users list can be done with a Perl db (written manually) or using a popular SQL syntax such as MySQL, Postgresql, [s]M$ Access[/s], etc. Due to the nature of the bot, it won't really matter; you can use all or none of the options. This solves the problem with user-scriptability (the bot owner) being so inefficient. Alternatively, a modified CGI-like setup could be used. What do you think? [ EDIT: Changed the leveling to be more to my initial thought. ] | August 23, 2004, 8:42 PM |
St0rm.iD | I think it should use SOAP or XML-RPC or something standard for communication. | August 23, 2004, 10:25 PM |
OnlyMeat | Thats similar to my own setup, my bots contain no actual specific commands etc they simply execute bot and command scripts written in an integrated script editor which supports any ActiveX script engine installed on the system. Currently their are about 5 different engines that i know of:- (1) VBScript (2) Javascript (3) ActivePerl (4) ActivePython (5) ActiveHCL All my scripts can be written in these languages using the intellisense editor i designed and executed in my bot at runtime. I also use the IActiveScriptSite COM interfaces directly as they provide fast powerful scripting support. And before you ask i dont use .net based scripting because my bots are written in c++ without the .net framework. I personally prefer this kind of automation as apposed to dynamic loading modules and plugins because you have the option to run these out-of-process which enables a higher degree of security when dealing with possible script exceptions or infinite loops or what ever situation may occur that might affect the main thread of the program. Thats my 2 cents anyways. | August 24, 2004, 1:18 AM |
Myndfyr | Funny you should mention .NET scripting. I don't know of any actual scripting in .NET aside from the nerfed Microsoft.Vsa namespace. :/ | August 24, 2004, 1:24 AM |
Undeference | Imagine user db searching using a Perl regular expression though: &dbm('.*?bob.*', 'i'); [code] sub dbm { # database match my ($regex, $flags) = @_; my (@found); foreach (@dblines) { if (eval ("$_ =~ m/$regex/$flags")) { push (@found, $1.$2.$3.$4.$5.$6.$7.$8.$9); } } my ($reult) = "Found $#found results:"; foreach (@found) { if ($_ ne '') { $result .= "$_, "; } } &send ($result); } [/code] Something like that. There would obviously be more code with send having to do with user options. Also, @dblines has to be defined, but a setup like this would allow for a simple if (user can do this) { eval (whatever the user said); } type of a deal. | August 25, 2004, 7:17 PM |
Kp | [quote author=Undeference link=board=17;threadid=8336;start=0#msg77310 date=1093461457]Also, @dblines has to be defined, but a setup like this would allow for a simple if (user can do this) { eval (whatever the user said); } type of a deal.[/quote] Be very careful passing arbitrary constructs to eval! Malicious users could do a variety of unpleasant things, such as unlink the database file, sigkill the host process, etc. Also, before you just say "Well, I'll only give such access to people I trust", think about what you're relying on to authenticate them. You're trusting that a presence on battle.net is the friend you believe it to be, which isn't a particularly good assumption since accounts can be stolen, expire, etc. For that matter, even if you prevent all those, you still need to hope that TrustedFriend's little brother doesn't wander by an unlocked keyboard feeling mischievious. | August 25, 2004, 10:34 PM |
warz | see c0ol's old perl bot. i think it was called "Perl Chat" or "c0ol chat" not sure though. | August 26, 2004, 12:37 AM |
Undeference | So don't use eval: [code]sub dbm { my ($regex, $i) = ($_[0], 0); my (@found); foreach (@dblines) { if ($_ =~ m/($regex)/ig) { push (@found, $1); } } my ($result) = "Found $#found results:"; while ($i <= @found) { $result .= $found[$i++]; if ($i < @found) { $result .= ', '; } } &send ($result); }[/code] | August 27, 2004, 11:48 PM |