mIRC Homepage
Posted By: Moon412 Mail Script - 29/11/07 08:18 PM
Email Script.

Code:
 ;Made by Deku_Link and Hydroxide.
;Contact Info: irc.dejatoons.net | #Pokedex
;Formula: /msg [SCRIPT HOSTER] !givemsg [NICK] [MESSAGE]

on *:TEXT:!help givemsg:#: { 
  .notice $nick To send a message to someone, and then let them view it when they get online next, type /msg Toothache !givemsg [nick] [message]. 
  .notice $nick Note: The actual formula does not need the brackets.
  .notice $nick Note: The script only works for users registered with nickserv.
}

; This will set a true variable if NickServ replies giving you that the nick is registered.

on *:NOTICE:*Time registered*:*:{
  if ($nick == NickServ) {
    /set %regnick true
  }
}

;This will ask NickServ if the nick in question has been registered. Timer delay (2 s) to give NickServ.
;Some time to reply.

on *:TEXT:!givemsg*:?:  {
  /msg nickserv info $2
  timer 1 2 response $nick $2 $3-
} 

;This will save your message for people in messages.ini

on *:JOIN:#: { 
  if ($readini(messages.ini,memory,$nick)) { 
    .notice $nick $readini(messages.ini,memory,$nick ) 
    .remini messages.ini memory $nick 
  }
}

;Alias called by timer earlier, determines if msg will be saved or not.

alias response {
  if (%regnick == true) {
    .writeini messages.ini memory $2 $1 sent you a message at: $time $+ , $date $+ . Message: $3-
    .notice $1 Message stored.
  }
  else {
    .notice $1 That nick is not registered.
  }
  /unset %regnick
}
 


This is my Email script. Everything works on it, apart from one problem: it still shows messages to nicks even if they aren't identified with nickserv.

My first 'useful' script, and I am still new to it, so please don't confuse me with stuff I don't know shocked

Anyway, it needs to connect to nickserv and see if the nick is identified before giving the message if there is any. I have no clue on how to do this, so please help!

PS. Me = Hydroxide
Posted By: RusselB Re: Mail Script - 29/11/07 11:02 PM
Most nickserv services have a status option which returns a numeric level associated with the status of the specified nick(s).

From the nickserv help on one of the networks that I'm on
Quote:
-NickServ- Syntax: STATUS nickname...
-NickServ-
-NickServ- Returns whether the user using the given nickname is
-NickServ- recognized as the owner of the nickname. The response has
-NickServ- this format:
-NickServ-
-NickServ- nickname status-code
-NickServ-
-NickServ- where nickname is the nickname sent with the command, and
-NickServ- status-code is one of the following:
-NickServ-
-NickServ- 0 - no such user online or nickname not registered
-NickServ- 1 - user not recognized as nickname's owner
-NickServ- 2 - user recognized as owner via access list only
-NickServ- 3 - user recognized as owner via password identification
-NickServ-
-NickServ- Up to sixteen nicknames may be sent with each command; the
-NickServ- rest will be ignored. If no nickname is given, your status
-NickServ- will be returned.

Posted By: LostShadow Re: Mail Script - 30/11/07 05:17 AM
Hi give me a holler, as I was in your channel. And I believe I met Hydroxide.

-Neal.
© mIRC Discussion Forums