# 譴責FM (計數器)

### NightBot設定

摁，謠傳譴責一位叫[FM](https://www.twitch.tv/FinalMethod)的實況主會帶來好運的神秘配方，

當初各友台都分別建立一個計數器，各自的計數都不同，這樣無法帶來足夠的好運，

以下的指令就誕生了!!

{% code overflow="wrap" lineNumbers="true" %}

```
譴責計量表 $(eval $(urlfetch json https://script.google.com/macros/s/AKfycbxuMlrw6NPDyC-qdclbBQ3ltp60j5ZzLXpov5oQlQILe4DUcWHdOHW0YUEUVPrpAZRtew/exec);) /∞
```

{% endcode %}

譴責計量表的文字可以自由客製。

{% hint style="info" %}
玩梗請適度，請勿造成他人不適。
{% endhint %}

### GAS (Google App Script )

如果你只是想加譴責FM指令，那這段可以不用看沒關係，

先建一個Google Sheet，開啟App Script

GAS這邊寫入 doget 去抓取，只要每開一次網頁，就將A2欄位的數字+1，並且回傳。

```javascript
// 複製 Sheet 網址裡 [sheet-id] 的部份
// https://docs.google.com/spreadsheets/d/[sheet-id]/

function doGet(e) {

  //取得參數
  var params = e.parameter;
  var counter = params.counter;

  //sheet資訊
  var SpreadSheet = SpreadsheetApp.openById("你的SheetID");
  var Sheet = SpreadSheet.getSheets()[0];
  var FM = SpreadSheet.getSheetValues(2,1,1,1);
  FM2=+FM;
  //存入資訊
   counter = FM2+1;
  Sheet.getRange(2, 1).setValue(counter);
 
  //回傳資訊
  return ContentService.createTextOutput(counter);
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ds83171.gitbook.io/workspace/nightbot-zhi-ling/qian-ze-fm-ji-shu-qi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
