mIRC Home    About    Download    Register    News    Help

Print Thread
#216758 01/12/09 06:58 PM
Joined: Dec 2008
Posts: 1,483
westor Offline OP
Hoopy frood
OP Offline
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:
Code:
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
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 1,997

Try this.

Code:

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
  }
}



G
gooshie
gooshie
G
Code:
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. }
}

#216766 02/12/09 12:08 PM
S
s00p
s00p
S
Code:
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.
#216767 02/12/09 12:32 PM
G
gooshie
gooshie
G
Code:
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
}

#216781 02/12/09 10:38 PM
Joined: Dec 2002
Posts: 1,997
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 1,997

Is this a contest between you two to see who can make the ugliest code?

~ Edit ~
Tested, apologies.


RoCk #216782 02/12/09 10:45 PM
G
gooshie
gooshie
G
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:
Code:
while ($notify(%i) != $null)

Or in backwards order as in:
Code:
if (!%num) .msg $nick My notify list is currently empty.
  else {


#216783 02/12/09 10:53 PM
Joined: Dec 2002
Posts: 1,997
R
Hoopy frood
Offline
Hoopy frood
R
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?

RoCk #216784 02/12/09 11:00 PM
G
gooshie
gooshie
G
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.

#216785 02/12/09 11:04 PM
Joined: Dec 2002
Posts: 1,997
R
Hoopy frood
Offline
Hoopy frood
R
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.
RoCk #216786 02/12/09 11:09 PM
G
gooshie
gooshie
G
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?'

#216787 02/12/09 11:11 PM
Joined: Dec 2002
Posts: 1,997
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 1,997

Onion rings please.

RoCk #216788 02/12/09 11:12 PM
G
gooshie
gooshie
G
lol.. i like onion rings also.. the ones at sonic
are best.. burger king onion rings are crappy..

#216789 02/12/09 11:16 PM
Joined: Dec 2002
Posts: 1,997
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 1,997

Originally Posted By: gooshie

the ones at sonic are best



Indeed. They have good jalapeno poppers too.

RoCk #216794 03/12/09 02:13 AM
G
gooshie
gooshie
G
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..

#216818 03/12/09 03:08 PM
Joined: Dec 2008
Posts: 1,483
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,483
Thanks all for your reply's.


Link Copied to Clipboard