mIRC Home    About    Download    Register    News    Help

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


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

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



Joined: Nov 2009
Posts: 117
Vogon poet
Offline
Vogon poet
Joined: Nov 2009
Posts: 117
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. }
}

Joined: Jul 2008
Posts: 236
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Jul 2008
Posts: 236
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.
s00p #216767 02/12/09 12:32 PM
Joined: Nov 2009
Posts: 117
Vogon poet
Offline
Vogon poet
Joined: Nov 2009
Posts: 117
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
}

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

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
Joined: Nov 2009
Posts: 117
Vogon poet
Offline
Vogon poet
Joined: Nov 2009
Posts: 117
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 {


Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

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
Joined: Nov 2009
Posts: 117
Vogon poet
Offline
Vogon poet
Joined: Nov 2009
Posts: 117
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: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

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
Joined: Nov 2009
Posts: 117
Vogon poet
Offline
Vogon poet
Joined: Nov 2009
Posts: 117
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: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

Onion rings please.

RoCk #216788 02/12/09 11:12 PM
Joined: Nov 2009
Posts: 117
Vogon poet
Offline
Vogon poet
Joined: Nov 2009
Posts: 117
lol.. i like onion rings also.. the ones at sonic
are best.. burger king onion rings are crappy..

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

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
Joined: Nov 2009
Posts: 117
Vogon poet
Offline
Vogon poet
Joined: Nov 2009
Posts: 117
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,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Thanks all for your reply's.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-

Link Copied to Clipboard