Zion Sphinx — File Browser

ZionSphinxv3.0 / ZionSphinxv3.0 / plugins / zion_infosquare.mrc

zion_infosquare.mrc — 19.8 KB — Download this file

; --------< Zion Plugin >------------------------------------------
; Name....: InfoSquare
; Ver.....: 1.0b300807
; Author..: sprion
; Email...: sprion@lyniq.com
; Date....: 30 Aug 07
; URL.....: http://zinc.sg
; Info....: A little square box that shows you detailed information about the connections/spams
; Changes.: Added Report Cheater menuitem.
;---------------------------------------------------------------------
;translatable

on *:signal:zion_unload:.unload -rs $+(",$script,")
on *:load:z.note $z.head(plugin) $ $nopath($script) $z.lang(sys,loaded) | .signal -n zion_plugin_load $script
on *:unload:_cleanup | .signal -n zion_plugin_unload $script

on *:signal:zion_cmdlistopen:{
  zion.listcmd F9 ; Hit this function key to open/close the InfoSquare.
}

; provide userinfo information of this plugin
on *:signal:zion_userinfo.requestver:zion.user.adddetails $z.fileinfo($script,Name) $ $z.fileinfo($script,Ver)

; info square plugin
alias -l id return $nopath($script)
alias -l _cleanup .timerzion.infosquare.le.repeat off | window -c @z.infosquare | unset %zion.infosq.*

; height of each playerbox
alias -l _h return 53

