Advertisement
WraithRIOT

Server List

Apr 12th, 2011
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 2.04 KB | None | 0 0
  1. Alias List.Start {
  2.   If (!$Dialog(List)) { Dialog -m List List }
  3.   Else { Dialog -x List List | Dialog -m List List }
  4. }
  5. dialog List  {
  6.   title ""
  7.   size -1 -1 54 260
  8.   option dbu
  9.   list 1, 2 1 52 270, hsbar size
  10. }
  11. On *:Dialog:List:*:*:{
  12.   If ($devent == Init) {
  13.     $mdxin
  14.     dll $mdx SetMircVersion $version
  15.     dll $mdx MarkDialog $dname
  16.     dll $mdx SetControlMDX $dname 1 showsel rowselect  > $views
  17.     dll $mdx SetFont $dname 1, -18 400 Times New Roman
  18.     dll $mdx SetColor $dname 1, background $color(1)
  19.     dll $mdx SetColor $dname 1, textbg $color(1)
  20.     dll $mdx SetColor $dname 1, text $color(0)
  21.     Dll $hos Dock $dname Right -1
  22.     Var %Server.List 1
  23.     While (%Server.List <= $Lines(Documents\Servers.Txt)) {
  24.       Did -a $dname 1 $Gettok($read(Documents\Servers.txt,%Server.List),1,95)
  25.       Tokenize 45 $read(Documents\Servers.txt,%Server.List)
  26.       Inc %Server.List
  27.     }
  28.     Did -z $dname 1
  29.   }
  30.   If ($devent == Dclick) {
  31.     Set %Selx $did(1).sel
  32.     Set %Linn $Read(Documents\Servers.txt,%Selx)
  33.     Unset %Selx
  34.     Set %Server.New $Gettok(%Linn,2,95)
  35.     Unset %Linn
  36.     Server %Server.New
  37.     Unset %Server.New
  38.   }
  39. }
  40. Alias Servadd {
  41.   If (!$dialog(Servadd)) { Dialog -m ServAdd ServAdd }
  42. }
  43. dialog Servadd {
  44.   title "Server add and remove"
  45.   size -1 -1 164 89
  46.   option dbu
  47.   list 1, 2 19 160 69, hsbar vsbar size
  48.   edit "Server:port", 2, 2 4 80 10, autohs
  49.   button "Add", 3, 85 3 32 12
  50.   button "Remove", 4, 120 3 32 12
  51. }
  52. On *:Dialog:Servadd:*:*:{
  53.   If ($devent == Init) {
  54.     Var %List.Servadd 1
  55.     While (%List.Servadd <= $Lines(Documents\Servers.Txt)) {
  56.       Did -a $dname 1 $read(Documents\Servers.txt,%List.Servadd)
  57.       Inc %List.Servadd
  58.     }
  59.   }
  60.   If ($devent == Sclick) {
  61.     If ($did = 3) {
  62.       Did -a $dname 1 $Gettok($did(2),1,95)
  63.       Did -a List 1 $Gettok($did(2),1,95)
  64.       Write Documents\Servers.txt $did(2)
  65.       Did -z List 1
  66.     }
  67.     If ($did = 4) {
  68.       Did -d $dname 1 $did(1).sel
  69.       Write -dl $did(1).sel Documents\Servers.txt
  70.       List.start
  71.     }
  72.   }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement