Re: [wizs] 關於 clone 語法的修改
看板mud_sanc (Sanctuary - 聖殿)作者laechan (小太保)時間17年前 (2009/02/25 17:26)推噓0(0推 0噓 1→)留言1則, 1人參與討論串2/2 (看更多)
※ 引述《laechan (小太保)》之銘言:
: clone 我想新增四種語法進去..
: clone man1,man2, ...
該語法已新增.
> clone lady1,laechan1,man1
Cloning: /u/l/laechan/area/felid/mob/lady1.c to 房間(/u/l/laechan/workroom).
Cloning: /u/l/laechan/area/felid/mob/laechan1.c to 房間(/u/l/laechan/workroom).
Cloning: /u/l/laechan/area/felid/mob/man1.c to 房間(/u/l/laechan/workroom).
: clone m* 或 clone man*
該語法已新增.
> clone lady*
Cloning: /u/l/laechan/area/felid/mob/lady1.c to 房間(/u/l/laechan/workroom).
Cloning: /u/l/laechan/area/felid/mob/lady2.c to 房間(/u/l/laechan/workroom).
Cloning: /u/l/laechan/area/felid/mob/lady3.c to 房間(/u/l/laechan/workroom).
Cloning: /u/l/laechan/area/felid/mob/lady4.c to 房間(/u/l/laechan/workroom).
Cloning: /u/l/laechan/area/felid/mob/lady5.c to 房間(/u/l/laechan/workroom).
: clone #1,#2,#3, ... <= 這個倒不一定會做
這個取消不做.
: clone -all <= 自動判斷 .c 檔
這個相當於 clone *
: 這個適用於一次要叫出某目錄下的多隻怪物 or 多個武防
: or 物品,特別是底下幾種情況..
: 一、要看一下該區域(目錄)下幾個/全部的東西
: 二、拍賣會要一次叫出拍賣品
: 三、不想打檔名想簡單一點 clone
: 這些功能的添加不一定要由我來做,有興趣的 wiz 可自行
: more /cmds/wiz/_clone.c ,然後自己嚐試修改看看,再
: 把改好的檔案貼出來讓大家看看,大家互相觀摩學習總是
: 不錯的。
: 若沒人寫當然就我寫啦......因為我很想 clone -all 一
: 次試試看,在 clone 八卦的怪時會特別爽 >_<b
: (其實我只是想在測試怪物掉落物系統時能簡單一點啦XD)
: Laechan
新的語法目前有 bug,懶得修了,基本上就是不支援 ../xxx
或者是指定目錄方式, 要用新語法 clone 東西, 必須先 cd
到那個目錄.
(以後有空再把這部份的判斷補完整一點)
這項修改也用到一個重要的基本概念, 就是原本都是對字串
做的處理, 保留不變, 但因為 clone 出來的東西是陣列,所
以..
原處理
字串處理
新處理
foreach 字串 in 陣列
對字串做原處理;
所以它還有另一個 bug, 就是 clone 到一半如果遇到無法
clone 出來的檔案就會停止(因為原處理是 return 0/1),
在迴圈中要視情況改為 continue/break.
這個也是以後再改, 要上課了沒啥空.
其它部份 wiz 們可以自行 try try.
PS只要 clone 後面接的字串不包含 "," 與 "*" 的話, 都
會 follow 原先的 clone 語法.
Laechan
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.131.252.57
→
02/25 19:49, , 1F
02/25 19:49, 1F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
mud_sanc 近期熱門文章
PTT遊戲區 即時熱門文章
15
19