alias f9 {
  var %w @z.infosquare
  if ($active = %w) { window -n %w | window -a %zion.s.chat }
  elseif ($window(%w)) window -roa %w
  else z.infosq.open
}
alias z.infosq.open {
  var %w @z.infosquare
  ; used to no check appactive
  if (($appactive) && ($window(%w))) window -ar %w
  var %crd $z3.findtog($id,spamwincoords),%x $iif(%crd,$gettok(%crd,1,32),$calc($window(-1).w - 150)),%y $iif(%crd,$gettok(%crd,2,32),50),%chunk window -k0phod +f %w %x %y
  if ($z3.findtog($id,size,1)) %chunk 200 58
  else %chunk 50 50
  
  z.infosq.udcount $zion.s.spam.nowp $zion.s.spam.max
  if ($appactive) window -a %w
  drawdot %w
}
alias z.infosq.cls drawrect -nfr @z.infosquare 49 1 0 0 $window(@z.infosquare).dw $window(@z.infosquare).dh
alias z.infosq.le.cls drawrect -nfr @z.infosquare 49 1 2 51 $window(@z.infosquare).dw $window(@z.infosquare).dh
alias z.infosq.z {
  var %zl InfoSquare (F9 to toggle)$F9 to show$F9$try F9$hit F9$F9 to hide,%z = $gettok(%zl,$r(1,6),36),%w @z.infosquare,%wh $window(%w).dh,%ww $window(%w).dw,%f tahoma,%s -8,%h = $height(%z,%f,%s),%y = $width(%z,%f,%s)
  drawtext -r %w $rgb(255,255,255) %f %s $calc(%ww /2 - (%y /2)) $calc(%wh /2 - (%h /2)) %z
}
alias z.infosq.udcount {
  var %c
  if ($2) %zion.infosq.countmax = $2
  if (%zion.infosq.count > $1) {
    %c = $rgb(255,0,0)
    unset %zion.infosq.full
  }
  else {
    %c = $rgb(255,255,0)
    if ((!%zion.infosq.full) && ($1 = %zion.infosq.countmax) && (%zion.infosq.countmax isnum)) { %zion.infosq.full = 1 | .timer -om 1 200 z.splay snd_gamefull }
  }
  %zion.infosq.count = $1
  z.infosq.count -r %c $1 %zion.infosq.countmax
  .timer -om 1 100 z.infosq.count $replace($1 %zion.infosq.countmax,$chr(124),chr(124))
  
}
alias z.infosq.count {
  var %a $replace($1-,chr(124),$chr(124))
  if (!$z3.findtog($id,size)) z.infosq.drawsmall %a
  else z.infosq.drawbig %a
}
alias z.infosq.le.drawbox {
  var %win @z.infosquare,%wh $window(%win).dh,%gh,%ww $window(%win).dw,%m $z.infosq.le.mousechk($1,$2),%cl,%x,%y,%w,%h,%r $hget(zion.le3.statuses,$2)
  if (!%m) {
    ; box
    ; %cl = $rgb(100,100,100)
    if (%r = part) %cl = $rgb(150,30,30)
    elseif (%r = loadok) %cl = $rgb(30,150,30)
    else %cl = $rgb(100,100,100)
  }
  elseif (%m = h) {
    ; hover
    ;    %cl = $rgb(150,150,170)
    if (%r = part) %cl = $rgb(250,50,50)
    elseif (%r = loadok) %cl = $rgb(40,210,40)
    else %cl = $rgb(150,150,170)
    
  }
  elseif (%m = c) {
    ; click
    %cl = $rgb(50,50,250)
    ;    z.infosq.menumake $2
  }
  ;4 54 183 28
  %x = 4
  %y = $calc(($2 -1) * $_h +54)
  %w = 183
  %h = $calc($_h -4)
  drawrect -dnfr %win %cl 1 %x %y %w %h 5 5
  %gh = $calc($calc(($3 -1) * $_h +54) + %h +13)
;  %gh = $calc($calc(($3 -1) *48 +54) + %h +13)
  
  if (%wh < %gh) window -b %win $window(%win).x $window(%win).y 200 %gh
  if (%m = c) .timer 1 0 z.infosq.menumake $2
  if ($isid) return %cl
}
alias z.infosq.menumake {
  var %v z.infosq.gamer,%n $hget(zion.le3.ircnicks,$1),%ip $hget(zion.le3.ips,$1),%f $hget(zion.infosq.forumid,$1),%m $z.lang(zionle3,quit), %q $iif($right(%n,$len(%m)) = %m,1,0)
  %zion.infosq.name = $hget(zion.le3.gamenicks,$1)
  %zion.infosq.forumid = %f
  %zion.infosq.nick = $iif(%q,$remove(%n,$z.lang(zionle3,quit)),%n)
  %zion.infosq.ip = %ip
  if ($xpopup(%v).ismenu) xpopup -d %v
  
  xpopup -c %v normal
  xpop -a %v 1 $chr(9) $iif(%n,+,+g) 1 0 $z.lang(infosq,sendmsg)
  xpop -a %v 2 $chr(9) $iif(%ip,+,+g) 4 0 $z.lang(infosq,traceip)
  xpop -a %v 3 $chr(9) +g 0 0 -
  xpop -a %v 4 $chr(9) $iif(%ip,+,+g) 2 0 $z.lang(infosq,copytoclip)
  xpop -c %v 4
  xpop -a %v 4 1 $chr(9) + 51 0 $z.lang(infosq,copyname)
  xpop -a %v 4 2 $chr(9) $iif(%n,+,+g) 52 0 $z.lang(infosq,copynick)
  xpop -a %v 4 3 $chr(9) $iif(%f,+,+g) 53 0 $z.lang(infosq,copyforum)
  xpop -a %v 4 4 $chr(9) $iif(%ip,+,+g) 54 0 $z.lang(infosq,copyip)
  xpop -a %v 4 5 $chr(9) +g 0 0 -
  xpop -a %v 4 6 $chr(9) + 55 0 $z.lang(infosq,copyall)
  
  xpop -a %v 5 $chr(9) $iif(%ip,+,+g) 2 0 Host Tools
  xpop -c %v 5
  xpop -a %v 5 1 $chr(9) + 61 0 Disconnect User
;  xpop -a %v 5 2 $chr(9) + 0 0 -
;  xpop -a %v 5 3 $chr(9) $iif(%n,+,+g) 62 0 Refresh
  
  xpop -a %v 6 $chr(9) +g 0 0 -
  xpop -a %v 7 $chr(9) $iif(%n,+,+g) 3 0 $z.lang(infosq,viewinfo)
  xpop -a %v 8 $chr(9) $iif(%n,+,+g) 30 0 $z.lang(infosq,reportrate)
  
  xpop -c %v 8
  
  xpop -a %v 8 1 $chr(9) $iif(%f,+,+g) 31 0 $z.lang(infosq,+1)
  xpop -a %v 8 2 $chr(9) $iif(%f,+,+g) 32 0 $z.lang(infosq,-1)
  xpop -a %v 8 3 $chr(9) +g 0 0 -
  xpop -a %v 8 4 $chr(9) $iif(%f,+,+) 33 0 $z.lang(infosq,reportcheater)
  
  if ($me isop %zion.s.chat) {
    xpop -a %v 9 $chr(9) +g 0 0 -
    xpop -a %v 10 $chr(9) $iif(%ip,+,+g) 20 0 $z.lang(infosq,admintools)
    xpop -c %v 10
    xpop -a %v 10 1 $chr(9) +g 40 0 $z.lang(infosq,donotabuse)
    xpop -a %v 10 2 $chr(9) +g 0 0 -
    xpop -a %v 10 3 $chr(9) $iif(%n ison %zion.s.chat,+,+g) 21 0 $z.lang(infosq,kick)
    xpop -a %v 10 4 $chr(9) $iif(%n ison %zion.s.chat,+,+g) 22 0 $z.lang(infosq,kickwhy)
;    xpop -a %v 8 5 $chr(9) $iif(((%n) || (%ip)),+,+g) 23 0 ----
    
    xpop -a %v 10 6 $chr(9) $iif(%n ison %zion.s.chat,+,+g) 24 0 $z.lang(infosq,leaver)
    xpop -a %v 10 7 $chr(9) $iif(%n ison %zion.s.chat,+,+g) 25 0 $z.lang(infosq,zacdirty)
    xpop -a %v 10 8 $chr(9) $iif(%n ison %zion.s.chat,+,+g) 26 0 $z.lang(infosq,AFK)
  }
  
  ; modify pre-run menuitem
  ;  xpop -s %v 3 $chr(9) $iif(%zion.le.on,+g,+)
  
  xpopup -s %v +mlt $mouse.dx $mouse.dy
}
on *:signal:xpopup-z.infosq.gamer:{
  var %n %zion.infosq.nick
  if ($1 = 1) { query %n | window -a %n }
  elseif ($1 = 2) clipboard %zion.infosq.ip
  elseif ($1 = 51) clipboard %zion.infosq.name
  elseif ($1 = 52) clipboard %n
  elseif ($1 = 53) clipboard %zion.infosq.forumid
  elseif ($1 = 54) clipboard %zion.infosq.ip
  elseif ($1 = 55) clipboard IRC: %n ; Forum: %zion.infosq.forumid ; IP: %zion.infosq.ip ; Name: %zion.infosq.name
  elseif ($1 = 61) z.killcon 6112 %zion.infosq.ip
  elseif ($1 = 3) zion.userinfo %n
  elseif ($1 = 4) { window -a %zion.s.chat | z.trace %zion.infosq.ip }
  elseif ($1 = 21) z.kick %n $z.lang(infosq,rules) http://rules.zincplay.com
  elseif ($1 = 22) z.kick %n
;  elseif ($1 = 23) z.quitban $iif(%n,$ifmatch,%zion.infosq.ip)
  
  elseif ($1 = 24) {
    if ($input(User: %n $crlf $+ $crlf $+ Continue with ban?,uywd,Zion R&R: D2.1. Admin Game - Leaver)) {
      if (ZincBot isop %zion.s.chat) .ctcp $v1 ADMINCMD %zion.enforcer.version D2.1 %n
      else z.ban -ku10800 %n 7,0Zion R&R: 4D2.1. Admin Game - Leaver 7(43 7hour ban)
    }
  }
  elseif ($1 = 25) {
    if ($input(User: %n $crlf $+ $crlf $+ Continue with ban?,uywd,Zion R&R: D2.2. Admin Game - ZAC Dirty)) {
      if (ZincBot isop %zion.s.chat) .ctcp $v1 ADMINCMD %zion.enforcer.version D2.2 %n
      else z.ban -ku10800 %n 7,0Zion R&R: 4D2.2. Admin Game - ZAC Dirty 7(43 7hour ban)
    }
  }
  elseif ($1 = 26) {
    if ($input(User: %n $crlf $+ $crlf $+ Continue with ban?,uywd,Zion R&R: D2.3. Admin Game - AFK)) {
      if (ZincBot isop %zion.s.chat) .ctcp $v1 ADMINCMD %zion.enforcer.version D2.3 %n
      else z.ban -ku10800 %n 7,0Zion R&R: 4D2.3. Admin Game - AFK 7(43 7hour ban)
    }
  }
  
  elseif ($1 = 31) {
;    set -u30 %zion.s.user.cmd 109 %zion.infosq.nick | zion.userinfo %zion.infosq.nick
    z.modpop + %zion.infosq.forumid $iif(!%q,%zion.infosq.nick)
  }
  elseif ($1 = 32) {
;    set -u30 %zion.s.user.cmd 110 %zion.infosq.nick | zion.userinfo %zion.infosq.nick
    z.modpop - %zion.infosq.forumid $iif(!%q,%zion.infosq.nick)
  }
  elseif ($1 = 33) {
  }
}
alias z.infosq.le.mousechk {
  if ($mouse.win = @z.infosquare) {
    var %x 2,%y,%w 189,%h $calc($_h -2)
    %y = $calc(($2 -1) * $_h +54)
    if ($inrect($mouse.x,$mouse.y,%x,%y,%w,%h)) {
      if (-*m* iswm $1) return h
      elseif (-*l* iswm $1) return c
      elseif (-*r* iswm $1) return c
      return h
    }
  }
  return 0
}
alias z.infosq.le.drawstatus {
  var %f tahoma,%win @z.infosquare,%wh $window(%w).dh,%ww $window(%w).dw,%x,%y,%w,%h,%t,%r $hget(zion.le3.statuses,$2),%cl,%rot
  if (%r = part) { %rot = -7 | %x = 51 | %w = 92 | %h = 13 | %t = DISCONNECTED | %cl = $rgb(250,30,30) }
  elseif (%r = loadok) { %rot = -10 | %x = 69 | %w = 52 | %h = 13 | %t = LOAD OK | %cl = $rgb(30,230,30) }
  else return
  
  %y = $calc(($2 -1) * $_h +60)
  
  drawtext -nr %win %cl %f -10 %x %y %t
  drawrot -nbc %win $1 %rot %x $calc(%y +3) %w %h
}

