The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#2
|
|||
|
|||
Cool, if I ever setup a IRC channel for my forum. Ill be sure to use this hack/mod
Thx |
#3
|
||||
|
||||
OK thanks for the script All the script to get users in IRC made with PHP doesn't work on my host... I hope this one works
|
#4
|
|||
|
|||
Wow, this is something I have been looking for, for a long time. Thanks!
Any idea what the server load might be like? It seems negligible, which is great. Hopefully the IRC servers my forums use will allow it to connect. |
#5
|
||||
|
||||
Quote:
With 18 channels on a heavily used IRC server, it still completes in just under 3 minutes. |
#6
|
||||
|
||||
Some questions:
#1. Does this bog down the server if you are NOT using a dedicated server? This was an issue with the egg-drop method. #2. How might you store the nick as well for each person in the database? You could probably modify the table to be: Code:
create table ircstat ( channelname text not null primary key, channelusers smallint(5) not null default'0', usernicks text not null ); Code:
$sql = $vbdb->prepare("UPDATE ircstat SET channelusers=$field[4] WHERE channelname=\"$field[3]\""); Anyway, if this is possible I'll defiantly consider installing the hack. |
#7
|
||||
|
||||
You do NOT want to gather the nicks of everyone in a channel. Trust me. To do that, you would have to have the script (really a lightweight bot) JOIN each channel, run NAMES in each channel, parse the results, update the database and exit.
Imagine how disruptive it would be for this bot to bounce in and out every 5 minutes or so... As for the server load, its minimal. The real load is on the IRC server. |
#8
|
||||
|
||||
To get it to do what you request, change the script to this:
---START CUT&PASTE NEXT LINE #!/usr/bin/perl $server = "change.irc.server"; $port = 6667; $nick = "PickANick"; $realname = "Just passing through..."; use IO::Socket; use DBI; $dbname = "yourdbname"; $dbhost = "yourhost"; $dbuser = "yourdbuser"; $dbpasswd = "yourdbpassword"; $vbdb=DBI->connect("dbi:mysql:".$dbname.":".$dbhost,$dbuser, $dbpasswd); @channels = ('#Newsdesk','#Education','#Politics-&-Govt','#Military-&-Vets','#DallasMavericks','#TexasRangers','#Houston Texans','#YouthSports','#bits-&-bytes','#Daily-Web.Info','#technology','#religion-&-faith','#business-&-finance','#health','#SportsPage','#DallasStars','# DallasCowboys','#entertainment'); $irc=IO::Socket::INET->new( PeerAddr=>$server, PeerPort=>$port, Proto=>'tcp')or die "$server: $@\n"; print $irc "USER $nick $nick $nick :$realname\n"; print $irc "NICK $nick\n"; while(@channels) { $channel = shift @channels; print $irc "JOIN $channel\n"; while(defined($in=<$irc>)){ chop($in); if($in=~/PING .*)/){ print $irc "PONG $1\n"; } @field = split(/ /,$in); if ($field[1] eq "353") { @users = split(/:/,$in); $users[2] =~ s/@//g; $users[2] =~ s/\+//g; $users[2] =~ s/ PutNickHere//; # <----Don't forget! @nicks = split(/ +/,$users[2]); $sql = $vbdb->prepare("UPDATE ircstat SET channelusers=$#nicks, channelnicks=\"$users[2]\" WHERE channelname=\"$field[4]\""); $sql->execute; print $irc "PART $channel\n"; last; } } } close($irc); -----END CUT&PASTE PREVIOUS LINE---- This runs considerably faster, 20 seconds for 18 channels instead of 3 minutes, but it does have drawbacks. First, is whatever time interval you set the script to run via cron, thats how often this user is going to join/leave the channel. The more often you do it, the more annoying it is. The less often you do it, the more stale your data becomes. If you have channel bots, make sure they do not do an on_join greet to this nick. It just increases the annoyance factor. Also make sure this nick is exempy from excessive join/part bans. This script is an example of the axiom, "Be careful what you wish for, you may get it". |
#9
|
|||
|
|||
im confused as hell...ive never used cron jobs, but this would be of some good for me...
can you put the instructions in simpl form with more detailed instructions...it is kinda throwing me off... example: 4. Run this script out of cron. Every 5 minutes if you have 1 or 2 channels, every 10 minutes if you have more than 2 channels. I dont know how to use cron, so what would be the commands that I would use? |
#10
|
||||
|
||||
@da_gotti: http://www.aota.net/Script_Installat.../cronhelp.php4
@FASherman: thanks for the script, I'll try it out and see how much of an annoyance it might be |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|