mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2005
Posts: 12
P
Pikka bird
OP Offline
Pikka bird
P
Joined: May 2005
Posts: 12
Hi ppl! I have a script that i want to act only to registered nick. Is that possible via whois?

if 'has identified for this nick' is in the whois text .... action
else to halt...


Thanks!

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
depends...

example

if /whois is performed on nick like....

/whois nickc

it usually shows up something like this...

dirty100 is !hostmask!* wtf
dirty100 is a registered nick
dirty100 on &#chaotic
dirty100 using $networkhere $servermsg
dirty100 is a Services Administrator
dirty100 is available for help.
dirty100 has been idle 1min 56secs, signed on Mon Sep 19 02:53:09
dirty100 End of /WHOIS list.

so we need a raw event because what we did here is before the /whois event on dirty100 we did /debug @raw then when i performed the whois i saw that RAW 307 = the registered nick area so therefore in my remotes i would put this

RAW 307:*: {
if (registered isin $1-) { echo -a W00t there it is , W00t there it is }
}

so now next time i typed /whois dirty100 my script replyed W00t there it is , W00t there it is in a echo

so now the answer to your question well if you didnt know already it does a little something like this (ONLY EXAMPLE)

we have to create a script to perform a certain command now ill use a in channel trigger for a bot or something

on *:TEXT:*:#: {
if $1 == !op {
%op.chan = $chan
%op.nick = $2
whois %op.nick
}
}

RAW 307:*: {
if (registered isin $1-) { mode %op.chan +o %op.nick }
else { halt }
}

now when someone in a channel types !op nickname the script records the nickname + the channel then performs a whois, now the raw event scans 307 to see if registered is there in the whole line is so then mode $chan +o $nick is performed else script Halt's


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: May 2005
Posts: 12
P
Pikka bird
OP Offline
Pikka bird
P
Joined: May 2005
Posts: 12
ok, i will tell you excactly what i want to do. Thanks to RusselB i have a perfect code for a 'bot add/del a user from adressbooks voice list. ( THANKS RUSSELB!!!).

The code i have is:

Code:
 on @*:text:!vlist*:#:{
  if ($nick isop #) {
    if (!$2) {
      var %a = 1
      while %a <= $voice(0) {
        .write voice.tmp $gettok($avoice(%a),1,33)
        inc %a
      }
      .play $chan voice.tmp
      .remove voice.tmp
      set %voiced $sorttok(%voiced,44)
      set %voiced $replace(%voiced,$chr(44),$+($chr(44),$chr(32)))
      .msg $nick %voiced
      unset %voiced
    }
    elseif ($2 == add) {
      if (!$3) {        msg $chan $nick text here      } 
           else {
        var %a = 1
        while %a <= $numtok($3-,32) {
          var %nick = $gettok($3-,%a,32)
          var %address = $gettok($address(%nick,9),1,46)
          if (%nick !ison $chan) {            msg $chan Sorry, but %nick must be on $chan in order to add them          }
          elseif $avoice(%address) {          msg $chan %nick is already in the auto voice list        }
          else {
            set %avoice $addtok(%avoice,%nick,32)
            .avoice %nick $chan
            msg $chan %nick has been added to the auto voice list
            if $numtok(%avoice,32) = $modespl {
              unset %avoice
            }
          }
          inc %a
        }
        if %avoice {
          unset %avoice
        }
      }
    }
    elseif ($2 == del) {
      if (!$3) {        msg $chan $nick text here      }
      else {
        var %a = 1
        while %a <= $numtok($3-,32) {
          var %nick = $gettok($3-,%a,32)
          var %address = $gettok($address(%nick,9),1,46)
          if (%nick !ison $chan) {            msg $chan Sorry, but %nick must be on $chan in order to delete them          }
          elseif !$avoice(%address) {          msg $chan %nick isn't on the auto voice list        }
          else {
            set %avoice $addtok(%avoice,%nick,32)
            .avoice -r %nick $chan
            msg $chan %nick has been deleted from the auto voice list
            if $numtok(%avoice,32) = $modespl {
              unset %avoice
            }
          }
          inc %a
        }
        if %avoice {
          unset %avoice
        }
      }
    }
    else {      msg $chan Valid commands are !vlist add <nick(s)>, !vlist del <nick(s)>.      }
  }
}
else {
  msg $nick Sorry, this command is for opers in $chan only
}
}  



ok! the thing that i want to do is: if someone go to add a nick to the voicelist and this nick is unregistered, to dont add the nick to the voicelist and say 'sorry, nick is a unregistered nick, you cant add it to the voicelist.

Last edited by problematic; 19/09/05 05:43 PM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Hmm...I may be confusing this with another request that was similar, but it seems to me that the request for a check for a registered/unregistered nick was included in the original request, to which, I replied that I required an example as to exactly how the chanserv responded for either a registered or non-registered nick. Some chanservs don't include a line of <nick> is registered and identified for, or if they do, it's not always in the same location. On the other hand, I've only seen two possible responsed if the nick isn't registered.
1) <nick> is not registered
2) <nick> isn't registered

By finding out which of those two responses (or an alternative if that chanserv happens to have something different) the code I supplied you with could easily be modified per your request here.

Joined: May 2005
Posts: 12
P
Pikka bird
OP Offline
Pikka bird
P
Joined: May 2005
Posts: 12
Hi RusselB! (im the same person from Hawkee).

when i do a whois to a register nick i get:

nick has identified for this nick

If the nick is unregistered i get nothing... only the classic:

nick is test@test.bla.bla * bla
nick on #chan1 #chan2
nick using bla.bla.server
nick has been idle bla bla time
nick End of /WHOIS list.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
What do you get if you use /msg chanserv info <nick> with an unregistered nick?

Either that, or we could save a lot of back and forth, by telling me what network you're on, then I could check the information myself

Last edited by RusselB; 20/09/05 12:34 PM.
Joined: May 2005
Posts: 12
P
Pikka bird
OP Offline
Pikka bird
P
Joined: May 2005
Posts: 12
you mean nickserv ...

I get

-NickServ- Nick test-nick isn't registered.

(i had the services in my language thats why i wanted to use the whois than the nick serv option. Now i turn the language to english so ok :0

Last edited by problematic; 20/09/05 12:48 PM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Yeah, I did mean nickserv...sorry about that. I've been doing some programming that required chanserv commands on the bot, which is why I got them confused. Now that I have that information I'll do up a code for you tonight. Don't have time right now.

Joined: May 2005
Posts: 12
P
Pikka bird
OP Offline
Pikka bird
P
Joined: May 2005
Posts: 12
PuMp!!! smile

Joined: May 2005
Posts: 12
P
Pikka bird
OP Offline
Pikka bird
P
Joined: May 2005
Posts: 12
i quit this script a year ago but not i need it again more than ever ... Anyone can help my please?


Link Copied to Clipboard