Zion Sphinx — File Browser

ZionSphinxv3.0 / ZionSphinxv3.0 / zion_gamelist.mrc

zion_gamelist.mrc — 22.01 KB — Download this file

; --------< Zion >----------------------------------------------------
; Name....: Zion Gamelist
; File....: zion_gamelist.mrc
; Ver.....: 3.0b290807
; Author..: sprion
; Email...: sprion@lyniq.com
; Date....: 29 Aug 07
; URL.....: http://zincplay.com
; Info....: Gamelist
; Changes.: Now shows the channel where the spam is from.
;---------------------------------------------------------------------
;translatable
/*
Usables
-------
Identifiers:
returns $null if data is '-' or $null
GameID - Game's name in Zion
GameNO - Game's line number on Gamelist (starts on 3)
$z.gl.getName(<GameID>|<GameNO>) - returns GameID
$z.gl.getLine(<GameID>) - returns GameNO
$z.gl.getDesc(<GameID>|<GameNO>) - returns Description
$z.gl.getHost(<GameID>|<GameNO>) - returns Host
$z.gl.getStatus(<GameID>|<GameNO>) - returns Status
$z.gl.getDetail(<GameID>|<GameNO>) - returns Details (Location column)
$z.gl.getPing(<GameID>|<GameNO>) - returns Ping
$z.gl.getIP(<GameID>|<GameNO>) - IP of game
$z.gl.getCode(<GameID>|<GameNO>) - connectable code (used for faster connecting)
$z.gl.getCtime(<GameID>|<GameNO>) - last $ctime of spam received
$z.gl.getCache(<GameID>|<GameNO>) - grabs text from cache

Aliases:
z.gl.clear - Clears the Gamelist.

Avail-usables - methods/aliases used in this script ONLY when available
--------------
$z.modDetail(<GameID|GameNo>,<Detail>)
- Used to filter details/location before showing on Gamelist
*Note: Find 'z.modDetail' in this file to learn how it's used.

ZION Gamelist Rewrite
this is a must have for zion main
also when changing nick .. it becomes a new game when spamming own game

*/

on *:signal:zion_cmdlistopen:{
  zion.listcmd z.pause ; Pauses/Unpauses the Gamelist. Pausing the Gamelist saves resources.
}

alias zion.gamelist.id return ZIONGL.3b290807

alias z.gl.getTotal return $calc($line($z.win,0) - $z.gl.offset)

alias z.gl.create {
  var %w $z.win
  if ($window(%w)) return
  ;  if ($window(%w)) { window -c %w }
  if ($1 = /c) return
  if ($version = 6.17) window -Bhl -t30,45,52,61,900,1000 %w 0 0 $2 $1
  elseif ($version >= 6.20) window -Bhl -t15,23,27,31,900,1000 %w 0 0 $2 $1
  else window -Bhl -t15,25,30,37,900,1000 %w 0 0 $2 $1
  ; 1:n 2:1? 3:2? 5:ip 9:cod into the PING field .. so $2- is codes data
  
  z.gl.font
  if (($z.h.getvar(start_signaled)) && ($z.started)) z.gl.clear
  
}
alias z.gl.clear z.gl.addlines $+($z.lang(gamelist,desc),$chr(9),$z.lang(gamelist,host),$chr(9),$z.lang(gamelist,status),$chr(9),$z.lang(gamelist,loc),$chr(9),$z.lang(gamelist,ping) (ms),$chr(9),,$colour(list),-)
alias z.gl.addlines {
  var %w $z.win
  if (!$window(%w)) return
  clear %w
  if ($z.started) aline %w $1-
  else aline %w $z.lang(gamelist,disconnected)
  aline %w $str($chr(175),200)
}
alias z.gl.rline {
  var %w $z.win
  if (!$window(%w)) return
  rline %w 1 $1-
}

