|
Joined: Feb 2003
Posts: 3
Self-satisified door
|
OP
Self-satisified door
Joined: Feb 2003
Posts: 3 |
Im trying to show info about the channel when i join it this is what i wrote..will it work? on 1:JOIN:{ if ( $me ison $chan){ echo -t %dts 1Today is: 2$fulldate - $gmt echo -t %dts 1Nicks on Channel: 2$nick($chan,0) echo -t %dts 1Total Ops: 2$nick($chan,0,o) echo -t %dts 1Total Voiced: 2$nick($chan,0,v) }
|
|
|
|
Joined: Jan 2003
Posts: 44
Ameglian cow
|
Ameglian cow
Joined: Jan 2003
Posts: 44 |
Well this script will trigger every time someone enters a channel that you are in. So you shoud change it to: on *:JOIN:*:{ if ($nick == $me) { echo -a %dts 1Today is: 2$fulldate - $gmt echo -a %dts 1Nicks on Channel: 2$nick($chan,0) echo -a %dts 1Total Ops: 2$nick($chan,0,o) echo -a %dts 1Total Voiced: 2$nick($chan,0,v) } I think this is the way to make it work properly...
Regards, ThE_mASk.
|
|
|
|
Joined: Jan 2003
Posts: 237
Fjord artisan
|
Fjord artisan
Joined: Jan 2003
Posts: 237 |
ok, I got this:
on *:JOIN:*: { if ($nick == $me) { set %t $chan //echo -a 1Current Channel:2 %t //echo -a 1Today is:2 $fulldate //echo -a 1Nicks on Channel:2 $nick(%t,0) //echo -a 1Total Ops:2 $nick(%t,0,o) //echo -a 1Total Voiced:2 $nick(%t,0,v) unset %t } return }
and it returns:
Current Channel: <channel> Today is: Sun Feb 16 00:07:46 2003 Nicks on Channel: 1 Total Ops: 0 Total Voiced: 0
every single time. No matter how man people are in the channel. So whats wrong? the %dts option dons twokr eather.
;Check for Life if (%life == $null) { goto getlife }
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
That is because on me:*:JOIN:#: or on *:JOIN:#: if ($nick == $me) (which are essentially the same thing, the differences are described below) react to the original JOIN command from the server. When you receive the notification that you have joined the channel, you have not yet received the topic, who set the topic and when it was set, the /names list (which is where you find out who all is on the channel, who's opped/voiced), the end of names list, the modes for the channel and when the channel was created.
/JOIN #Channel (you typed this) :MyNick!userid@host JOIN :#Channel /MODE #Channel (sent by mIRC on your behalf) :server 332 MyNick #Channel :This is the channel topic. :server 333 MyNick #Channel Nick1 1044499804 :server 353 MyNick = #help :MyNick Nick30 Nick29 @Nick28 Nick27 Nick26 Nick25 Nick23 Nick22 Nick21 Nick20 Nick19 Nick18 +Nick17 Nick16 Nick15 Nick14 Nick13 Nick12 Nick11 Nick10 Nick9 Nick8 Nick7 Nick6 Nick5 Nick4 Nick3 Nick2 @Nick1 :server 366 MyNick #Channel :End of /NAMES list. :server 324 MyNick #Channel +tnl 39 :server 329 MyNick #Channel 1042103590
Your on me:*:JOIN:#: might also issue a /who $chan to fill the IAL (Internal Address List) and a /mode $chan b to fill the IBL (Internal Ban LIst) for that channel. If so, then you might want to wait for the raw 352's to finish with a raw 315 (End of /WHO list.), as well as waiting for the raw 367's to finish with a raw 368 (End of Channel Ban List).
You might also want to check $7 in each raw 352 for * (opered client) and G (away client) to total those for your stats, as well. You could also total how many clients are on each server by checking $5 and adding to each server's total for that channel for your stats.
Once you have received all of this information, then you can do your channel stats - but as you can see, you cannot do any channel stats until you have gotten it all (or at least all that you desire for your stats display).
on me:*:JOIN:#: only gets triggered if you are the one joining the channel.
on *:JOIN:#: if ($nick == $me) gets triggered every time someone joins the channel and then checks to see if it was you.
on !*:JOIN:#: only gets triggered when someone else joins the channel you're in.
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
Joined: Jan 2003
Posts: 237
Fjord artisan
|
Fjord artisan
Joined: Jan 2003
Posts: 237 |
so what would be a workign example of what you just said?
;Check for Life if (%life == $null) { goto getlife }
|
|
|
|
Joined: Dec 2002
Posts: 1,541
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,541 |
Here's your working example: on me*:join:#: { set %t $chan //echo -a 1Current Channel:2 %t //echo -a 1Today is:2 $fulldate //echo -a 1Nicks on Channel:2 $nick(%t,0) //echo -a 1Total Ops:2 $nick(%t,0,o) //echo -a 1Total Voiced:2 $nick(%t,0,v) unset %t } That will trigger ONLY for you and nobody else ![smile smile](/images/graemlins/mirc/smile.gif) You could also do this: on me*:join:#: { var %t $chan //echo -a 1Current Channel:2 %t //echo -a 1Today is:2 $fulldate //echo -a 1Nicks on Channel:2 $nick(%t,0) //echo -a 1Total Ops:2 $nick(%t,0,o) //echo -a 1Total Voiced:2 $nick(%t,0,v) halt } Using /var instead of /set will unset the variable once the script halts. The advantage is if you want to clear the variable, it will do it WITHOUT using the /unset command
Those who fail history are doomed to repeat it
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
#Channel.Stats.Report on
on me:^*:JOIN:#:{
set -u600 $+(%,Me.JOIN.,$cid,.,$chan) 0 0
.raw $+(WHO $chan,$crlf,MODE $chan +b)
haltdef
}
alias ChanStats {
if ($1) set %chan #$1
elseif (#* iswm $active) set %chan $active
if (%chan) {
set -u600 $+(%,Me.JOIN.,$cid,.,%chan) 0 0
.raw $+(TOPIC %chan,$crlf,NAMES %chan,$crlf,MODE %chan,$crlf,WHO %chan,$crlf,MODE %chan b)
}
}
;
; Halt the joining numerics on me:*:JOIN:
;
raw 332:*: if ($eval($+(%,Me.JOIN.,$cid,.,$2),2) != $null) halt
raw 333:*:{
if ($eval($+(%,Me.JOIN.,$cid,.,$2),2) != $null) {
set $+(%,Me.JOIN.,$cid,.,$2) $eval($+(%,Me.JOIN.,$cid,.,$2),2) $3-
halt
}
}
raw 353:*: if ($eval($+(%,Me.JOIN.,$cid,.,$3),2) != $null) halt
raw 366:*: if ($eval($+(%,Me.JOIN.,$cid,.,$2),2) != $null) halt
raw 324:*: if ($eval($+(%,Me.JOIN.,$cid,.,$2),2) != $null) halt
raw 329:*:{
if ($eval($+(%,Me.JOIN.,$cid,.,$2),2) != $null) {
set $+(%,Me.JOIN.,$cid,.,$2) $eval($+(%,Me.JOIN.,$cid,.,$2),2) $3
halt
}
}
;
; IAL Filler
;
raw 352:*:{
if $eval($+(%,Me.JOIN.,$cid,.,$2), 2) != $null {
var %Oper.Count = $gettok($ifmatch, 1, 32)
var %Away.Count = $gettok($ifmatch, 2, 32)
var %Other = $gettok($ifmatch, 3-, 32)
if (* isin $7) inc %Oper.Count
if (G isin $7) inc %Away.Count
set $+(%,Me.JOIN.,$cid,.,$2) %Oper.Count %Away.Count %Other
halt
}
}
raw 315:*:{
if ($eval($+(%,Me.JOIN.,$cid,.,$2), 2) != $null) {
.raw MODE $2 b
halt
}
}
;
; IBL filler
;
raw 367:*: if ($eval($+(%,Me.JOIN.,$cid,.,$2), 2) != $null) halt
raw 368:*:{
if ($eval($+(%,Me.JOIN.,$cid,.,$2), 2) == $null) return
ChanStatsReport $2
halt
}
alias ChanStatsReport {
if ($eval($+(%,Me.JOIN.,$cid,.,$1), 2) != $null) {
var %Oper.Count = $gettok($ifmatch, 1, 32)
var %Away.Count = $gettok($ifmatch, 2, 32)
var %Topic.Set.By = $gettok($ifmatch, 3, 32)
var %Topic.Set.Time = $asctime($gettok($ifmatch, 4, 32), yyyy/mm/dd HH:nn:ss)
var %Channel.Created = $asctime($gettok($ifmatch, 5, 32), yyyy/mm/dd HH:nn:ss)
var %chan = $1
echo $color(join) -bfirt %chan * Now talking in %chan $+([,$asctime($ctime, yyyy/mm/dd HH:nn:ss),])
echo $color(join) -bfirt %chan * Created: %Channel.Created
echo $color(topic) -bflirt %chan * Topic is: $chan(%chan).topic
echo $color(topic) -bfirt %chan * Set by %Topic.Set.By $+([,%Topic.Set.Time,])
echo $color(join) -bfirt %chan * $+([, $&
$nick(%chan, 0) Nick,$iif($nick(%chan, 0) != 1,s),][, $&
$nick(%chan, 0, o) Op,$iif($nick(%chan, 0, o) != 1,s),][, $&
$nick(%chan, 0, v) Voice,$iif($nick(%chan, 0, v) != 1,s),][, $&
$nick(%chan, 0, r) Regular][, $&
%Oper.Count Oper, $iif(%Oper.Count != 1,s),][, $&
%Away.Count Away][, $&
$ibl(%chan, 0) Ban,$iif($ibl(%chan, 0) != 1,s),])
linesep %chan
unset $+(%,Me.JOIN.,$cid,.,$1)
}
}
#Channel.Stats.Report end
* Now talking in #MyChannel [2003/02/16 03:24:24] * Created: 2003/02/16 00:46:11 * Topic is: This is a really cool place to chat with my good friends. * Set by MyNick [2002/12/31 00:43:08] * [253 Nicks][33 Ops][20 Voices][200 Regular][20 Opers][250 Away][1 Ban] /ChanStats will re-show the stats at any time.
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
Joined: Feb 2003
Posts: 3
Self-satisified door
|
Self-satisified door
Joined: Feb 2003
Posts: 3 |
Hiya,
I have used your script, which is great, but one thing bugs me a little. Each time I join a channel, the script run, but I get this in my status window.
#irchelp End of Channel Ban List
If there are any bans on the channel it will echo them to the status window. Is there any way to stop that from echo'ing to the status window?
Cheers
Paula
|
|
|
|
|