Project

General

Profile

[Script] /Links mIRC copycat v0.1 » Links mIRC copycat v0.1.ini

Mr. BS, 02/13/2016 08:51 PM

 
1
; http://dev.adiirc.com/boards/5/topics/520
2
; /Links mIRC copycat
3
; v0.1 by pereba
4

    
5
; Server response for each link
6
raw 364:*:{
7
  var %line $puttok($3-,$chr(40) $+ $remove($4,:) $+ $chr(41),2,32)
8
  
9
  ; Since 0 is the current server user is connected, lets add it as first row
10
  if (0 isin $4) iline -h $wname 1 %line
11
  
12
  ; Add all other servers in sequence
13
  else aline -h $wname $chr(160) $+ %line
14
  
15
  ; Prevent internal AdiIRC handle of command
16
  halt
17
}
18

    
19
; End of /Links list
20
raw 365:*: {
21
  ; Unhide window on finish
22
  window -w3 $wname
23
  
24
  ; Select first row
25
  sline $wname 1
26
  
27
  ; Put focus to window if flag -n were not used
28
  if ( [ % $+ links.active.minimized. $+ [ $cid ] ] ) {
29
    unset %links.active.minimized. $+ $cid
30
    return
31
  }
32
  window -a $wname
33
}
34

    
35
; Permission denied in some networks, then lets close the window
36
raw 481:*: {
37
  if ($wactive) {
38
    window -c $window($wname)
39
    unset %links.active.* $+ $cid
40
  }
41
}
42

    
43
; Replace internal /Links command
44
alias links {
45
  ; If disconnected, call internal /links command to echo default error msg
46
  if ($status != connected) { !links | return }
47
  
48
  ; Check if a previous /links is active, then clear window prior to resend command
49
  if ( $wactive ) { unset %links.active. $+ $cid | clear $wname }
50
  
51
  ; Open window if unavailable (-x support removed for now due an AdiIRC bug where mdi control buttons are gone)
52
  var %flags $iif(-* iswm $1,$regsubex($1,/[^n]/gSi,))
53
  if (%flags) set -e %links.active.minimized. $+ $cid $!true
54
  if (!$window($wname)) window -lkvh $+ %flags $wname
55
  
56
  ; Var to indicate links window is active
57
  set -e %links.active. $+ $cid $!true
58
  
59
  ; Print same mIRC msg to Status Window
60
  echo 17 -st $prefixsys Retrieving links...
61
  
62
  ; Call internal /Links
63
  !links $1-
64
  
65
  ; Prevent internal AdiIRC handle of command
66
  halt
67
}
68

    
69
alias -l wactive {
70
  return [ % $+ links.active. $+ [ $cid ] ]
71
}
72

    
73
; Window name where /Links output is sent
74
alias -l wname return $+(@,$adilang(Links),$chr(160),$adilang(List),$chr(160),$network)
75

    
76
on *:CLOSE:$($wname):{
77
  unset %links.active. $+ $cid
78
}
79

    
80
menu @* {
81
  dclick:$iif($active == $wname,server $gettok($line($wname,$1),1,32))
82
  -
83
  $iif($active == $wname,Connect to Server) :/server $$1
84
  $iif($active == $wname,Copy to Clipboard) :/clipboard $$1
85
  -
86
  $iif($active == $wname,Update Links) :/links
87
  -
88
  ; mIRC saves list in .ini format, since I have no idea where it can be used later, lets use simple savebuf for now
89
  $iif($active == $wname,Save Links...) :/savebuf -l $active $$sdir($adiircdir,Save Links $network) $+ \ $+ $$input(File Name:,e,Save Links $network,links_ $+ $network $+ .txt)
90
}
91

    
92
menu status {
93
  -
94
  $adilang(Links):/links
95
  -
96
}
(2-2/2)