alias z.gl.questionmark {
  if (%zion.le.gamestart) return
  var %t $z.gl.getTotal
  while (%t > 0) {
    var %n $z.h.getGameName(%t)
    z.gl.udcount %n $+(,$z.getcol(3),?)
    dec %t
  }
}

; provide gamelist line
alias z.gl.getLine {
  var %w $z.win,%i = 0
  if ($window(%w)) %i = $fline(%w,$+(*,$1,*),1)
  return %i
}
alias z.gl.getPing return $gl.g($1,5)
alias z.gl.getHost return $gl.g($1,2)
alias z.gl.getDesc return $gl.g($1,1)
alias z.gl.getStatus return $gl.g($1,3)
alias z.gl.getDetail {
  var %x = $gl.g($1,4),%z
  if ($isalias(z.modDetail)) { %z = $z.gl.getCache($1) | if (%z) %x = $replace(%z,_,$chr(32)) }
  ;  echo -s before x: %x
  ; temp patch, color check
  if (($strip(%x) = -) || ( isin %x)) %x = $null
  ;  if ( isin %x) %x = $null
  ;  echo -s using x: $1- %x
  return %x
  ;  return $iif($isalias(z.modDetail),$iif($z.modDetail($1,%x),$ifmatch,%x),%x)
}
alias -l gl.g {
  var %w $z.win,%i2,%d
  if ($1 isnum) %i2 = $1
  else %i2 = $fline(%w,$+(*,$1,*),1)
  if (%i2) {
    %d = $gettok($line(%w,%i2),$2,9)
    if ($strip(%d) = -) %d = $null
  }
  ; remove  if it's at the end, due to ending of color codes in z.gl.additem
  if ($right(%d,1) = ) %d = $left(%d,-1)
  return %d
}
alias z.gl.getName return $zg($1,1)
alias z.gl.getIP return $zg($1,2)
alias z.gl.getCode return $zg($1,3)
alias z.gl.getCtime return $zg($1,4)
alias z.gl.getCache return $zg($1,5)
alias -l zg {
  var %n $1,%d
  if ($1 !isnum) %n = $fline($z.win,$+(*,$1,*),1)
  if (%n) {
    %d = $gettok($za(%n),$2,32)
    if ($strip(%d) = -) %d = $null
  }
  return %d
}
alias -l za return $strip($gettok($line($z.win,$1),6,9))
alias z.gl.snptimeout %zion.s.snptimeout = $1


