zIRCk Final Project — File Browser

zIRCkFinalProjectv2.5 / zIRCkFinalProjectv2.5 / System / script7.mrc

script7.mrc — 6 KB — Download this file

[SCRIPT]
NAME=Popups
VERSION=2.5

; ## Add loaded modules to menubar popup

alias loadmos { 
  if ($1 == begin) { return - }
  var %loop = 1 
  while (%loop <= $lines($shortfn($scriptdirModules.cfg))) {
    if ($1 == %loop) { return $iif(!$script($read($shortfn($scriptdirModules.cfg),%loop)),$style(2)) $readini($read($shortfn($scriptdirModules.cfg),%loop),MODULE,NAME) $+ : $+ $readini($read($shortfn($scriptdirModules.cfg),%loop),MODULE,COMMAND) }
    inc %loop
  }
  if ($1 == end) { return - }
}

; ## Menubar popup

menu menubar {
  Configuration $chr(9) F1:config
  Module Manager:mods
  Tips:dodialog tips
  Help  $chr(9) F2:zirckhelp
  About:dodialog about
  -
  $submenu($loadmos($1-))
  Load theme...:kte_load
  $iif(($hget(Kte_Theme, Scheme1) != $null), Change scheme)
  .$iif((!$hget(Kte_Data, CurScheme)), $style(1)) No scheme:kte_scheme -d
  .-
  .$submenu($kte_listschemes($1))
  -
  zAmp
  .Open player:zamp
  .-
  .Config:zcfg
  .Playlist editor:zplcreate 
  .-
  .View readme:run notepad $shortfn($scriptdirzAmp\readme.txt)
}

; ## Nicklist popup 

menu nicklist {
  Whois:whois $1 $1
  Query:query $1-
  $iif($notify($1),$style(1))) Notify list: $+ $iif($notify($1),delnotify $1,addnotify $1)
  -
  Control
  .$iif($me isop $chan,Op,$style(2) $+ Op):mode $chan +oooooo $1-
  .$iif($me isop $chan,Deop,$style(2) $+ Deop):mode $chan -oooooo $1-
  .$iif($me isop $chan || $me ishop $chan,Voice,$style(2) $+ Voice):mode $chan +vvvvvv $1-
  .$iif($me isop $chan || $me ishop $chan,Devoice,$style(2) $+ Devoice):mode $chan -vvvvvv $1-
  .-
  .$iif($me isop $chan || $me ishop $chan,Ban,$style(2) $+ Ban):ban $chan $1
  .$iif($me isop $chan || $me ishop $chan,Kick,$style(2) $+ Kick):kick $chan $1 Owned
  .$iif($me isop $chan || $me ishop $chan,Kickban,$style(2) $+ Kickban):ban $chan $1 | .timer 1 2 kick $chan $1 Owned
  CTCP
  .Ping:ctcp $1 ping
  .Time:ctcp $1 time
  .Version:ctcp $1 version
  .-
  .Other...:ctcp $1 $$?="Enter ctcp:"
  DCC
  .Send:dcc send $1
  .Chat:dcc chat $1
  .Allow:dccallow $+(+,$1)
  XDCC
  .Request pack:.msg $1 xdcc send $$?="Enter pack number:"
  .Remove from queue:.msg $1 xdcc remove $$?="Enter pack number:"
  .List queues:.msg $1 xdcc queues
  -
  $iif($istok(%msgnicks,$1,32),$style(1)) Exclude blocked words:msgblock $1
}

; ## Add/remove nick from excluded message blocker list thing

alias msgblock {
  if ($1) && ($istok(%msgnicks,$1,32)) {
    var %s = $findtok(%msgnicks,$1,32) | set %msgnicks $deltok(%msgnicks,%s,32)
  }
  elseif ($1) && (!$istok(%msgnicks,$1,32)) {
    set %msgnicks $addtok(%msgnicks,$1,32)
  }
}

; ## Channel popup

