[hanlp]제작기에서 지도변환 빼낼때 update시 에러메세지 해결책 부탁!
member photo 탈퇴 3 1,563 0 2004-02-28 01:58:00
0
3Comments
member photo
제갈공자 2004.02.28(토) 오전 01:59:20
그런식으로;; 하면 ; 하나 빼먹었따는 소린데 잘 찾아보세요;; 소스를 보여주셔야 뭘;;;
member photo
탈퇴 2004.02.28(토) 오전 04:50:00(221.164.xxx.xx)
int cmd(string arg)
{
mixed *dir;
string rdfile, *lines, col, xx, yy, file_name, file;
string tx, ty, text, msg, time, str, zone;
int i, sz, x, y=0, si, max_si;

if (!arg || sscanf(arg,"%s %s",str,zone) != 2)
return notify_fail("\n사용법 : <화일명> <디렉토리명> 지도변환\n\n");

rdfile = read_file("/text/map/"+str);
if( !rdfile )
return notify_fail("\n * /text/map 디렉토리에서 [ "+str+" ] 화일을 찾을 수 없습니다.\n\n");

dir = get_dir("/d/"+zone);
if( sizeof(dir) )
return notify_fail("\n * 이미 /d/"+zone+" 디렉토리가 존재 합니다.\n\n");

lines = explode(rdfile,"\n");
sz = sizeof(lines);
if(!sz) return notify_fail("\n * 화일 내용 없음\n\n");
mkdirs( "/d/"+zone+"/" );
time = ctime(time());
for( i = 0; i < sz ; i++) {
col = lines[i];
si = sizeof(col);
while( si-- ) {
if( col[si] == 32 ) col = col[0..si-1];
else break;
}
si = sizeof(col);
for( x = 0; x < si ; x++ ) {
text = "";
if( col[x] != 161 ) {
continue;
}
else if( col[x..x+1] == "○" ||
col[x..x+1] == "■" ) {
if( (x/4+1)<10 ) xx = "0"+(x/4+1);
else xx = ""+(x/4+1);
if( (i/2+1)<10 ) yy = "0"+(i/2+1);
else yy = ""+(i/2+1);
file_name = xx+yy+".c";
file = xx+yy+"";
if( x+2 < si ) {
if( col[x+2..x+3] == "─" ) {
if( (x/4+2)<10 ) tx = "0"+(x/4+2);
else tx = ""+(x/4+2);
text += "\t\"동\" : \"/d/"+zone+"/"+tx+yy+"\",\n";
}
else if( col[x-2..x-1] == "↔" ) {
if( (x/4+2)<10 ) tx = "0"+(x/4+2);
else tx = ""+(x/4+2);
text += "\t\"계단\" : \"/d/"+zone+"/"+tx+yy+"\",\n";
}
}
if( (x/4+1) > 1 ) {
if( col[x-2..x-1] == "─" ) {
if( (x/4)<10 ) tx = "0"+(x/4);
else tx = ""+(x/4);
text += "\t\"서\" : \"/d/"+zone+"/"+tx+yy+"\",\n";
}
else if( col[x-2..x-1] == "↔" ) {
if( (x/4)<10 ) tx = "0"+(x/4);
else tx = ""+(x/4);
text += "\t\"계단\" : \"/d/"+zone+"/"+tx+yy+"\",\n";
}
}
if( i+1 < sz ) {
if( lines[i+1][x..x+1] == "│" ) {
if( (i/2+2)<10 ) ty = "0"+(i/2+2);
else ty = ""+(i/2+2);
text += "\t\"남\" : \"/d/"+zone+"/"+xx+ty+"\",\n";
}
else if( lines[i+1][x..x+1] == "↕" ) {
if( (i/2+2)<10 ) ty = "0"+(i/2+2);
else ty = ""+(i/2+2);
text += "\t\"계단\" : \"/d/"+zone+"/"+xx+ty+"\",\n";
}
if( lines[i+1][x-2..x-1] == "/" ) {
if( (i/2+2)<10 ) ty = "0"+(i/2+2);
else ty = ""+(i/2+2);
if( (x/4+2)<10 ) tx = "0"+(x/4);
else tx = ""+(x/4);
text += "\t\"남서\" : \"/d/"+zone+"/"+tx+ty+"\",\n";
}
if( lines[i+1][x+2..x+3] == "\" ) {
if( (i/2+2)<10 ) ty = "0"+(i/2+2);
else ty = ""+(i/2+2);
if( (x/4+2)<10 ) tx = "0"+(x/4+2);
else tx = ""+(x/4+2);
text += "\t\"남동\" : \"/d/"+zone+"/"+tx+ty+"\",\n";
}
}
if( (i/2+1) > 1 ) {
if( lines[i-1][x..x+1] == "│" ) {
if( (i/2)<10 ) ty = "0"+(i/2);
else ty = ""+(i/2);
text += "\t\"북\" : \"/d/"+zone+"/"+xx+ty+"\",\n";
}
else if( lines[i-1][x..x+1] == "↕" ) {
if( (i/2)<10 ) ty = "0"+(i/2);
else ty = ""+(i/2);
text += "\t\"계단\" : \"/d/"+zone+"/"+xx+ty+"\",\n";
}
if( x+2 < si ) {
if( lines[i-1][x+2..x+3] == "/" ) {
if( (i/2)<10 ) ty = "0"+(i/2);
else ty = ""+(i/2);
if( (x/4+2)<10 ) tx = "0"+(x/4+2);
else tx = ""+(x/4+2);
text += "\t\"북동\" : \"/d/"+zone+"/"+tx+ty+"\",\n";
}
}
if( lines[i-1][x-2..x-1] == "\" ) {
if( (i/2)<10 ) ty = "0"+(i/2);
else ty = ""+(i/2);
if( (x/4)<10 ) tx = "0"+(x/4);
else tx = ""+(x/4);
text += "\t\"북서\" : \"/d/"+zone+"/"+tx+ty+"\",\n";
}
}
y++;
if( col[x..x+1] == "■" )
msg = HEAD+PLAG+TEXT+text+"\t])) ;\n"+LAST+"\n";
else
msg = HEAD+TEXT+text+"\t])) ;\n"+LAST+"\n";
save_file("/d/"+zone+"/"+file_name,msg);
continue;
}
}
if( max_si < si ) max_si = si;
}
write("\n * 존 크기 : "+(max_si/4+1)+" × "+(sz/2+1)+", 총 "+y+"개의 룸이 완성되었습니다.\n\n");
return 1;
}

소스는 이거요~
member photo
탈퇴 2004.02.28(토) 오전 04:50:30(221.164.xxx.xx)
리플이라 탭이 안 먹히는군요;; 새글로 다시 올릴게요;;
코멘트를 삭제할 비밀번호를 입력하세요.
비밀번호:
정회원 이상만 코멘트 쓰기가 가능합니다.
총 게시물 943개 / 검색된 게시물: 943개
쪽지를 전송하고 있습니다. 잠시 기다려주세요.
쪽지보내기
받는이(ID/닉네임)
내용
쪽지가 도착하였습니다.
쪽지 내용을 읽어오고 있습니다. 잠시 기다려주세요.
--