Hotnsour requires two things: the PHP CLI engine, and the sockets extension. The attraction of Hotnsour is not meant to be an out-of-the-box, trick-your-webhost-provider solution where you open run.php and start running a botnet . The advantage, however, is in the accessibility to the scripter.De Kus wrote:That will be time when web providers will start banning it . Seriously. Web providers don't intent to offer IRC bots in their web hosting service and these would seriously eat up resources (not to mention execution time and memory limits might addionally make problems).
All good points; however IRC is a text-based, easy-to-parse protocol, and one does not require huge amounts of memory or number of clock cycles to run a client.De Kus wrote:Addionally the eggdrop core in C will always be faster than your PHP code, if you dislike TCL so much then discard any scripts but the config file and code everything as a C or C++ module.
Code: Select all
// Typical script using C-type argument vector ($argv).
// $argc is also available. Certain variables are set
// prior to calling this script, such as $channel, $from,
// and $from_full.
switch ($argv[0]) {
case "!wz":
case "!wzf":
include 'scripts/weather.sc';
break;
case "!spam":
$irc->privmsg("#eggdrop", "we rule!");
break;
case "!op":
switch ($from) { // primitive whitelist
case "hotnsour":
$irc->op($channel, $from);
break;
default:
$irc->privmsg($channel, "no way jose!");
break;
}
break;
default:
break;
}
here you go (including all splitting):phpinfo wrote:(I would actually like to see the Tcl equivalent, if possible ).
Code: Select all
namespace eval irc {
proc tclscript {nick uhost hand chan arg} {
switch -- [lindex [split $arg] 0] {
!wz -
!wzf {
source scripts/weather.tcl
}
!spam {
puthelp "PRIVMSG $chan :we rule!"
}
!op {
if {$hand != "*" && ![isop $nick $chan]} {
pushmode $chan +o $nick
}
}
default {}
}
return 0
}
}
bind pubm -|- * irc::tclscript
I would argue that PHP is more accessible to programmers with previous experience, especially if it is with C/C++/Java. It is closer to the family of C-syntax languages, and correct me if I'm wrong, has better library support than Tcl does (everything from string manipulation to MySQL database connection handlers).De Kus wrote:Don't believe just because TCL is diffrent, it's less.
I'm curious as to why you would make the distinction between a non-compiling language and a scripting language? I suppose the correct term would be an "interpreted" language.De Kus wrote:There are only very few things you can't do, which you could with other non-compiling Langauges (avoided the term "scripting language" here).