zIRCk Final Project — File Browser

zIRCkFinalProjectv2.5 / zIRCkFinalProjectv2.5 / System / script2.mrc

script2.mrc — 20.48 KB — Download this file

[SCRIPT]
NAME=Aliases and identifiers
VERSION=2.5

; ## Aliases
; ## [AFX] 2005

; ## DLL Aliases

alias mdx { dll $+(",$scriptdirDll\mdx.dll,") $1- }
alias bars { return $shortfn($+(",$scriptdirDll\bars.mdx,")) }
alias views { return $shortfn($+(",$scriptdirDll\views.mdx,")) }
alias ctl { return $shortfn($+(",$scriptdirDll\ctl_gen.mdx,")) }
alias dlg { return $shortfn($+(",$scriptdirDll\dialog.mdx,")) }
alias popup { dll $+(",$scriptdirDll\popups.dll,") $1- }
alias hosdock { dll $+(",$scriptdirDll\hOSDock.dll,") $1- }
alias sz { dll $+(",$scriptdirDll\sZ.dll,") $1- }
alias band { return $dll($shortfn($scriptdirDll\band.dll),$1,$2) }
alias mcustom { dll $+(",$scriptdirDll\mircustom.dll,") $1- }
alias whilefix { dll $shortfn($scriptdirDll\WhileFix.dll) WhileFix . }
alias nicklust { dll $+(",$scriptdirDll\nicklust3.dll,") $1- }
alias munzip { dll $+(",$scriptdirDll\mUnzip.dll,") $1- }

; ## Configuration/Script Aliases

alias conf { if ($1) && ($2) && ($3) { writeini $+(",$scriptdirConfiguration.ini,") $1 $2 $3- } | else { return } }
alias rconf { if ($1-2) { return $readini($+(",$scriptdirConfiguration.ini,"),$1,$2) } }
alias icl { return $shortfn($+(",$scriptdirIcons\Engine\ $+ $rconf(Display,Icl) $+ ,")) }
alias _doc { return $+(",$scriptdirData\,$1,.zrk,") } 
alias dodialog { $iif(!$dialog($1),dialog -m $1 $1,dialog -v $1) }
alias mdxbutton { if ($1) && ($2-) { mdx SetBorderStyle $1 $2- $rconf(Display,ButtonStyle) } }
alias zversion { return 2.3 }

; ## ModDownload directory return

alias modstuff { 
  if ($1) {
    return $shortfn($scriptdirModDownload\ $+ $1-)
  }
}

; ## Load progressbar

alias loadpb {
  if ($rconf(General,LoadBar) = on) {
    if ($1 = -o) { dodialog load }
    elseif ($1 = -a) && ($2 isnum) && ($dialog(load)) { did -a load 1 $2 }
    elseif ($1 = -x) && ($dialog(load)) { dialog -x load }
    elseif ($1 = -t) && ($2) && ($dialog(load)) { did -ra load 2 $2- }
  }
}

; ## Return folder size by FiberOPtics

alias foldersize {
  if !$isid {
    echo -ac info * $!foldersize: This function can only be used as an identifier.
    return
  }
  if !$isdir($$1) {
    echo -ac info * $!foldersize: No such folder $1
    return
  }
  if $0 == 2 && !$istok(b k m g t 3,$2,32) {
    echo -ac info * $!foldersize: Incorrect parameter.
    return
  }
  var %size
  if $regex(fsize,$1,/^[a-z]:[\57\134]*$/i) {
    %size = $disk($1).size
  }
  else {
    var %objFso = a $+ $ticks, %objFolder = b $+ $ticks
    .comopen %objFso Scripting.FileSystemObject
    if !$comerr {
      .comclose %objFso $com(%objFso,GetFolder,1,bstr*,$1,dispatch* %objFolder)
      if $com(%objFolder) {
        !.echo -q $com(%objFolder,Size,2)
        %size = $com(%objFolder).result
        .comclose %objFolder
      }
    }
  }
  return $iif($2,$bytes(%size,$2). [ $+ [ $prop ] ],%size)
}

