<%
zhbg_name=session("zhbg_name")
nowinroom=session("nowinroom")
'添加名单
sub addnpc (zdnpc_name)
    Application.Lock
    js=1
    onlinelist=Application("zhbg_onlinelist"&nowinroom)
    onlineno=ubound(onlinelist)
    yjl=0
    for i=1 to onlineno
    onuser=split(onlinelist(i),"|")
    if yjl=0 and StrComp(onuser(0),zhbg_name,1)=1 then	'按名字汉语拼音排序
	Redim Preserve newonlinelist(js+1)
	yjl=1
	newonlinelist(js)=myonline
	newonlinelist(js+1)=onlinelist(i)
	js=js+2
    else
	Redim Preserve newonlinelist(js)
	newonlinelist(js)=onlinelist(i)
	js=js+1
    end if
    next 
    if yjl=0 then
	Redim Preserve newonlinelist(js)
	newonlinelist(js)=myonline
    end if
    Application("zhbg_onlinelist"&nowinroom)=newonlinelist
    Application("zhbg_useronlinename"&nowinroom)=Application("zhbg_useronlinename"&nowinroom)&" "&zdnpc_name&" "
    Application("zhbg_npc"&nowinroom)=Application("zhbg_npc"&nowinroom)&";"&zdnpc_name&"|"
    Application("zhbg_npc")=Application("zhbg_npc")&";"&zdnpc_name&"|"
    erase  newonlinelist
    erase  onlinelist
    Application.UnLock
    Session("SayCount")=Application("SayCount")
end sub
'删除npc名单
sub delnpc (nl_name)
Application.Lock
onlinelist=Application("zhbg_onlinelist"&session("nowinroom"))
onno=ubound(onlinelist)
for i=1 to onno
if InStr(onlinelist(i),nl_name& "|")=1 then
  for j=i to onno-1
   onlinelist(j)=onlinelist(j+1)
  next
  ReDim Preserve onlinelist(onno-1)
  exit for
 end if
next
Application("zhbg_onlinelist"&nowinroom)=onlinelist
Application("zhbg_useronlinename"&nowinroom)=Replace(Application("zhbg_useronlinename"&nowinroom)," " &nl_name& " ","")
Application("zhbg_npc"&nowinroom)=Replace(Application("zhbg_npc"&nowinroom),";"&nl_name&"|","")
Application("zhbg_npc")=Replace(Application("zhbg_npc"),";"&nl_name&"|","")
Application.UnLock
end sub
%>