| 此条目(的部分内容)需要翻译。 |
这里是以前配置或使用脚本时遇到的一些问题。
使用本页面,首先要确定您问题脚本的类型(如时间驱动脚本或事件驱动脚本(webhook)等),之后去下面看看相关问题。其中“所有脚本类型”部分里的问题对任何类型都适用。
要是在这儿没找到您遇见的问题,可以去看看您使用的脚本主页有没有列出来的已知问题。若是没有,可以尝试联系脚本作者。
所有脚本类型[]
持续运行的脚本与以前比起来慢一些[]
自 2020 年 6 月 20 日起,Habitica 引入了 “rate limiting” ,这会限制第三方工具访问 Habitica 服务器的频率。一旦频率触及限制,脚本之后的访问将会失败,限制于一分钟后解除。
您可以联系作者来优化脚本的运行(如减少对 Habitica 服务器的访问),但请注意有些类型的脚本在限制下很难提速。
脚本偶尔执行一部分后中断导致运行故障[]
原因与上面提及的脚本运行缓慢相同。
您可以避免在短时间内多次使用脚本来避免故障。也尝试联系作者以多次重试或报错来改进脚本。
时间驱动型脚本[]
每天执行的脚本实际运行时间与设定时间有着小时内的误差。[]
时间驱动型脚本的触发时间会有些随机,但只要执行了一次,之后的触发时间都会与第一次有着相同的偏差。
To force the script to choose another random time within the hour, perform the following steps:
- Go to https://script.google.com/home/triggers
- Hover your mouse cursor over the row of the script, then click the pencil icon on the right
- No need to change anything, simply scroll down then click "Save"
I get an email titled, "Summary of failures for Google Apps Script: ..."[]
At the moment, these have only been observed to come from scripts that are configured to have a time-driven trigger. The error messages encountered so far include:
- "We're sorry, a server error occurred. Please wait a bit and try again."
- "Exception: Request failed for https://habitica.com returned code 502..."
- "Exception: Address unavailable: ..."
- "We're sorry, a server error occurred while reading from storage. Error code INTERNAL."
They all seem to be random errors either in the Google Apps Script platform itself, or the Internet connection in general. There doesn't seem to be a way for us to prevent such errors, but thankfully these errors only happen very rarely.
If it's critical that the script's actions occur on a certain timeframe, we can deploy the script twice so that in case we got unlucky and the first instance fails, the second instance will still give a high chance that the actions will go through on this second try.
Event-Driven (Webhook) Scripts[]
The script completely stopped working suddenly.[]
The webhook might have been disabled.
To reenable the webhook, perform the following steps:
- Go to https://habitica.com/user/settings/api
- On the right side of the screen, under "Webhooks", make sure that all checkboxes under "Enabled" are checked
The script does things twice (e.g. sends notifications twice, etc.).[]
The webhook might have been created twice.
To make sure the duplicate webhook is removed, perform the following steps:
- Perform steps under Part 1. Delete Items Created by doOneTimeSetup
- Perform steps under Part 3. Recreate Items Created by doOneTimeSetup
I accidentally deleted/changed a reward button created by the script and want to revert it back to normal.[]
To revert all of the script's reward buttons to their initial state, perform the following steps:
- Perform steps under Part 1. Delete Items Created by doOneTimeSetup
- Perform steps under Part 3. Recreate Items Created by doOneTimeSetup
You will also need to do any actions you did before to change these buttons from their initial state (e.g. change costume/appearance names, talk to the NPC to select a Subclass, etc.)