All pastes #630630 Raw Edit

Someone

public text v1 · immutable
#630630 ·published 2007-07-23 10:48 UTC
rendered paste body
Menu Channel,status,query { 
  .Tools
  .PM System:{ If (!$Dialog(PMSystem)) { /Dialog -m PMSystem PMSystem } } 
} 
alog PMSystem { 
  title "PM System" 
  size -1 -1 167 52 
  option dbu 
  list 1, 2 4 85 36, size vsbar 
  button "Accept", 2, 90 4 37 12 
  button "Decline", 3, 127 4 37 12 
  button "Auto Decline", 5, 127 19 37 12 
  button "Auto Accept", 4, 90 19 37 12 
  check "Block All", 6, 54 40 34 10 
  button "Note", 7, 3 41 21 9 
  button "Ignore", 8, 110 33 29 11 
} 
Alias Ignorepm { 
  If ($comchan($1,0) >= 1) { 
    Writeini -n PMSystem.ini Ignore $address($1,2) ignore
    Echo -a $1 ( $+ $Address($1,2) $+ ) added to ignore list. 
  } 
  Elseif ($1) { 
    Writeini -n PMSystem.ini Ignore $address($1,2) ignore
    Echo -a $1 ( $+ $Address($1,2) $+ ) added to ignore list. 
  } 
  Else { 
    Writeini -n PMSystem.ini ignore $Address(%AwayCurrentNick,2) Ignore 
    Echo -a $1 ( $+ $Address($1,2) $+ ) added to ignore list. 
  } 
} 
Alias y { 
  Msg %AwayCurrentNick [PM System v1.0] Your PM has been accepted. 
  DelNick %AwayCurrentNick 
  .Timer $+ %AwaCurrentNick $+ * Off 
  If ($did(PMSystem,1,$did(PMSystem,1).lines).text) { 
    Set %AwayCurrentNick $Gettok($did(PMSystem,1,$did(PMSystem,1).lines).text,1,32) 
    Echo -a %AwayCurrentNick is still awaiting an answer, Accept PM? (/y or /n) 
  } 
} 
Alias n { 
  Msg %AwayCurrentNick [PM System v1.0] Your PM has been declined. 
  DelNick %AwayCurrentNick 
  Close -m %AwayCurrentNick 
  .Timer $+ %AwayNick $+ * Off 
  .Timer $+ %AwayCurrentNick 1 300 Set %Declines $Remtok(%Declines,%AwayCurrentNick,1,32) 
  If ($did(PMSystem,1,$did(PMSystem,1).lines).text) { 
    Set %AwayCurrentNick $Gettok($did(PMSystem,1,$did(PMSystem,1).lines).text,1,32) 
    Echo -a %AwayCurrentNick is still awaiting an answer, Accept PM? (/y or /n) 
  } 
} 
Alias ya { 
  Msg %AwayCurrentNick [PM System v1.0] Your PM has been accepted. 
  Msg %AwayCurrentNick [PM System v1.0] You have been added to my auto-accept list. 
  Writeini -n PMSystem.ini accept $address(%awaycurrentnick,2) accept
  DelNick %AwayCurrentNick 
  If ($did(PMSystem,1,$did(PMSystem,1).lines).text) { 
    Set %AwayCurrentNick $Gettok($did(PMSystem,1,$did(PMSystem,1).lines).text,1,32) 
    Echo -a %AwayCurrentNick is still awaiting an answer, Accept PM? (/y or /n) 
  } 
} 
Alias na { 
  Msg %AwayCurrentNick [PM System v1.0] Your PM has been declined. 
  Msg %AwayCurrentNick [PM System v1.0] You have been added to my auto-decline list. 
  Writeini -n PMSystem.ini decline $address(%awaycurrentnick,2) decline
  Close -m %AwayCurrentNick 
  DelNick %AwayCurrentNick 
  If ($did(PMSystem,1,$did(PMSystem,1).lines).text) { 
    Set %AwayCurrentNick $Gettok($did(PMSystem,1,$did(PMSystem,1).lines).text,1,32) 
    Echo -a %AwayCurrentNick is still awaiting an answer, Accept PM? (/y or /n) 
  } 
} 
Alias denyall { Clearall } 
Alias -l ClearAll { 
  Var %x = 1, %y = $did(PmSystem,1).lines 
  While (%x <= %y) { 
    Msg $Gettok($did(PmSystem,1,%x).text,1,32) [PM System v1.0] Your PM has been declined. 
    Did -d PMSystem 1 %x 
    Close -m $Gettok($did(PmSystem,1,%x),1,32) 
    Inc %x 
  } 
} 
Alias -l DelNick { 
  Var %x = 1, %y = $did(PmSystem,1).lines 
  While (%x <= %y) { 
    If ($1 == $Gettok($Did(PMSystem,1,%x).text,1,32)) { 
      Did -d PMSystem 1 %x 
    } 
    Inc %x 
  } 
} 
On *:CLOSE:?:{ 
  DelNick $Target 
} 
On *:OPEN:?:{ 
  if ($nick == ramyrezx) { halt }
  If ($Dialog(PMSystem)) { 
    If (%PMSystemNote) { Msg $Nick Note: %PMSystemNote } 
    If ($Did(PMSystem,6).state == 1) { 
      Msg $Nick [PM System v1.0] I am currently blocking all PMs. Try again later. 
      Close -m $Nick 
    } 
    ElseIf ($Nick isin %Declines) { Close -m $Nick } 
    Elseif ($Readini(PMSystem.ini, n, ignore, $Address($Nick,2))) { Close -m $Nick } 
    ElseIf ($Readini(PMSystem.ini, n, accept, $Address($Nick,2))) { Msg $Nick [PM System v1.0] Your PM has been accepted. } 
    ElseIf ($Readini(PMSystem.ini, n, decline, $Address($Nick,2))) { Msg $Nick [PM System v1.0] Your PM has been declined. | Close -m $Nick } 
    Else { 
      Var %Time = $Asctime(hh:nn:ss) 
      Did -a PMSystem 1 $Nick %Time 
      .Timer $+ $Nick $+ $r(1,10000) 1 300 .Msg $Nick [PM System v1.0] Your PM has timed out after 5 minutes and has been auto-declined. 
      .Timer $+ $Nick $+ $r(1,10000) 1 300 .Close -m $Nick 
      .Timer $+ $Nick $+ $r(1,10000) 1 300 .DelNick $Nick 
      Msg $Nick [PM System v1.0] Please wait for your PM to be accepted or declined. 
      Echo -a $Nick says $qt($1-) $+ , Accept PM? (/y or /n) 
      Set %AwayCurrentNick $Nick 
    } 
  } 
} 
On *:DIALOG:PMSystem:Sclick:8:{ 
  Writeini -n PMSystem.ini ignore $Address($Gettok($Did($Dname,1,1).seltext,1,32),2) ignore
  Close -m $Gettok($Did($Dname,1,1).seltext,1,32) 
  DelNick %AwayCurrentNick 
} 
On *:DIALOG:PMSystem:Sclick:7:{ 
  Set %PMSystemNote $input(Leave a note:,eo,Note) 
} 
On *:DIALOG:PMSystem:Sclick:2:{ 
  If ($Gettok($Did(1).seltext,1,32)) { 
    Msg $Gettok($Did(1).seltext,1,32) [PM System v1.0] Your PM has been accepted. 
    Did -d PMSystem 1 $did(PMSystem,1,1).sel 
    .Timer $+ $Gettok($Did(1).seltext,1,32) $+ * Off 
  } 
} 
On *:DIALOG:PMSystem:Sclick:3:{ 
  If ($Gettok($Did(1).seltext,1,32)) { 
    Msg $Gettok($Did(1).seltext,1,32) [PM System v1.0] Your PM has been declined. 
    Close -m $Gettok($Did($Dname,1,1).seltext,1,32) 
    Did -d PMSystem 1 $did(PMSystem,1,1).sel 
    .Timer $+ $Gettok($Did($Dname,1,1).seltext,1,32) $+ * Off 
    Set %Declines $Addtok(%Declines,$Gettok($Did($Dname,1,1).seltext,1,32),32) 
  } 
} 
On *:DIALOG:PMSystem:Sclick:4:{ 
  If ($Gettok($Did(1).seltext,1,32)) { 
    Msg $Gettok($Did($Dname,1,1).seltext,1,32) [PM System v1.0] Your PM has been accepted. 
    Msg $Gettok($Did($Dname,1,1).seltext,1,32) [PM System v1.0] You have been added to my auto-accept list. 
    Writeini -n PMSystem.ini accept $Address($Gettok($Did($Dname,1,1).seltext,1,32),2) accept
    Did -d PMSystem 1 $did(PMSystem,1,1).sel 
    .Timer $+ $Gettok($Did($Dname,1,1).seltext,1,32) $+ * Off 
  } 
} 
On *:DIALOG:PMSystem:Sclick:5:{ 
  If ($Gettok($Did(1).seltext,1,32)) { 
    Msg $Gettok($Did(1).seltext,1,32) [PM System v1.0] Your PM has been declined. 
    Msg $Gettok($Did(1).seltext,1,32) [PM System v1.0] You have been added to my auto-decline list. 
    Writeini -n PMSystem.ini decline $Address($Gettok($Did($Dname,1,1).seltext,1,32),2) decline
    Did -d PMSystem 1 $did(PMSystem,1,1).sel 
    close -m %awaycurrentnick
    .Timer $+ $Gettok($Did($Dname,1,1).seltext,1,32) $+ * Off 
  } 
}