alias z.infosq.le.drawinfo {
  var %f tahoma,%s -7,%win @z.infosquare,%wh $window(%win).dh,%ww $window(%win).dw,%x,%y,%cl $rgb(255,255,255),%ipl,%iplw,%zu,%zcl
  
  ; name & zionuser
  %x = 8
  %y = $calc(($2 -1) * $_h +56)
  if ($hget(zion.le3.gamenicks,$2)) drawtext -nr %win %cl %f %s %x %y Name: $ifmatch
  
  %x = 155
  if ($hget(zion.le3.zionusers,$2)) {
    %zu = $ifmatch
    if (%zu = 9) { %ipl = Zion Admin | %zcl = $rgb(230,30,30) }
    elseif (%zu = 5) { %ipl = Zion VIP | %zcl = $rgb(30,30,230) }
    else { %ipl = Zion $z.lang(infosq,user) | %zcl = $rgb(255,170,20) }
    %iplw = $width(%ipl,%f,%s)
    drawtext -nr %win %zcl %f %s $calc(%ww -9 - %iplw) %y %ipl
  }
  
  %x = 8
  %y = $calc(($2 -1) * $_h +67)
  drawtext -nr %win %cl %f %s %x %y IRC: $iif($hget(zion.le3.ircnicks,$2),$ifmatch,?)
; drawtext -nr %win %cl %f %s %x %y Forum: $iif($hget(zion.infosq.forumid,$2),$ifmatch,?) $iif($hget(zion.le3.ircnicks,$2),(irc: $ifmatch $+ ))
  
  if ($hget(zion.le3.ips,$2)) {
    %ipl = $ifmatch
    %iplw = $width(%ipl,%f,%s)
    drawtext -nr %win %cl %f %s $calc(%ww -9 - %iplw) %y %ipl
  }
  
  %x = 8
  %y = $calc(($2 -1) * $_h +78)
  
  drawtext -nr %win %cl %f %s %x %y $z.lang(infosq,forum) $iif($hget(zion.infosq.forumid,$2),$ifmatch,?)
  
  if ($hget(zion.le3.locations,$2)) {
    %ipl = $ifmatch
    %iplw = $width(%ipl,%f,%s)
    drawtext -nr %win %cl %f %s $calc(%ww -9 - %iplw) %y %ipl
  }
  
  %x = 8
  %y = $calc(($2 -1) * $_h +89)
  
; try not to use zion.le3.blabla
  
  %zcl = $rgb(180,180,180)
  %ipl = $iif($hget(zion.infosq.pops,$2) != $null,$ifmatch,?)
  drawtext -nr %win $iif(%ipl = ?,%zcl,$z.user.popcol(%ipl)) %f %s %x %y $z.lang(infosq,pop) %ipl
  
  %zu = $iif($hget(zion.infosq.zacs,$2),$ifmatch,-)
  if (%zu = D) { %ipl = $z.lang(infosq,dirty) | %zcl = $rgb(230,30,30) }
  elseif (%zu = C) { %ipl = $z.lang(infosq,clean) | %zcl = $rgb(30,230,30) }
  elseif (%zu = O) { %ipl = $z.lang(infosq,off) }
;  elseif (%zu = V) { %ipl = Vista }
  else { %ipl = $z.lang(infosq,unknown) }
  
  %ipl = $z.lang(infosq,zac) %ipl
  %iplw = $width(%ipl,%f,%s)
  drawtext -nr %win %zcl %f %s $calc(%ww -9 - %iplw) %y %ipl
  
  
}