menu channel {
  $style(2) $chan:return
  -
  $iif($me !isop #,$style(2)) Modes
  .$iif(t isin $chan(#).mode,$style(1)) Control topic $chr(9) (t):mode # $iif(t isin $chan(#).mode,-t,+t)
  .$iif(s isin $chan(#).mode,$style(1)) Secret        $chr(9) (s):mode # $iif(s isin $chan(#).mode,-s,+s)
  .$iif(p isin $chan(#).mode,$style(1)) Private       $chr(9) (p):mode # $iif(p isin $chan(#).mode,-p,+p)
  .$iif(m isin $chan(#).mode,$style(1)) Moderate      $chr(9) (m):mode # $iif(m isin $chan(#).mode,-m,+m)
  .$iif(i isin $chan(#).mode,$style(1)) Invite only   $chr(9) (i):mode # $iif(i isin $chan(#).mode,-i,+i)
  .$iif(n isin $chan(#).mode,$style(1)) No ext. msg's $chr(9) (n):mode # $iif(n isin $chan(#).mode,-n,+n)
  .$iif(l isin $chan(#).mode,$style(1)) Limit...      $chr(9) (l):{
    if (l isin $chan(#).mode) mode # -l
    elseif ($input(Enter a channel limit for # ,1,Channel Limit)) mode # +l $ifmatch
  }
  .$iif(k isin $chan(#).mode,$style(1)) Set key...    $chr(9) (k):{
    if (k isin $chan(#).mode) mode # -k $chan(#).key
    elseif ($input(Enter a channel key for # ,1,Channel Key)) mode # +k $ifmatch
  }
  .-
  .$iif($chan(#).mode,Remo&ve current modes):mode # - $+ $right($chan(#).mode,-1)
  .&Other...:{
    var %m = $input(Enter modes for $chan ,1,Specify channel modes)
    if (%m) mode # $iif($left(%m,1) !isin +-,$+(+,%m),%m)
  }
  -
  Hop:hop
  Part:part
  Part all:join 0
  -
  $iif($isaj(#),$style(1)) Autojoin:isaj $chan
  Send action
  .Bandwidth usage:/msg $chan Bandwidth usage: $_band_dn $+ KB in, $_band_up $+ KB out
  .Hard disk space:/msg $chan Hard disks information: $disks
  .Lag time on active server:/msg $chan Lag: $network ( $+ $server $+ ): %lag secs
  .$iif(!$insong,$style(2)) Song:/msg $chan Listening to: $zsong
  .Transfers:/msg $chan DCC Transfers: $send(0) sends, $get(0) gets, $calc($send(0) + $get(0)) total transfers
  .Uptimes:/msg $chan Uptimes: mIRC/zIRCk: $uptime(mirc,1) $+ , system: $uptime(system,1) $+ , connection: $uptime(server,1)
  .- 
  ./me:/me $$?="Enter action:"
  ./ame:/ame $$?="Enter action:"
  ./amsg:/amsg $$?="Enter message:"
  ./notice:/notice $chan $$?="Enter notice:"
  ./onotice:/onotice $chan $$?="Enter notice:"
}

; ## Return if active channel is or isn't in auto join

alias isaj {
  if ($1) {
    var %a = $read($_doc(AutoJoin), w, $+(*,$1,*,$network,*,)),%l = $readn
    if ($isid) { return $iif(%a,$true,$false) }
    else { 
      if %a { write -dl $+ %l $_doc(AutoJoin) }
      else { write $_doc(AutoJoin) $+(2,*,$chan,*,$network,*,$iif($chan($1).key,$v1)) }
    }
  }
}

; ## Status window popup

menu status {
  $style(2) $iif($network,$ifmatch,$iif($!network,$server,$iif(!$server,Not Connected))):return
  -
  Clear window:/_outputmsg
  Links list:/links
  Lusers:/lusers
  Channels list:/list
  -
  Identify to active nick: $iif($script(Auto Join-Identify.mod),_id $cid)
  Join autojoin channels: $iif($script(Auto Join-Identify.mod),_aj)
}

; ## Main message

alias _outputmsg {
  clear -s
  echo -s zIRCk standing by...
  echo -s $chr(160) $+(,$chr(187),)  Nickname: $me / Started on $date
}

; ## Return disk size 

alias disks {
  var %i = 1,%d
  while (%i <= $disk(0)) {
    if ($disk(%i).type = fixed) {
      %d = %d $+(,$disk(%i).path,:) Total: $bytes($disk(%i).size,g).suf - Free: $bytes($disk(%i).free,g).suf
    }
    inc %i
  }
  return %d
}