|
|
Joined: Dec 2008
Posts: 1,483
Hoopy frood
|
OP
Hoopy frood
Joined: Dec 2008
Posts: 1,483 |
Hello, Can anyone help me with the !notifylist trigger, i want when someone press this to give all bot notify nicknames private e.g:
ON *:TEXT:!notifylist:?: { .msg $nick My currently notify nicks that are into my notifylist are: NICK1 NICK2 ... Total: ? } thanks again
|
|
|
|
Joined: Dec 2002
Posts: 1,997
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,997 |
Try this.
on *:TEXT:!notifylist:?: {
var %i = 1,%num = $notify(0),%nicks
if (!%num) .msg $nick My notify list is currently empty.
else {
while ($notify(%i) != $null) {
var %nicks = $addtok(%nicks,$v1,32)
inc %i
}
.msg $nick My currently notify nicks that are into my notifylist are: %nicks ... Total: %num
}
}
|
|
|
|
gooshie
|
gooshie
|
on *:TEXT:!notifylist:?: {
var %i 1,%nicks,%num $notify(0)
if %num {
while $notify(%i) { %nicks = %nicks $v1 | inc %i }
.msg $nick Currently my notify list contains %num $+(Nick,$iif(%num > 1,s),:) %nicks
}
else { .msg $nick My notify list is currently empty. }
}
|
|
|
|
s00p
|
s00p
|
on *:TEXT:!notifylist:?: {
var %msg
if ($notify(0)) {
var %i = 1
%msg = Currently my notify list contains $v1 $+(Nick,$iif($v1 > 1,s),:)
while ($notify(%i) != $null) {
%msg = %msg $v1
inc %i
}
}
else { %msg = My notify list is currently empty. }
msg $nick %msg
}
Last edited by s00p; 02/12/09 12:09 PM.
|
|
|
|
gooshie
|
gooshie
|
on *:TEXT:!notifylist:?: {
var %i 1,%m msg $nick My notify list
if $notify(0) {
%m = %m currently contains $v1 $+(Nick,$iif($v1 > 1,s),:)
while $notify(%i) { %m = %m $v1 | inc %i }
}
else { %m = %m is currently empty. }
%m
}
|
|
|
|
Joined: Dec 2002
Posts: 1,997
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,997 |
Is this a contest between you two to see who can make the ugliest code?
~ Edit ~ Tested, apologies.
|
|
|
|
gooshie
|
gooshie
|
It works test it.. I was going for small file size.. How exactly should code look to be not ugly?.. To me ugly is any code that is not needed as in: while ($notify(%i) != $null) Or in backwards order as in: if (!%num) .msg $nick My notify list is currently empty.
else {
|
|
|
|
Joined: Dec 2002
Posts: 1,997
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,997 |
I used that because what if one of the notify list entries is 0 (zero)? Your while $notify(%i) would fail.
It's just checking if the list is empty and not processing any further if so. How is that backwards?
|
|
|
|
gooshie
|
gooshie
|
Well then maybe it should fail. I have yet to see any server that supports nicknames beginning with a number so there would be little reason to add user '0' to the notify list. I am ok with it not working if someone does that.
|
|
|
|
Joined: Dec 2002
Posts: 1,997
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,997 |
I don't think any ircd supports it either, but mistakes happen. I would not be OK with my code not working when all I had to do was add a few extra bytes of code to prevent failure, but to each his own.
Last edited by RoCk; 02/12/09 11:07 PM.
|
|
|
|
gooshie
|
gooshie
|
I'm like let 'em.. I see no reason scripting lots of extra steps into every script just in case.. and this type snippet is just a simple reply thing.. it aint gonna gag and die if it breaks.. no big deal.. so someone MAYBE one day has some problem because they MANUALLY added user name '0' to notify list and then cant figure out what is wrong?.. maybe its best it dont work for them and they get frustrated and sell all their computers and learn how to ask 'would you like fries with that burger?'
|
|
|
|
Joined: Dec 2002
Posts: 1,997
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,997 |
|
|
|
|
gooshie
|
gooshie
|
lol.. i like onion rings also.. the ones at sonic are best.. burger king onion rings are crappy..
|
|
|
|
Joined: Dec 2002
Posts: 1,997
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,997 |
the ones at sonic are best
Indeed. They have good jalapeno poppers too.
|
|
|
|
gooshie
|
gooshie
|
BTW, as for our '0' notify issue.. why not just add .notify -r 0 instead of script arround it?.. then its fixed and done.. since no reason for it to be there..
|
|
|
|
Joined: Dec 2008
Posts: 1,483
Hoopy frood
|
OP
Hoopy frood
Joined: Dec 2008
Posts: 1,483 |
Thanks all for your reply's.
|
|
|
|
|
|