; ## Return mod download size

alias modsize { return $foldersize($shortfn($scriptdirModDownload\),k).suf }

; ## zIRCk Help

alias zirckhelp { run $+(",$scriptdirData\,Help.htm,") }

; ## Bandwidth down/up

alias _band_up { return $gettok($band(band,_),5,32) }

alias _band_dn { return $gettok($band(band,_),4,32) }

; ## Popup custom popup

alias pop1 { 
  tokenize 32 $dll($shortfn($scriptdirDll\popups.dll),Popup,$1-) 
  if ($isid) return $1- 
  $iif($4- != did not select a menu item,$4-)
}

; ## Change icon of dialog

alias dicon { 
  if ($1-) {
    mcustom SetIcon -w $dialog($1).hwnd $iif($gettok($readini($shortfn($2-),MODULE,ICON),1,44) > 0,$v1,0) $gettok($readini($shortfn($2-),MODULE,ICON),2,44)
  }
}

; ## /quit

alias quit {
  if ($rconf(Misc,Quits) = on) {
    quit $read($_doc(Quits)) $iif($1-,$+(,$chr(40),$1-,$chr(41)))
  }
  else { quit $1- }
}

; ## hOSDock.dll Dock method

alias hdock { 
  var %d = hosdock
  if ($1 = -dock) {
    %d Dock $2 $3 -1 $4-
  }
  elseif ($1 = -udock) {
    %d Undock $2-
  }
  elseif ($1 = -hidetb) {
    %d ShowToolBar false
  }
  elseif ($1 = -showtb) {
    %d ShowToolBar true
  }
  elseif ($1 = -hidesb) {
    %d ShowSwitchBar false
  }
  elseif ($1 = -showsb) {
    %d ShowSwitchBar true
  }
  elseif ($1 = -docksize) {
    %d DockSize $2-
  }
}

; ## $branch snippet by Morphy

alias branch {
  var %d = $1
  var %i = $2
  if ($dialog(%d)) {
    var %b = $gettok($did(%d,%i,1),4-,32)
    var %n = $calc($numtok(%b,32) -1)
    if (%n = 0) did -i %d %i 1 cb root
    else { did -i %d %i 1 cb root $gettok(%b,1- $+ %n,32) }
    return $gettok($gettok($did(%d,%i,$gettok(%b,-1,32)),7-,32),1,9)
  }
}

; ## $cell snippet by Morphy

alias cell {
  return $gettok($gettok($gettok($did($1,$2,$3),$4,9),$iif($4 = 1,6,5) $+ -,32),1,4)
}

; ## /import_notify by Morphy

alias import_notify {
  var %f = $sfile($mircdir)
  if ($right(%f,4) != .ini) { halt }
  var %n = 0
  while $readini(%f,notify,n $+ %n) {
    whilefix
    var %h = $readini(%f,notify,n $+ %n)
    var %nick = $iif($chr(58) isin %h,$left($gettok(%h,1,58),-4),%h)
    var %note = $gettok(%h,2-,58)
    if (!$notify(%nick)) { notify %nick %note }
    inc %n
  }
  _updatenl
}

; ## $counticons snippet by Xint

alias counticons {
  if ($version < 6.1) return
  var %file = $iif("*" !iswm $1-," $+ $longfn($1-) $+ ",$1-)
  var %i = 0
  window -nhp @counticon
  while (!$error) {
    drawpic -no @counticon 1 1 %i %file
    inc %i
  }
  :error
  reseterror
  window -c @counticon
  return %i
}

; ## Check for updates

alias zupdates { 
  sockclose z
  sockopen z coderscore.org 80
  if ($dialog(config)) { did -r config 97 }
}

; ## Check for other updates

alias zupdates_o {
  sockclose zo
  sockopen zo coderscore.org 80
  if ($dialog(config)) { did -r config 105 }
}

; ## Check for mods

