This snippet will add a !info trigger to your bot. The script gets the information from the server, with a quick call to /list. Because this only searches /list for an exact match, it uses very little resources.
To use: Paste into remotes of the bot, save and then type !info channelname | !info #channelname
From another client.
This will return the number of users and the topic from any channel that shows up on /list.
;!info Channel info by Ford_Lawnmower irc.abjects.net #mIRC
Menu Channel,Status {
-
.$iif($group(#info.Trigger) == On,$style(1)) !list Channel Info
..$iif($group(#info.Trigger) == On,$style(2)) Trigger On: .enable #info.Trigger
..$iif($group(#info.Trigger) == Off,$style(2)) Trigger Off: .disable #info.Trigger
}
#list.info on
raw 321:*:{ haltdef }
raw 322:*:{
haltdef
set -u6 %list.result $2
.msg %InfoChan 06Information 09for07 $2
tokenize 32 $3 $iif($left($4,1) != $chr(91),N/A) $4-
.msg %InfoChan 06Users 09=07 $1 06Modes 09=07 $2
.msg %InfoChan 06Topic 09= $3-
}
raw 323:*:{
haltdef
Window -c $qt(Channels List)
if (!%list.result) { .msg %InfoChan No Such Channel %ChanName }
unset %InfoChan %list.result
.disable #list.info
}
#list.info end
#info.trigger on
on $*:Text:/^!info\s(.*)/Si:#:{
if (!$timer($+(listinfo,$network,$chan))) {
$+(.timerlistinfo,$network,$chan) 1 4 noop
var %listchan $regml(1)
if (%listchan) {
.enable #list.info
set -u6 %InfoChan $chan
list $iif($left(%listchan,1) == $chr(35),%listchan,$+($chr(35),%listchan))
else .msg $chan Syntax is !info channelname
}
}
}
#info.trigger End
@FordLawnmower
Looks ok. Worked but I don't like the colors. -.- Sorry. It's just I like everything touched up. Anyway to make it show
Information For This Channel
There are 11 users in this channel. 6 Of them are ops.
The topic is: (topic here)
There are a total of 18 kicks in this channel.
There are a total of 12 bans in this channel.
(The numbers are just for example. But that's what I want it to show. And no colors. thx.)
@MagicRevealer09 !list is a command sometimes used by xdcc servers. The server is just blocking any line that starts with !list to prevent people from running file sharing servers on the network.
The trigger was changed to !info #channelname for this reason.
Try !info #MagicRevealer09
;/ I don't even remember posting this.