alias z.infosq.displaylemem {
  if (!$z3.findtog($id,size)) return
  if (-*d* iswm $1) z.infosq.le.cls
  var %players $hget(zion.le3.gamenicks,players), %playersn = $numtok(%players,44),%c 1,%boxbg,%c2
  
  var %w @z.infosquare,%wh $window(%w).dh,%ww $window(%w).dw
  var %f tahoma,%s -7
  
  while (%c <= %playersn) {
    %c2 = $gettok(%players,%c,44)
    %boxbg = $z.infosq.le.drawbox($1,%c2,$gettok(%players,-1,44))
    ;z.infosq.le.drawstatus %boxbg %c2
    z.infosq.le.drawinfo %boxbg %c2
    inc %c
  }
  
  if (-*d* iswm $1) drawdot %w
}
alias z.infosq.drawbig {
  if (!$1) return
  var %w @z.infosquare,%wh $window(%w).dh,%ww $window(%w).dw
  z.infosq.cls
  
  drawrect -nfr %w $rgb(0,255,0) 1 0 0 200 25
  drawrect -nfr %w $rgb(255,255,0) 1 0 25 200 25
  
  
  
  if ($1 = -r) {
    drawfill -nr %w $2 $rgb(255,255,0) 5 15
    tokenize 32 $3-
  }
  else drawfill -nr %w $rgb(0,255,0) $rgb(255,255,0) 5 15
  
  var %f tahoma,%s -14,%s2 -9,%h = $height($1,%f,%s),%y = $width($1,%f,%s),%h2 = $height($2,%f,%s),%y2 = $width($2,%f,%s)
  
  drawtext -nr %w 0 %f %s $calc(175 - (%y /2)) 0 $1
  drawtext -nr %w 0 %f %s $calc(175 - (%y2 /2)) 25 $2
  
  if ($4) drawtext -nr %w 0 %f %s2 15 5 Host: $4-
  ;  drawline -nr %w $rgb(255,255,255) 1 0 %wh %ww 0
  
  /*

  else drawfill -nr %w $rgb(0,255,0) $rgb(255,255,255) 5 5
  var %f tahoma,%s -14,%h = $height($1,%f,%s),%y = $width($1,%f,%s),%h2 = $height($2,%f,%s),%y2 = $width($2,%f,%s)
  drawtext -nr %w 0 %f %s $calc((%ww /4)-(%y /2)) $calc((%wh /4)-(%h /2)) $1
  drawtext -nr %w $rgb(255,255,255) %f %s $calc((%ww /4)*3-(%y2 /2)) $calc((%wh /4)*3-(%h2 /2)) $2

  ;l180 1
  ;191 12

  */
  drawrect -nfr %w 0 1 0 0 10 10
  ; draw the triangle
  ;  drawline -nr %w $rgb(255,255,255) 1 1 7 7 7 4 2 1 7
  drawline -nr %w $rgb(255,255,255) 1 7 6 7 2 1 4 7 7
  drawfill -nr %w $rgb(255,255,255) $rgb(255,255,255) 6 5
  
  if ($zion.le3.hasmem) z.infosq.displaylemem
  
  drawdot %w
}
alias z.infosq.drawsmall {
  var %w @z.infosquare,%wh $window(%w).dh,%ww $window(%w).dw
  z.infosq.cls
  
  drawline -nr %w $rgb(255,255,255) 2 0 %wh %ww 0
  
  if ($1 = -r) {
    drawfill -nr %w $2 $rgb(255,255,255) 5 5
    tokenize 32 $3-
  }
  else drawfill -nr %w $rgb(0,255,0) $rgb(255,255,255) 5 5
  
  var %f tahoma,%s -14,%h = $height($1,%f,%s),%y = $width($1,%f,%s),%h2 = $height($2,%f,%s),%y2 = $width($2,%f,%s)
  drawtext -nr %w 0 %f %s $calc((%ww /4)-(%y /2)) $calc((%wh /4)-(%h /2)) $1
  drawtext -nr %w $rgb(255,255,255) %f %s $calc((%ww /4)*3-(%y2 /2)) $calc((%wh /4)*3-(%h2 /2)) $2
  
  drawrect -nfr %w 0 1 0 35 9 7
  ; draw the triangle
  drawline -nr %w $rgb(255,255,255) 1 1 37 7 37 4 40 1 37
  drawfill -nr %w $rgb(255,255,255) $rgb(255,255,255) 4 39
  
  drawdot %w
}