; super laggy routine!!!
alias z.gl.refresh {
  if (%zion.le.gamestart) {
    ;    if ($line($z.win,0) > 2) {
    if ($z.gl.getTotal > 0) {
      ;    if (!%zion.s.pauselist) {
      z.gl.addlines $z.lang(gamelist,listpause)
      zion.gl.pauselist -pause
    }
    return
  }
  elseif (%zion.s.pauselist) zion.gl.pauselist -end
  var %w $z.win,%t $z.gl.getTotal
  ;  %zion.s.ref = $iif(%zion.s.ref,0,1)
  while (%t > 0) {
    dll_wfix WhileFix
    var %tp $za($calc(%t + $z.gl.offset)),%n $gettok(%tp,1,32),%ip $gettok(%tp,2,32),%no $gettok(%tp,3,32),%time $gettok(%tp,4,32),%l $calc(%zion.s.snptimeout - $z.gl.getTotal)
    
    ; testing resources with this check
    
    if ($z.comms.top($me,25)) {
      ; this setting of %zion.s.ref allows for 1 time skipping of main refreshing codes
      if (%no !isnum) {
        ; MAIN REFRESH
        .timerzion.s.fo $+ %n -m 1 $r(222,6666) .signal -n zion_getgameinfo %n %ip
      }
      ; MINI REFRESH
      else { .timerzion.s.fo $+ %n -m 1 $r(222,6666) .signal -n zion_getgameinfo %n %ip %no }
    }
    
    ; expire, new expire method involves considering amount of games on the list
    ;if ($calc($ctime - %time) >= %zion.s.snptimeout) { echo -s gl.refresh | .signal zion_gameexpired %n }
    if ((!$timer(zion.s.grace)) && (%l < 10)) {
      .timerzion.s.grace -o 1 30 z.gl.snptimeout %zion.s.snptimeout
      inc %zion.s.snptimeout 15
      inc %l 15
    }
    if ($calc($ctime - %time) >= %l) .signal zion_gameexpired %n
    
    
    ; if ip is what you are on, hilight it.. %t + 2 gives list number
    if (%ip = %zion.le.connectedIP) z.gl.hilite $calc(%t + $z.gl.offset)
    elseif ($istok($z.h.getvar(friends_gameips),%ip,36)) z.gl.hilite $calc(%t + $z.gl.offset) -friend
    dec %t
  }
  .timerzion.s.refreshlist 1 6 z.gl.refresh
}


alias z.gl.test {
  var %w $z.win,%t $z.gl.getTotal
  %zion.s.ref = $iif(%zion.s.ref,0,1)
  while (%t > 0) {
    var %tp $za($calc(%t + $z.gl.offset)),%n $gettok(%tp,1,32),%ip $gettok(%tp,2,32),%no $gettok(%tp,3,32)
    echo -s game %t - n %n - ip %ip - c %no
    dec %t
  }
}


alias z.gl.hilite {
  var %w = $z.win,%b = 01,15,%d = $line(%w,$1),%z,%r = $sline(%w,1).ln
  if ($2 = -friend) %z = $+(08,$chr(44),01,+,)
  else %z = $+(04,$chr(149),)
  rline %w $1 %z $remove(%d,%z) %z
  if (%r > 2) sline %w %r
}

alias z.gl.udcount {
  var %w $z.win,%r2 $sline(%w,1).ln,%i2
  if ($1 isnum) { %i2 = $1 | tokenize 32 $2- }
  else %i2 = $fline(%w,$+(*,$1,*),1)
  if (%i2) {
    var %d = $line(%w,%i2),%e = $puttok(%d,$+($iif(!$3,$2,$2 of $3),),3,9)
    rline %w %i2 %e
  }
  if (%r2 > 2) sline %w %r2
}

alias z.gl.uddetail {
  var %w $z.win,%r2 $sline(%w,1).ln,%i2
  if ($1 isnum) { %i2 = $1 | tokenize 32 $2- }
  else %i2 = $fline(%w,$+(*,$1,*),1)
  if (%i2) {
    var %d = $line(%w,%i2),%e = $puttok(%d,$+($2-,),4,9)
    rline %w %i2 %e
  }
  if (%r2 > 2) sline %w %r2
}

alias z.gl.udping {
  var %w $z.win,%r2 $sline(%w,1).ln,%i2,%c,%n
  if ($1 isnum) { %i2 = $1 | tokenize 32 $2- }
  else %i2 = $fline(%w,$+(*,$1,*),1)
  if (%i2) {
    %n = $gettok($2-,1,32)
    if (%n < 200) %c = $+(,$z.getcol(3),%n,)
    elseif (%n >= 200) %c = $+(,$z.getcol(5),%n,)
    ;    if (%c <= 100) %c = 3
    ;    elseif (%c >= 300) %c = 5
    ;    var %d = $line(%w,%i2),%e = $puttok(%d,$+(,$iif($z.getcol(%c),$ifmatch,01),$2-,ms,),5,9)
    ;    var %d = $line(%w,%i2),%e = $puttok(%d,$+($replace($2-,%n,%c),ms),5,9)
    var %d = $line(%w,%i2),%e = $puttok(%d,$+($replace($2-,%n,%c),),5,9)
    rline %w %i2 %e
  }
  if (%r2 > 2) sline %w %r2
}

alias z.gl.destroy {
  z.h.unsetvar gamelist_resize
  if ($window(%zion.s.chat)) dll_wfx SetPadding %zion.s.chat > 0 text
  var %w $z.win
  if (!$window(%w)) return
  if ($1 = -i) window -c %w
  var %change $int($calc($window(%w).h / 10)),%count 0, %currentht $window(%w).h
  while (%count < 10) {
    .timer -om 1 $calc(%count * 20) window %w 0 0 $calc($window(%zion.s.chat).dw + 19) $calc(%currentht - $calc($calc(%count + 1) * %change))
    inc %count
    if (%count >= 10) .timer -om 2 $calc(%count * 40) window -c %w
  }
}

alias z.gl.font {
  tokenize 32 %zion.s.color
  ;  color list $iif($1 >= 0,$1,0) | color listbox text $iif($2 >= 0,$2,1)
  if (!%zion.s.listsize) {
    var %f $z3.findtog(list,newfont,Tahoma|12|bold)
    %zion.s.listsize = $gettok(%f,2,124)
    %zion.s.listfont = $gettok(%f,1,124)
    %zion.s.listbold = $gettok(%f,3,124)
  }
  ;  font $iif(%zion.s.listbold = bold,-b) $z.win $+(-,%zion.s.listsize) %zion.s.listfont
  font $iif(%zion.s.listbold = bold,-b) $z.win %zion.s.listsize %zion.s.listfont
}

alias z.gl.notify {
  if ($z.gl.empty) {
    if ($calc($ctime - %zion.s.lastlist) > $1) { if (!%zion.le.gamestart) z.splay snd_firstgame }
    if ($zion.s.chat = %zion.s.chat) .timerzion.s.refreshlist 1 5 z.gl.refresh
  }
}
alias z.gl.offset return 2

alias z.gl.join {
  var %i 0,%w $z.win,%s $sline(%w,1).ln,%nick = $gettok($gettok($line($z.win,%s),2,9),1,32)
  if ($window(%w)) {
    if (!%s) || (%s < 3) return
    %i = $z.gl.getName(%s)
  }
  if (!$z.gamesettingsok) { %zion.s.process = 87 | zion.gamenotok | return }
  if (_pub isin %i) {
    var %t $z.gl.getIP(%s)
    if ($1 = lancraft) z.lancraft %t
    else z.con %t %nick
    var %z = $line($z.win,%s)
    %zion.le.connectedGame = $+(,%t,) by $gettok($gettok(%z,2,9),1,32) - $remove($gettok(%z,1,9),$chr(149))
    return
  }
  if ((_pubme isin %i)) {
    var %t $z.gl.getIP(%s)
    if (%t = $z.ip) { z.note Error: $ Cannot join your own game. | return }
    else z.con %t %nick
  }
}

ON *:SIGNAL:WFx_Size:{
  if (!$z3.findtog(list,contained)) {
    if (($1 = %zion.s.chat) && ($cid = %zion.s.cid) && ($z.h.getvar(gamelist_resize)) && ($2 = $z.win)) {
      var %x $int($calc($window(%zion.s.chat).h / 100 * 40)),%g $calc($window(%zion.s.chat).dw + 19)
      window $z.win 0 0 %g %x
      .timerzion.g.refreshz -m 1 50 z.gl.udscreen
    }
  }
}
alias z.gl.udscreen {
  if (!$z3.findtog(list,contained)) {
    var %w $z.win
    if (($active != %w) && ($active != %zion.s.chat)) return
    z.h.unsetvar gamelist_resize
    var %x $int($calc($window(%zion.s.chat).h / 100 * 40)), %g $calc($window(%zion.s.chat).dw + 19)
    window -Bl -t25,25,30,35 +d %w 0 0 %g %x $1-
    dll_wfx SetPadding %zion.s.chat > %x text
    .timer -m 1 200 z.h.setvar gamelist_resize 1
  }
}


ON *:SIGNAL:zion_cmd:{
  if ($window($z.win)) {
    if ($z.started) { window -a %zion.s.chat }
    else { z.gl.rline $z.lang(gamelist,connecting) }
    if (!$z.h.getvar(gamelist_resize)) z.gl.udscreen
  }
  elseif (%zion.s.chat ischan) { z.gl.init | z.gl.rline $z.lang(gamelist,connecting) }
}
ON *:SIGNAL:zion_start:{
  if (%zion.le.gamestart) z.gl.addlines $z.lang(gamelist,listpause)
  else z.gl.clear
}
;ON *:SIGNAL:zion_connected:z.gl.addlines $+(Description,$chr(9),Host,$chr(9),Status,$chr(9),Location,$chr(9),Ping,$chr(9),,$colour(list),-)
ON *:SIGNAL:zion_winclose:z.gl.destroy
on *:signal:zion_chanclose:z.gl.destroy -i
ON *:SIGNAL:zion_unload:{
  if ($window($z.win)) z.gl.destroy -i
  .unload -rs $+(",$script,")
}
ON *:SIGNAL:zion_end:z.gl.rline $z.lang(gamelist,disconnected)
ON *:SIGNAL:zion_deauth:z.gl.rline $z.lang(gamelist,disconnected)
alias z.gl.hashmake {
  z.h.unsetvar gamelist_resize
}
alias zion.s.chat {
  if (%zion.s.zchat) return $ifmatch
  else return %zion.s.chat
}
alias z.gl.init {
  ; creating hashlist
  z.gl.hashmake
  
  ; creating gl
  var %w $z.win,%a = $iif($1,$1,%zion.s.chat),%x $int($calc($window(%a).h / 100 * 40)),%g $calc($window(%a).dw + 19)
  %zion.s.zchat = %a
;  z.gl.create $1 %x %g
  z.gl.create %x %g
  
  ; this is needed with no reason - without this line, fast connect box screws up
  ;  zion.gui.kill
  
  if (!$z3.findtog(list,contained)) {
    ; padding into chat window
    dll_wfx SetPadding %a > %x text
    dll_wfx SetChild %a > %w
  }
  ; call alternate gamelist
  else z.agl
  
  .timer -m 1 200 z.h.setvar gamelist_resize 1
  
  /*
  ; nicklusting
  dll_nl3 Mark $window(%zion.s.chat).hwnd zcallback tooltips hottrack rowselect hideempty
  dll_nl3 AddGroup %zion.s.chat 2 @ 0 > Admins
  dll_nl3 AddGroup %zion.s.chat 3 + 0 > Helpers
  dll_nl3 SetGroupText %zion.s.chat 1 > Zioners

  dll_nl3 SetGroupPos %zion.s.chat 1 3

  dll_nl3 CollapseGroup %zion.s.chat 3 $true
  dll_nl3 CollapseGroup %zion.s.chat 1 $true
  */
  
  z.gl.clear
  ; let the other files know window is made
  .signal -n zion_winmade
  if (%zion.le.gamestart) zion.gl.pauselist -pause
}
alias z.pause zion.gl.pauselist $iif(%zion.s.pauselist,-end,-pause)
alias zion.gl.pauselist {
  var %c $z.lang(gamelist,pausing),%d $z.lang(gamelist,paused)
  if ($1 isnum) {
    zion.gui.addbutton %c $ zion.gl.pauselist -abort $ abort
    z.echo $z.head(notice) $z.lang(gamelist,pausingin) $1 s..
    .timerzion.s.pauselist 1 $1 zion.gl.pauselist -pause
  }
  elseif ($1 = -pause) {
    zion.gui.rembutton %c
    %zion.le.gamestart = $ctime
    %zion.s.pauselist = 1
    unset %zion.s.lastlist
    zion.gui.addbutton %d $ zion.gl.pauselist -end $ resume
    zion.girl $z.lang(girl,gamelistpaused)
  }
  elseif ($1 = -end) {
    z.gl.rline $+($z.lang(gamelist,desc),$chr(9),$z.lang(gamelist,host),$chr(9),$z.lang(gamelist,status),$chr(9),$z.lang(gamelist,loc),$chr(9),$z.lang(gamelist,ping) (ms),$chr(9),,$colour(list),-)
    zion.gui.rembutton %d
    unset %zion.le.gamestart %zion.s.pauselist
  }
  elseif ($1 = -abort) {
    zion.gui.rembutton %c
    .timerzion.s.pauselist off
  }
}
alias z.gl.processhost {
  var %v $2
  if ($1 isop %zion.s.chat) %v = 4ADMIN
  elseif ($1 isvoice %zion.s.chat) {
    if (($left($1,1) = [) && ($right($1,1) = ])) %v = 12HELPR
    else %v = 12VIP
  }
  return $1 $iif(%v,$+($chr(40),%v,$chr(41)))
}

alias z.gl.processhost2 {
  var %v
  if ($1 isop %zion.s.chat) %v = 4ADMIN
  elseif ($1 isvoice %zion.s.chat) %v = 12VIP
  return $iif(%v,$+($chr(40),%v,$chr(41)))
}
alias z.win return @z.gl
ON *:SIGNAL:zion_chanopen:z.gl.init
ON *:SIGNAL:zion_gamespam:if (%zion.le.gamestart) return | z.gl.additem $1 $2 $3 $4 $5- | if ($z.ip = $2) zion_markme -of
ON *:SIGNAL:zion_gameexpired:z.gl.remitem $1
ON *:SIGNAL:zion_gameinfo:{
  ;-p = ping, -s = status, -c = con code, -d = details
  if ($2 = 0) z.gl.udcount $1 $+(,$z.getcol(3),?)
  elseif ($2 = 1) z.gl.udcount $1 $+(,$z.getcol(3),Trying..)
  elseif ($2 = -p) {
    z.gl.udping $1 $3-
  }
  elseif ($2 = -d) {
    ; to remove in stable version, developers ignore this clause
    if ($numtok($3-,20) >= 2) {
      var %x = $gettok($3-,2-,20),%z
      if ($isalias(z.modDetail)) {
        ; temp fix
        if ( isin %x) return
        %z = $z.modDetail($1,%x)
        if (%z) { z.gl.uddetail $1 %z | z.gl.udcache $1 $z.b64(%x) }
        else z.gl.uddetail $1 %x
      }
      else z.gl.uddetail $1 %x
      ;      z.gl.uddetail $1 $iif($isalias(z.modDetail),$iif($z.modDetail($1,),$ifmatch,$gettok($3-,2-,20)),$gettok($3-,2-,20))
    }
    ; this will stay forever, developers LOOK HERE only
    ;    else z.gl.uddetail $1 $iif($isalias(z.modDetail),$iif($z.modDetail($1,$3-),$ifmatch,$3-),$3-)
    else {
      if ($isalias(z.modDetail)) {
        if ( isin $3-) return
        var %z = $z.modDetail($1,$3-)
        if (%z) { z.gl.uddetail $1 %z | z.gl.udcache $1 $replace($3-,$chr(32),_) }
        else z.gl.uddetail $1 $3-
      }
      else z.gl.uddetail $1 $3-
    }
  }
  elseif ($2 = -s) {
    if ($timer(zion.s.fo $+ $1)) .timerzion.s.fo $+ $1 off
    z.gl.udcount $1 $3-
  }
  elseif ($2 = -c) {
    z.gl.udcode $1 $3
  }
}
ON *:SIGNAL:zion_gameinfofail:z.gl.udcount $1 $+(,$z.getcol(5),BAD)
on *:signal:zion_joinselected:z.gl.join
on *:signal:zion_updateselected:z.gl.update

alias z.gl.update {
  var %tp $za($sline($z.win,1).ln),%n $gettok(%tp,1,32),%ip $gettok(%tp,2,32)
  z.h.setvar refreshgame %n
  .timerzion.s.update.unset 1 4 z.h.unsetvar refreshgame
  .signal -n zion_getgameinfo %n %ip
}
alias -l hostprocess {
  tokenize 32 $1
  if ($0 = 1) return $1
  var %3 $3
  if (%3 != $null) {
    if (%3 < 1) %3 = $+(,$z.getcol(5),$3)
    else %3 = $+(,$z.getcol(3),$3)
    %3 = $+($chr(40),%3,,$chr(41))
  }
  return $+(,$iif($len($2) > 16,$+($left($2,17),..),$2),) %3
}
alias z.gl.additem {
  var %n $replace($1,$chr(124),_124_),%w $z.win
  if ($window(%w)) {
    ; first game on the list! after 30 secs..
    z.gl.notify 30
    
    ; lookin for duplicate
    var %r2 $sline(%w,1).ln,%i2 = $fline(%w,$+(*,%n,*),1),%5 $5-,%3
    
    ; if we can find info about the IP
    if ($z.trace($2,-r)) {
      %3 = $ifmatch
      %3 = $hostprocess(%3) $z.gl.processhost2($gettok(%3,1,32))
    }
    else %3 = $+(,$3,)
    if ($4) %3 = %3 ( $+ $4 $+ )
    if (%i2) {
      if (!%zion.le.gamestart) {
        var %d = $line(%w,%i2),%ip = $2
        %d = $puttok(%d,$+($left(%5,80),),1,9)
;        %d = $puttok(%d,$+(%3 $iif($4,$4),),2,9)
        %d = $puttok(%d,$+(%3,),2,9)
        
        ;      if ($2 isnum) %d = $puttok(%d,$2 of $3,3,9)
        rline %w %i2 %d
        if (%ip = %zion.le.connectedIP) z.gl.hilite %i2
        elseif ($istok($z.h.getvar(friends_gameips),%ip,36)) z.gl.hilite %i2 -friend
      }
      z.gl.udctime %i2 %n $ctime
      
    }
    else {
      if ($floodchk(z.gl.additem, 5, $cid) > 14) return
      var %stat -,%rawinfo = $+(,$base($colour(list),10,10,2),%n $2 - $ctime -)
      
      
      /*
      if ($2 = $3) {
        %stat = $+(,$z.getcol(3),Trying..)
        .timerzion.s.fo $+ %n -m 1 $r(222,6666) z.snoop.findopening %n $5 INIT
      }
      else %stat = $2 of $3
      */
      
;      var %d = $+($left(%5,80),,$chr(9),%3 $iif($4,$4),,$chr(9),%stat,,$chr(9),-,,$chr(9),-,,$chr(9),%rawinfo)
      var %d = $+($left(%5,80),,$chr(9),%3,,$chr(9),%stat,,$chr(9),-,,$chr(9),-,,$chr(9),%rawinfo)
      
      
      ; exclude sequence, wordmatch
      var %zz $z3.findtog(snoop,exclude)
      if ($gettok(%zz,1,124) = 1) {
        var %zz2 $gettok($strip(%d),1,9),%3 = $gettok(%zz,2,124),%zz4 $numtok(%3,32)
        while (%zz4 > 0) {
          dll_wfix WhileFix
          if ($istok(%zz2,$gettok(%3,%zz4,32),32)) return
          ;          if ($gettok(%3,%zz4,32) isin %zz2) return
          dec %zz4
        }
      }
      
      
      
      ; gotta make this line a signal since games can change
      ; this line could cause game hosts to get flooded, use broadcast to prevent.
      ; no broadcast
      ;      if ($z.comms.top($me,25)) .signal -n zion_getgameinfo %n $2
      ; broadcast
      if ($z.comms.top($me,25)) .timerzion.s.fo $+ %n -m 1 $r(222,6666) .signal -n zion_getgameinfo %n $2
      
      ;      z.game.getinfo %n $2
      
      aline %w %d
      
      .signal zion_gameinfo %n -d -
      
      ; matching sequence, wildmatch
      if (!%zion.le.gamestart) {
        var %zz $z3.findtog(snoop,notify)
        if ($gettok(%zz,1,124) = 1) {
          var %zz2 $gettok($strip(%d),1,9),%3 = $gettok(%zz,3,124)
          ; match
          if (($gettok(%zz,2,124) = 2) && (%zz2 = %3)) z.splay snd_gamelisted
          elseif ($gettok(%zz,2,124) = 1) {
            ;            var %zz3 $+(*,$replace(%3,$chr(32),*,_,$chr(32)),*)
            ;            if (%zz3 iswm %zz2) z.splay snd_gamelisted
            var %zz4 $numtok(%3,32)
            while (%zz4 > 0) {
              dll_wfix WhileFix
              ;              if ($istok(%zz2,$gettok(%3,%zz4,32),32)) { z.splay snd_gamelisted | return }
              if ($gettok(%3,%zz4,32) isin %zz2) { z.splay snd_gamelisted | return }
              dec %zz4
            }
          }
          elseif ($gettok(%zz,2,124) = 3) {
            var %zz4 $numtok(%3,32)
            while (%zz4 > 0) {
              dll_wfix WhileFix
              ;              if (!$istok(%zz2,$gettok(%3,%zz4,32),32)) return
              if ($gettok(%3,%zz4,32) !isin %zz2) return
              dec %zz4
            }
            z.splay snd_gamelisted
          }
          
        }
      }
    }
    if (%r2) if (%r2 > 2) sline %w %r2
    else sline %w $calc(($line(%w,0) /2) +1)
  }
}

alias z.gl.remitem {
  ;  if ($eval($+(%,zion.gl.rem.,$1),2)) return
  var %w $z.win, %k $replace($1,$chr(124),_124_)
  if ($window(%w)) {
    var %r2 $sline(%w,1).ln,%i2 = $fline(%w,$+(*,%k,*),1)
    if (%i2) {
      ;      if (*_pub* iswm %k) {
      ;.timerzion.s.snoop.test. $+ %k $+ .* off | zion.game.lister.close %k | sockclose snoop. $+ %k | unset $+(%,zion.s.snpticks.,%k)
      ;      }
      dline %w %i2
      ;      set -u1 $+(%,zion.gl.rem.,$1) 1
    }
  }
  if ($z.gl.empty) %zion.s.lastlist = $ctime
}
alias z.gl.empty return $iif($z.gl.getTotal < 1,1,0)
alias z.gl.udcode {
  var %w $z.win,%r2 $sline(%w,1).ln,%i2
  if ($1 isnum) { %i2 = $1 | tokenize 32 $2- }
  else %i2 = $fline(%w,$+(*,$1,*),1)
  if (%i2) {
    var %d = $line(%w,%i2),%e = $puttok(%d,$puttok($gettok(%d,6,9),$2,3,32),6,9)
    rline %w %i2 %e
  }
  if (%r2 > 2) sline %w %r2
}

alias z.gl.udctime {
  var %w $z.win,%r2 $sline(%w,1).ln,%i2
  if ($1 isnum) { %i2 = $1 | tokenize 32 $2- }
  else %i2 = $fline(%w,$+(*,$1,*),1)
  if (%i2) {
    var %d = $line(%w,%i2),%e = $puttok(%d,$puttok($gettok(%d,6,9),$2,4,32),6,9)
    rline %w %i2 %e
  }
  if (%r2 > 2) sline %w %r2
}

alias z.gl.udcache {
  var %w $z.win,%r2 $sline(%w,1).ln,%i2
  if ($1 isnum) { %i2 = $1 | tokenize 32 $2- }
  else %i2 = $fline(%w,$+(*,$1,*),1)
  if (%i2) {
    var %d = $line(%w,%i2),%e = $puttok(%d,$puttok($gettok(%d,6,9),$2,5,32),6,9)
    rline %w %i2 %e
  }
  if (%r2 > 2) sline %w %r2
}