「浪語」:修訂間差異

update
(relink extension page and add hackmd page)
(update)
標籤2017 原始碼編輯
第134行: 第134行:


// 還有一些幫你抓好的變數
// 還有一些幫你抓好的變數
loc // 現在位置(大廳或房間 "lounge" / "room")
drrr.loc // 現在位置(大廳或房間 "lounge" / "room")
profile // 個人訊息
drrr.profile // 個人訊息
room // 房間訊息
drrr.room // 房間訊息
users // 房間成員
drrr.users // 房間成員
info // 跟個人訊息有點像
drrr.info // 跟個人訊息有點像
rooms // 所有房間,大廳狀態
drrr.rooms // 所有房間,大廳狀態


// 有時你會需要更新,可以透過以下函數去更新他們
// 有時你會需要更新,可以透過以下函數去更新他們
updateLounge(callback);
drrr.getLounge(callback);
updateProfile(callback);
drrr.getProfile(callback);
updateLoc(callback);
drrr.getLoc(callback);


</syntaxhighlight>
</syntaxhighlight>
第251行: 第251行:


<syntaxhighlight lang="javascript" line="1">
<syntaxhighlight lang="javascript" line="1">
guests = users.map((x)=>x.name);
guests = drrr.users.map((x)=>x.name);
event join (user) => {
event join (user) => {
   if guests.includes(user)
   if guests.includes(user)
第297行: 第297行:
// 房間上限 9.0001 人
// 房間上限 9.0001 人
event join (user) => {
event join (user) => {
   if users.length == 10
   if drrr.users.length == 10
   then
   then
   drrr.print("/me恭喜成為 0.0001 人,你終於不做人類了嗎!");
   drrr.print("/me恭喜成為 0.0001 人,你終於不做人類了嗎!");
   else
   else
drrr.print("/me歡迎第 " + String(users.length) + " 個貴賓!");
drrr.print("/me歡迎第 " + String(drrr.users.length) + " 個貴賓!");
}
}
</syntaxhighlight>
</syntaxhighlight>
153

次編輯