Re: [wizs] 問題╳問題

看板mud_sanc (Sanctuary - 聖殿)作者 (小太保)時間15年前 (2011/03/29 12:25), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/3 (看更多)
※ 引述《laechan (小太保)》之銘言: : 可以模擬成 godware 的方式(不過不建議). 如果是我的話, 因為字串拆解挺麻煩的, 所以我會用偷懶的方式.. int call_xxx(string str) { string tmp,s1,s2; object tar,ob; // 例1: call xxx->ooo() // 例2: call xxx->set("leve",100) // 例3: call xxx->add("guild/slasher",20) // . .... sscanf(str,"%s->%s",s1,s2); if(!tar=present(s1,environment(this_player()))) if(!tar=find_player(s1)) if(!tar=find_living(s1)) if(!tar=find_object_or_load(s1)) return notify_fail("call: 沒有 "+s1+" 這個目標喔.\n"); tmp="inherit ROOM;\n\n"+ "void call_xxx(string s1,string s2)\n"+ "{\n"+ " object tar;\n"+@LONG if(!tar=present(s1,environment(this_player()))) if(!tar=find_player(s1)) if(!tar=find_living(s1)) tar=find_object_or_load(s1); LONG + " tar->"+s2+";\n"+ "}\n"; write_file("/open/tmp_call_room.c",tmp); "/cmds/file/_update"->cmd_update("/open/tmp_call_room"); if(!catch(ob=find_object_or_load("/open/tmp_call_room"))) { rm("/open/tmp_call_room.c"); write("You Let "+str+"..."); if(!catch(ob->call_xxx(s1,s2))) write(str+" Success!\n"); else write(str+" Fail!\n"); } return 1; } 這是 godware 架構的一部份寫法. Laechan -- ※ 發信站: 批踢踢實業坊(ptt.cc) ※ 編輯: laechan 來自: 115.80.128.16 (03/29 12:26)
文章代碼(AID): #1DaLzEEk (mud_sanc)
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 3 之 3 篇):
文章代碼(AID): #1DaLzEEk (mud_sanc)