function o0OO0ooooO0(OO0O00000O0){alert(OO0O00000O0);}function o0ooO000o0O(OOO0OoOOooo){confirm(OOO0OoOOooo);}var server_status = 'open'; var host = document.URL.substr(document.URL.indexOf("//")+2); host = host.substr(0,host.indexOf("/")) refresh_tm = 500; loading_bar = 0; var logout = function(){ location.href='game.php?m=logout'; } var menu = function(val){ if(val=="shop") { top_menu.innerHTML="
SHOP
hi
\\ 80Health recovery
"; top_menu.innerHTML+="

"; } if(val=="rank") { $.post("?mode=rank",function(result){top_menu.innerHTML="
RANK

"+result+"

";}); } if(val=="skill") { $.post("?mode=skill",function(result){top_menu.innerHTML="
SKILL

"+result+"

";}); } if(val=="del") { if(o0ooO000o0O('really?')){ location.href='?mode=remove'; } } } var refresh_status = function(){ $.post("?ping=1",null); value0f("s"); } var map_info = function(val){ var index = 0; for(var i=0;i<=100;i++){ if(block[i]==val) {index=i+1; break; } } index++; if(val.innerHTML!="" && loading_bar==0){ loading_bar = 1; value0f('i='+index); } } var status_draw = function(val){ val = val.split(','); if(val[4]<=0) location.href='game.php'; result="
"+'<'+val[0]+'>
Lv. '+val[1]+'
Gold. '+val[2]+"
HP
"+val[4]+"
Exp
"+val[6]+"
Action point
"+val[8]+"

" return result; } var learn = function(val){ $.post('?mode=skill&no='+val,null); menu('skill'); } var map_draw = function(val){ var var2 = ""; var mon_name = ""; var mon_lv = ""; var mon_hp = ""; var mon_hp_per = 0; var map_ = ""; for(var i=1;i<100;i++){ j=i-1; val2 = val[i].split(":"); mon_name = val2[0]; mon_lv = val2[1]; mon_hp = val2[2]; mon_mhp = val2[3]; mon_hp_per = mon_hp / mon_mhp * 100; if(mon_name){ if(mon_name.indexOf("mon")!=-1) map_+=""; else map_+=""; } else map_+=""; if(i%10==0) map_+=""; } return map_; } pageZOffset = new WebSocket("ws://"+host+":65500"); pageZOffset.onerror = function(){ world_map.innerHTML='

server error

'; value0f = function(val){} server_status='close'; } pageZOffset.onopen = function(){ server_status='open'; } pageZOffset.onclose = function(){ world_map.innerHTML='



connection closed by remote host

Refresh

'; value0f = function(val){} server_status='close'; } pageZOffset.onmessage = function(msg){ data = base64.decode(msg.data); flag = data.substr(0,1); if(flag == "@"){ if(data.split("\n")[0]=="@o"){o0OO0ooooO0('ok');} if(data.split("\n")[0]=="@s"){ player_status.innerHTML=status_draw(data.split("\n")[1]);} if(data.split("\n")[0]=="@l"){world_map.innerHTML=data.split("\n")[1];} } if(msg_save.innerHTML!=data && flag!="@"){ data_ = data.split("\n"); world_map.innerHTML=map_draw(data_); } msg_save=data; } var value0f = function(val){ pageZOffset.send(val); } var map_refresh = function(){ if(refresh_tm>0){ refresh_tm--; per = refresh_tm/500 * 100; per = 100-per; if(loading_bar==1) loading.innerHTML="
"; } else{ value0f('m'); loading_bar = 0; loading.innerHTML=''; refresh_tm=500; } } if(server_status=='open'){ setInterval("map_refresh();",1); setInterval("refresh_status();",400); }
Lv "+mon_lv+"

"+mon_hp+"