alias z.infosq.enlarge {
  z3.addtog $id size 1
  ;  var %w @z.infosquare,%crd $z3.findtog($id,spamwincoords),%x $iif(%crd,$gettok(%crd,1,32),$calc($window(-1).w - 150)),%y $iif(%crd,$gettok(%crd,2,32),50)
  var %w @z.infosquare,%x $window(%w).x,%y $window(%w).y
  window -b %w %x %y 200 58
  z.infosq.cls
  z.infosq.z
  drawline -nr %w $rgb(255,255,255) 1 7 6 7 2 1 4 7 7
  drawfill -r %w $rgb(255,255,255) $rgb(255,255,255) 6 5
  z.infosq.displaylemem
}
alias z.infosq.compact {
  z3.deltog $id size
  ;  var %w @z.infosquare,%crd $z3.findtog($id,spamwincoords),%x $iif(%crd,$gettok(%crd,1,32),$calc($window(-1).w - 150)),%y $iif(%crd,$gettok(%crd,2,32),50)
  var %w @z.infosquare,%x $window(%w).x,%y $window(%w).y
  window -b %w %x %y 50 50
  z.infosq.cls
  z.infosq.z
  ; draw the triangle
  drawline -nr %w $rgb(255,255,255) 1 1 37 7 37 4 40 1 37
  drawfill -r %w $rgb(255,255,255) $rgb(255,255,255) 4 39
  
}