alias mupdates {
  sockclose m
  sockopen m coderscore.org 80
  if ($dialog(mods)) { did -r mods 18 }
}

; ## Update checker every x minutes (to let user know there are updates if they don't check config too often)

alias zfastupdates {
  sockclose z2
  sockopen z2 coderscore.org 80
}

alias zfastupdates_o {
  sockclose zof
  sockopen zof coderscore.org 80
}

; ## Did we find any updates?

alias zupdateinpt { 
  var %x = $input(There are $iif(%eupdates,$v1,0) engine update(s) and %oupdates other updates availble to download. Click "Yes" to proceed to the updates portion of the script configuration to get these updates.,yi,Updates found) 
  if (%x = $true) {
    dodialog config
    did -c config 1 8 
    did -f config 92
    did -h config 93,96 
    did -v config 93,96
    did -e config 96
    zupdates
    zupdates_o
  }
  unset %eupdates
  unset %oupdates
}

; ## ^BeAsT^s' /download snippet

alias download {
  if (!$isid) {
    var %4 = $iif($1 == -o,$true)
    if (%4) { tokenize 32 $2- }
    var %1 = download $+ $1,%2 = $longfn($3-)
    if (!$3) { var %3 = insufficient parameters }
    elseif ($sock(%1)) { var %3 = $+(',$1,') name in use }
    elseif (!$isdir(%2)) { var %3 = no such dir $+(',%2,') }
    if (%3) { if ($show) { echo $color(info) -se * /download: %3 } | return }
    unset % [ $+ [ %1 $+ .* ] ]
    set % [ $+ [ %1 $+ .file ] ] $+(%2,$iif($right(%2,1) != $chr(92),$chr(92)),$gettok($2,-1,47))
    set % [ $+ [ %1 $+ .url ] ] http:// $+ $remove($2,http://))
    set % [ $+ [ %1 $+ .ctime ] ] $ctime 0
    set % [ $+ [ %1 $+ .status ] ] Connecting
    if (%4) { .remove $+(",$dl.var(%1,file),") }
    sockopen %1 $gettok($remove($2,http://),1,47) 80
  }
  else {
    if ($1 == 0) { return $sock(download*,0) }
    if ($iif($1 isnum,$sock(download*,$1),$sock(download $+ $1))) {
      var %1 = $ifmatch,%2 = $dl.var(%1,file),%3 = $dl.var(%1,size),%4 = $file(%2).size
      if (!$prop) { return $right(%1,-8) }
      elseif ($prop == ip) { return $sock(%1).ip }
      elseif ($prop == status) { return $dl.var(%1,status) }
      elseif ($prop == url) { return $dl.var(%1,url) }
      elseif ($prop == file) { return %2 }
      elseif ($prop == type) { return $dl.var(%1,type) }
      elseif ($prop == size) { return %3 }
      elseif ($prop == rcvd) { return %4 }
      elseif ($prop == cps) { return $int($calc(%4 / ($ctime - $dl.var(%1,ctime,2)))) }
      elseif ($prop == pc) { return $int($calc($file(%2).size * 100 / %3)) }
      elseif ($prop == secs) { return $calc($ctime - $dl.var(%1,ctime,1)) }
    }
  }
}
alias dl.var { return $gettok(% [ $+ [ $+($1,.,$2) ] ],$iif(!$3,1-,$3),32) }
alias dl.fail { var %1 = $right($1,-8) | .signal -n download_fail %1 $2- | close -d %1 }

alias dl.httpcode {
  var %1 = $1 | goto %1
  :100 | return Continue
  :101 | return Switching Protocols
  :200 | return OK
  :201 | return Created
  :202 | return Accepted
  :203 | return Non-Authoritative Information
  :204 | return No Content
  :205 | return Reset Content
  :206 | return Partial Content
  :300 | return Multiple Choices
  :301 | return Moved Permanently
  :302 | return Moved Temporarily
  :303 | return See Other
  :304 | return Not Modified
  :305 | return Use Proxy
  :400 | return Bad Request
  :401 | return Unauthorized
  :402 | return Payment Required
  :403 | return Forbidden
  :404 | return Not Found
  :405 | return Method Not Allowed
  :406 | return Not Acceptable
  :407 | return Proxy Authentication Required
  :408 | return Request Time-out
  :409 | return Conflict
  :410 | return Gone
  :411 | return Length Required
  :412 | return Precondition Failed
  :413 | return Request Entity Too Large
  :414 | return Request-URI Too Large
  :415 | return Unsupported Media Type
  :416 | return Requested Range Not Satisfiable
  :500 | return Internal Server Error
  :501 | return Not Implemented
  :502 | return Bad Gateway
  :503 | return Service Unavailable
  :504 | return Gateway Time-out
  :505 | return HTTP Version not supported
  :%1 | return
}

alias close {
  if ($1 == -d) {
    var %1 = download $+ $2
    if ($sock(%1)) { unset % [ $+ [ %1 $+ .* ] ] | sockclose %1 }
  }
  else { close $1- }
}

; ## Window icon

alias wicon {
  if ($1-) {
    var %c,%a = $window($1-).type
    if (%a = status) { %c = $sbico(1) }
    if (%a = channel) { %c = $sbico(2) }
    if (%a = query) { %c = $sbico(3) }
    if (%a = picture) || (%a = custom) { %c = $sbico(4) }
    if (%a = chat) { %c = $sbico(5) }
    if (send = $gettok($active,1,32)) { %c = $sbico(6) }
    if (get = $gettok($active,1,32)) { %c = $sbico(7) }
    %c = $replace(%c,$chr(44),$chr(32))
    %c = $calc($gettok(%c,1,32) +1) $gettok(%c,2-,32)
    mcustom SetIcon -w $window($1-).hwnd %c
  }
}

; ## NickLUST initialization/callback

alias nlust.chan {
  if ($1) && ($rconf(Display,Nicklust) = on) {
    nicklust Mark $window($1).hwnd nlist_cb rowselect tooltips hideempty
    if ($rconf(Nicklust,Icons) = on) {
      nicklust AddIcon $1 > $shortfn($scriptdirIcons\op.ico)
      nicklust AddIcon $1 > $shortfn($scriptdirIcons\voice.ico)
      nicklust AddIcon $1 > $shortfn($scriptdirIcons\nrm.ico)
      nicklust AddIcon $1 > $shortfn($scriptdirIcons\hop.ico)
      nicklust AddIcon $1 > $shortfn($scriptdirIcons\usr.ico)
      nicklust AddIcon $1 > $shortfn($scriptdirIcons\spr.ico)
      nicklust AddIcon $1 > $shortfn($scriptdirIcons\ownr.ico)
    }
    nicklust SetGroupText $1 1 > Normal users
    nicklust AddGroup $1 10 + 2 > Voiced users
    nicklust AddGroup $1 11 @ 1 > Channel Operators
    nicklust AddGroup $1 12 % 4 > Half Operators
    nicklust AddGroup $1 13 - 5 > User Operators
    nicklust AddGroup $1 14 & 6 > Super Operators
    nicklust AddGroup $1 15 ~ 7 > Owners
    nicklust SetGroupView $1 1 normal
    nicklust SetGroupView $1 10 normal
    nicklust SetGroupView $1 11 normal
    nicklust SetGroupView $1 12 normal
    nicklust SetGroupView $1 13 normal
    nicklust SetGroupView $1 14 normal
    nicklust SetGroupView $1 15 normal
    nicklust SetGroupIcon $1 1 3
    nicklust SetGroupPos $1 11 start
    nicklust SetGroupPos $1 12 end
    nicklust SetGroupPos $1 13 end
    nicklust SetGroupPos $1 14 end
    nicklust SetGroupPos $1 15 end
    nicklust SetGroupPos $1 10 end
    nicklust SetGroupPos $1 1 end
    nicklust SetHeaderFontStyle $1 bold
    nicklust SetBranchImage $1 > 0
    theme_nlist $1
  }
}

alias nlist_cb { 
  if ($1 = tooltip) {
    var %extra
    if ($3 == $me) %extra = (Your nick)
    nicklust SetTipTitle $2 1 > Info on $3 %extra
    return Status: $nlist_pnick($remove($nick($2,$3).pnick,$3)) $+ $crlf $+ Idle: $duration($nick($2,$nick($2,$3)).idle) $+ $crlf $+ Notify list: $iif($notify($3),Yes,No) $+ $crlf $+ Address: $iif($address($3,4),$ifmatch,Unavailable)
  }
}

alias nlist_pnick {
  if ($1 = @) { return Channel Operator }
  elseif ($1 = +) { return Voiced User }
  elseif ($1 = %) { return Half User }
  elseif ($1 = -) { return User Operator }
  elseif ($1 = &) { return Super Operator }
  elseif ($1 = ~) { return Owner }
  elseif ($1 = $null) { return Normal User }
}

alias theme_nlist {
  nicklust SetColor $1 bkg $color($color(background))
  nicklust SetColor $1 text $color($color(listbox text))
  nicklust SetColor $1 divider $color($color(normal)) $color($color(background))
  nicklust SetHeaderColor $1 1 $color($color(listbox text))
  nicklust SetHeaderColor $1 10 $color($color(listbox text))
  nicklust SetHeaderColor $1 11 $color($color(listbox text))
  nicklust SetHeaderColor $1 12 $color($color(listbox text))
  nicklust SetHeaderColor $1 13 $color($color(listbox text))
  nicklust SetHeaderColor $1 14 $color($color(listbox text))
  nicklust SetHeaderColor $1 15 $color($color(listbox text))
}

; ## Connection status (this should really be in the toolbar file, but this alias checks toolbar and mini toolbar)

alias _toolbar.s {
  if ($dialog(tb)) {
    scid $activecid
    if ($scid($activecid).status = connecting || $scid($activecid).status = connected) { 
      did -o tb 1 2 +v 2 $chr(160) Disconnect $chr(9) $+ Disconnect 
    }
    else {
      did -o tb 1 2 +va 1 $chr(160) Connect $chr(9) $+ Connect 
    }
  }
  if ($dialog(bbar)) {
    scid $activecid
    if ($scid($activecid).status = connecting || $scid($activecid).status = connected) { 
      did -o bbar 2 2 +va 2 $chr(9) $+ Disconnect 
    }
    else {
      did -o bbar 2 2 +va 1 $chr(9) $+ Connect 
    }
  }
}

; ## Toolbar refresh (this should really be in the toolbar file, but this alias checks toolbar and mini toolbar)

alias tb_refresh {
  if ($dialog(tb)) {
    tb_bandcheck
    did -r tb 1
    did -i tb 1 1 bmpsize 32 32
    did -i tb 1 1 setimage icon large 0, $+ $icl
    did -i tb 1 1 setimage icon large 1, $+ $icl
    did -i tb 1 1 setimage icon large 2, $+ $icl
    did -i tb 1 1 setimage icon large 3, $+ $icl
    did -i tb 1 1 setimage icon large 4, $+ $icl
    did -i tb 1 1 setimage icon large 5, $+ $icl
    did -i tb 1 1 setimage icon large 6, $+ $icl
    did -i tb 1 1 setimage icon large 7, $+ $icl
    did -i tb 1 1 setimage icon large 8, $+ $icl
    did -i tb 1 1 setimage icon large 9, $+ $icl
    did -a tb 1 +av 1 $chr(160) Connect $chr(9) $+ Connect
    did -a tb 1 +a -
    did -a tb 1 +a 3 $chr(9) $+ Configuration
    did -a tb 1 +a -
    did -a tb 1 +a 4 $chr(9) $+ Module Manager
    did -a tb 1 +a 5 $chr(9) $+ zAmp Audio Player
    did -a tb 1 +a 6 $chr(9) $+ KTE Themes
    did -a tb 1 +a -
    did -a tb 1 +ac $+ $iif($rconf(Display,Sidepane) = on,x) 7 $chr(9) $+ Enable/disable sidepane
    did -a tb 1 +a -
    did -a tb 1 +a 8 $chr(9) $+ Open mIRC directory
    did -a tb 1 +a 9 $chr(9) $+ zIRCk Help
    did -a tb 1 +a 10 $chr(9) $+ About
    mdx MoveControl tb 2 1 6 4 38
    if ($rconf(Display,XPBScheme) = on) { did -i tb 1 1 setscheme $rgb(110,110,110) $rgb(110,110,110) }
    else { did -i tb 1 1 setscheme default default }
    if ($rconf(Display,XPBkg) = on) {
      mdx SetDialog tb bgcolor $rgb(215,211,208) 
      mdx SetColor tb 1 background $rgb(215,211,208) 
    }
    else { 
      mdx SetDialog tb bgcolor $rgb(face)
      mdx SetColor tb 1 background reset
    }
  }
  if ($dialog(bbar)) {
    did -r bbar 2
    did -i bbar 2 1 bmpsize 16 16
    did -i bbar 2 1 setimage icon small 0, $+ $icl
    did -i bbar 2 1 setimage icon small 1, $+ $icl
    did -i bbar 2 1 setimage icon small 2, $+ $icl
    did -i bbar 2 1 setimage icon small 3, $+ $icl
    did -i bbar 2 1 setimage icon small 4, $+ $icl
    did -i bbar 2 1 setimage icon small 5, $+ $icl
    did -i bbar 2 1 setimage icon small 6, $+ $icl
    did -a bbar 2 +av 1 $chr(9) $+ Connect
    did -a bbar 2 +a 3 $chr(9) $+ Configuration
    did -a bbar 2 +a 4 $chr(9) $+ Module Manager
    did -a bbar 2 +a 5 $chr(9) $+ zAmp
    did -a bbar 2 +a 6 $chr(9) $+ KTE Themes
    did -a bbar 2 +ac $+ $iif($rconf(Display,Sidepane) = on,x) 7 $chr(9) $+ Enable/disable sidepane
    did -a bbar 2 -
  }
  _toolbar.s
}

; ## Switchbar refresh

alias bbar_refresh {
  if ($dialog(bbar)) {
    did -r bbar 3
    did -i bbar 3 1 bmpsize 16 16
    did -i bbar 3 1 setimage icon small $sbico(1)
    did -i bbar 3 1 setimage icon small $sbico(2)
    did -i bbar 3 1 setimage icon small $sbico(3)
    did -i bbar 3 1 setimage icon small $sbico(4)
    did -i bbar 3 1 setimage icon small $sbico(5)
    did -i bbar 3 1 setimage icon small $sbico(6)
    did -i bbar 3 1 setimage icon small $sbico(7)
    load.sb
  }
}

; ## Scripted version reply alias by []DLAST|C

alias vspoof {
  if ($1 != -halt) {
    window -h $+(@,vspoof.,$cid)
    .debug -in $+(@,vspoof.,$cid) vspoof.int
    $iif($1-,set,unset) $+(%,vspoof.str.,$cid)) $1-
  }
  if ($1 = -halt) {
    unset $+(%,vspoof.*.,$cid)
    window -c $+(@,vspoof.,$cid)
  }
}

alias vspoof.int {
  tokenize 32 $1
  if ($($+(%,vspoof.n.,$cid),2)) { .ignore -rt $v1 | unset $+(%,vspoof.n.,$cid) }
  if ($1 == <-) && ($5 == :VERSION) {
    tokenize 32 $right($gettok($2,1,33),-1) $4 VERSION
    var %vspoof.d 20
    while (%vspoof.d) { if ($address($1,%vspoof.d) isignore ctcp) { return } | dec %vspoof.d }
    .ignore -t $1
    set $+(%,vspoof.n.,$cid) $1
    if (!$istok(#.&,$left($2,1),46)) { linesep -s }
    echo -c ctcp $iif($istok(#.&,$left($2,1),46),$2) $+([,$1,$iif($v1,$+(:,$2))) $3 $+ ]
    if (!$istok(#.&,$left($2,1),46)) { linesep -s }
    if ($($+(%,vspoof.str.,$cid),2)) { .ctcpreply $1 $3 $v1 }
  }
}

; ## Close and block nickname (message blocker)

alias qblockig { .scid $cid ignore $nick | scid $cid close -m $nick }

; ## Function key bindings

alias fkey { 
  if ($rconf(Misc,Fkeys) = on) {
    var %a = $gettok($read($_doc(Fkeys), $1),2-,42) | if (%a) { return $v1 } 
  }
}

alias f1 $fkey(1)
alias f2 $fkey(2)
alias f3 $fkey(3)
alias f4 $fkey(4)
alias f5 $fkey(5)
alias f6 $fkey(6)
alias f7 $fkey(7)
alias f8 $fkey(8)
alias f9 $fkey(9)
alias f10 $fkey(10)
alias f11 $fkey(11)
alias f12 $fkey(12)
alias sf1 $fkey(13)
alias sf2 $fkey(14)
alias sf3 $fkey(15)
alias sf4 $fkey(16)
alias sf5 $fkey(17)
alias sf6 $fkey(18)
alias sf7 $fkey(19)
alias sf8 $fkey(20)
alias sf9 $fkey(21)
alias sf10 $fkey(22)
alias sf11 $fkey(23)
alias sf12 $fkey(24)
alias cf1 $fkey(25)
alias cf2 $fkey(26)
alias cf3 $fkey(27)
alias cf5 $fkey(28)
alias cf6 $fkey(29)
alias cf7 $fkey(30)
alias cf8 $fkey(31)
alias cf9 $fkey(32)
alias cf10 $fkey(33)
alias cf11 $fkey(34)
alias cf12 $fkey(35)

; ## Favourite servers popup

alias favservs { 
  var %x = $mouse.dx,%y = $mouse.dy
  popup New fav 16 16
  popup SetMetrics fav iconpad 1 0 contentpad 0 0 spacing 0 0
  popup AddItem fav end +D Favourite servers (edit) $cr showfavcfg
  popup AddItem fav end +
  popup AddItem fav end +D> New connection... $cr nfav

  popup New nfav 16 16
  popup SetMetrics nfav iconpad 1 0 contentpad 0 0 spacing 0 0
  .filter -k $+(",$scriptdirFavourites.ini,") loadfs
  pop1 fav %x %y
}

alias showfavcfg {
  dodialog config
  did -f config 57 
  did -h config 60 
  did -v config 60
  did -c config 1 6 
}

alias loadfs {
  if ([*] iswm $1) { set %topic $remove($1,[,]) } 
  else { 
    if ($gettok($1-,3,42) = 2) {
      popup AddItem fav end + %topic $chr(9) $+($left($gettok($1-,1,61),12),...) $cr scid $activecid server $gettok($1-,1,61) $gettok($1-,2,42)
      popup AddItem nfav end + %topic $chr(9) $+($left($gettok($1-,1,61),12),...) $cr server -m $gettok($1-,1,61) $gettok($1-,2,42)
    } 
  }
}

; ## Arise.dll settings

alias arise_reset {
  set %arise_text $_nfonttype $+ 路8路2路 $+ $rgb($color($color(normal))) $+ 路 $+ $_nfonttype $+ 路8路1路 $+ $rgb($color($color(normal))) $+ 路 $+ $rgb($color($color(background))) $+ 路5000
}

; ## $arise identifier

alias arise { 
  dll $+(",$scriptdirDll\,arise.dll,") ShowPopup %arise_text $+ 路 $+ $replace($1,路,.) $+ 路 $+ $strip($replace($2,路,.),burc) 
}