Notice reply alias

From Scriptwiki
Revision as of 23:56, 9 March 2009 by Aca20031 (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
;====================================
; Script designed to use /r to reply to notices, based on individual networks.
; Copy and paste into the scripts editor remote tab, and use /r when you receive a notice to reply to one
;==================================== 
; When a user notices you
on *:NOTICE:*:?: {
; If the last user to notice you is not from this connection
  if (%_aca.last_notice_from_cid_ [ $+ [ $cid ] ] != $nick) {
; Set the variable of the last user to notice you from this connection, as $nick
    set %_aca.last_notice_from_cid_ $+ $cid $nick
; Echo the notice
    echo -atg ***Notice: Use /r <message> to reply to $nick on $scid($cid).network
  }

} 
; The /r alias for replies
alias r {
; If there was a user who noticed you recently from this network
  if (%_aca.last_notice_from_cid_ [ $+ [ $cid ] ]) {
; Reply to him
    notice %_aca.last_notice_from_cid_ [ $+ [ $cid ] ] $1-
  }
; Otherwise
  else {
; Echo that there are no saved users
    echo -atg */r: No saved user has noticed you recently on this network.
  }
}
; When mIRC starts, remove all other saved notices
on *:START:unset %_aca.last_notice_from_cid*