alias z.infosq.clearmems {
  hfree -w zion.infosq.*
}
alias z.infosq.drawbig {
}

on *:signal:zion_trace:{
  ;$1ip $2nick $3add $4forum [$5pop]
  _processforumid $1 $2 $4 $5
}
alias _processforumid {
  if ($zion.le3.mem.findbyircnick($2,0)) {
    var %m $ifmatch,%v
    while (%m > 0) {
      %v = $zion.le3.mem.findbyircnick($2,%m)
      hadd -m zion.infosq.forumid %v $3
      if ($4 != $null) hadd -m zion.infosq.pops %v $4
      dec %m
    }
  }
  else {
    var %m $zion.le3.mem.findbyip($1,0),%v
    while (%m > 0) {
      %v = $zion.le3.mem.findbyip($1,%m)
      hadd -m zion.infosq.forumid %v $3
      if ($4 != $null) hadd -m zion.infosq.pops %v $4
      dec %m
    }
  }
}

on *:signal:warcraft3_tft.zgs:{
  if ($1 = spamdetails) { if ($window(@z.infosquare)) z.infosq.udcount $2 $3 }
  elseif ($1 = spamstart) { z.infosq.clearmems | if (!$window(@z.infosquare)) z.infosq.open }
  elseif ($1 = screendetails) {
;    echo -s received screendetails $1-
    ;.signal $id $1screendetails $2nick $3ip $4status
    if ($zion.le3.mem.findbyircnick($2,0)) {
      var %m $ifmatch
      while (%m > 0) {
        hadd -m zion.infosq.zacs $zion.le3.mem.findbyircnick($2,%m) $4
        dec %m
      }
    }
    else {
      var %m $zion.le3.mem.findbyip($3,0)
      while (%m > 0) {
        hadd -m zion.infosq.zacs $zion.le3.mem.findbyip($3,%m) $4
        dec %m
      }
    }
  }
}
/*
on *:signal:zion_le.mrc:{
  if ($1 = details) { if ($window(@z.infosquare)) z.infosq.udcount $2- }
  elseif ($1 = connected) { z.infosq.clearmems | if (!$window(@z.infosquare)) z.infosq.open }
}
*/
on *:signal:zion_le3.mrc:{
  if ($1 = details) {
    if ($window(@z.infosquare)) z.infosq.udcount $2-
  }
  elseif ($1 = connected) { z.infosq.clearmems | var %w @z.infosquare | if (!$window(%w)) z.infosq.open | elseif ($appactive) window -a %w }
  elseif ($1 = memoryupdate) {
    if ($window(@z.infosquare)) z.infosq.displaylemem -d
  }
  ; for zacs info
  elseif ($1 = join) {
    ;$2ip $3num $4nick
    if ($hget(zion.infosq.zacs,$3)) hdel zion.infosq.zacs $3
    if ($hget(zion.infosq.forumid,$3)) hdel zion.infosq.forumid $3
    if ($hget(zion.infosq.pops,$3)) hdel zion.infosq.pops $3
    if ($gettok($hget(zion_users,$2),2,32)) _processforumid $2 $4 $ifmatch $gettok($hget(zion_users,$2),3,32)
    z.infosq.udcount $numtok($hget(zion.le3.gamenicks,players),44)
  }
  
}
ON *:SIGNAL:zion_gameinfo:{
  if ($2 = -s) {
    if ((%zion.le.connectedIP) && ($z.gl.getIP($1) = %zion.le.connectedIP)) {
    var %3 $strip($3),%4 $strip($4)
      if ((%3 isnum) && (%4 isnum)) z.infosq.udcount %3 %4
    }
  }
}
menu @z.infosquare {
  dclick {
    showmirc -o
    showmirc -p
    window -a %zion.s.chat
  }
  leave {
    setlayer $calc(30 *2.55) @z.infosquare
    if (r isin $z.dock(@z.infosquare)) window @z.infosquare $calc($window(-1).w -20) -1
    elseif (l isin $z.dock(@z.infosquare)) window @z.infosquare $calc(-$window(@z.infosquare).w +20) -1
;    echo -s ready to fade out and hide
  }
  mouse {
    setlayer 255 @z.infosquare
    if (r isin $z.dock(@z.infosquare)) window @z.infosquare $calc($window(-1).w - $window(@z.infosquare).w) -1
    elseif (l isin $z.dock(@z.infosquare)) window @z.infosquare 0 -1
;    echo -s ready to fade in and appear
    if (($z3.findtog($id,size)) && ($inrect($mouse.x,$mouse.y,2,51,190,$window(@z.infosquare).dh))) { .timerzion.infosquare.le.repeat -o 1 1 z.infosq.displaylemem -md | z.infosq.displaylemem -md }
  }
  sclick {
    setlayer 255 @z.infosquare
    if (r isin $z.dock(@z.infosquare)) window @z.infosquare $calc($window(-1).w - $window(@z.infosquare).w) -1
    elseif (l isin $z.dock(@z.infosquare)) window @z.infosquare 0 -1
    
    if ($inrect($mouse.x,$mouse.y,1,1,200,58)) z.drag $calc($mouse.dx -$window(@z.infosquare).x) $calc($mouse.dy -$window(@z.infosquare).y) @z.infosquare
;        echo -s $mouse.x $mouse.y
    if (!$z3.findtog($id,size)) {
      if ($inrect($mouse.x,$mouse.y,1,37,5,5)) z.infosq.enlarge
    }
    else {
      if ($inrect($mouse.x,$mouse.y,1,1,10,10)) z.infosq.compact
      if ($inrect($mouse.x,$mouse.y,2,51,190,$window(@z.infosquare).dh)) z.infosq.displaylemem -ld
    }
  }
  $style(2) InfoSquare v0.1:return
  -
  $iif(%zion.s.pauselist,$z.lang(infosq,startlist),$z.lang(infosq,pauselist)) $z.lang(infosq,gamelist):z.pause
  -
  $z.lang(infosq,close):z3.addtog $id spamwincoords $window(@z.infosquare).x $window(@z.infosquare).y | _cleanup
}