All pastes #55400 Raw Edit

Friends List

public text v1 · immutable
#55400 ·published 2006-05-12 14:28 UTC
rendered paste body
on *:LOAD:*:{ /echo -a Friendslist By AlternativeNick
echo -a You can type /friends, right click > friendslist, F8, or use the 'Commands' Menu to open the friendslist }
menu status,channel,menubar,query,nicklist {
  Friends List:/friends
}
alias F8 {
  /friends
}
alias noton {
  dialog -mo noton noton
  halt
}
dialog noton {
  title "User Not Online"
  size -1 -1 75 25
  option type dbu
  text "This user is not online" 1, 14 2 60 10
  button "OK" 2, 20 10 37 12
}
on *:DIALOG:noton:sclick:2:{
  dialog -x noton
}
alias friends {
  dialog -ma list list
}
dialog list {
  title $me
  size -1 -1 86 144
  option dbu
  list 1, 2 1 80 111, size
  button "Add", 2, 2 114 37 12
  button "Remove", 3, 44 114 37 12
  button "Info", 5, 2 128 37 12  
  button "Close", 4, 44 128 37 12
}
on *:DIALOG:list:sclick:2:{
  /dialog -am adn adn
}
on *:dialog:list:sclick:5:{ if (%nick != $null) { 
  info }
}
on *:DIALOG:list:sclick:4:{
  if ($?!="Are you sure you want to exit friendslist?" == $true) { dialog -x list }
}
on *:DIALOG:list:sclick:1:{
  set %nick $did(list,1).seltext
  /.whois %nick
}
on *:DIALOG:list:dclick:1:{
  set %nick $did(list,1).seltext
  /msg %nick $$?="What would you like to say?"
}
on *:DIALOG:list:sclick:3:{
  .echo $read(friends.txt,s,%nick)  Removed from friends list
  /did -d $dname 1 $readn
  /write -ds $+ %nick friends.txt

}
on *:DIALOG:list:init:*:{
  var %i = 0
  while (%i < $lines(friends.txt)) {
    inc %i 1
    /did -a $dname 1 $gettok($read(friends.txt,%i),2,32)
  }
}
;Add A Nick to FriendsList
dialog adn {
  title ""
  size -1 -1 57 36
  option dbu
  text "Add Nickname", 1, 10 3 38 8
  edit "", 2, 4 12 50 10
  button "OK", 3, 4 24 20 9
  button "Cancel", 4, 28 24 25 9, cancel
}
on *:DIALOG:adn:sclick:3:{
  if ($did(adn,2).edited == $true) { if ($read(friends.txt -s $+ $did(adn,2).text) == $null) {
      /did -a list 1 $did(adn,2).text
      /write friends.txt $did(adn,2).text $did(adn,2).text
    }
  }
  dialog -x adn
}
;Raws
raw 401:*:noton 
raw 319:*:{ set %wchans $remove($3-,+,%,@) }
;Info section
alias info {
  dialog -am inf inf
}
dialog inf {
  title %nick Info
  size -1 -1 95 51
  option dbu
  list 1, 1 1 50 48, size
  button "Join Channel", 2, 55 1 37 8
  button "PM", 3, 55 11 37 8
  button "Notice", 4, 55 21 37 8
  button "Whois", 5, 55 31 37 8
  button "Close", 6, 55 41 37 8, cancel
}
on *:DIALOG:inf:init:*:{
  var %i = 0
  while ( $numtok(%wchans,32) > %i) {
    inc %i 1
    /did -a $dname 1 $gettok(%wchans,%i,32)
  }
  unset %wchans
}
on *:DIALOG:inf:sclick:1:{
  set %tempchan $did(inf,1).seltext
}
on *:DIALOG:inf:sclick:2:{ /join %tempchan 
  unset %tempchan
}
on *:DIALOG:inf:sclick:3:{ /msg %nick $??="What would you like to say?" }
on *:DIALOG:inf:sclick:4:{ /notice %nick $??="What would you like to say?" }
on *:DIALOG:inf:sclick:5:{ /whois %nick }
on *:DIALOG:list:close:*:{ unset %nick }