mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-23 14:34:19 +02:00
@@ -88,7 +88,7 @@ let choices = [
|
||||
]
|
||||
|
||||
// シードが「PlayID+ユーザーID+今日の日付」である乱数生成器を用意
|
||||
let random = Math:gen_rng(\`{THIS_ID}{USER_ID}{Date:year()}{Date:month()}{Date:day()}\`)
|
||||
let random = Math:gen_rng(\`{THIS_ID}{USER_ID}{Date:year()}{Date:month()}{Date:day()}\`, { algorithm: 'rc4_legacy' })
|
||||
|
||||
// ランダムに選択肢を選ぶ
|
||||
let chosen = choices[random(0, (choices.len - 1))]
|
||||
@@ -127,7 +127,7 @@ var results = []
|
||||
// どれだけ巻き戻しているか
|
||||
var cursor = 0
|
||||
|
||||
@do() {
|
||||
@main() {
|
||||
if (cursor != 0) {
|
||||
results = results.slice(0, (cursor + 1))
|
||||
cursor = 0
|
||||
@@ -175,7 +175,7 @@ var cursor = 0
|
||||
onClick: forward
|
||||
}, {
|
||||
text: "引き直す"
|
||||
onClick: do
|
||||
onClick: main
|
||||
}]
|
||||
})
|
||||
Ui:C:postFormButton({
|
||||
@@ -191,7 +191,7 @@ var cursor = 0
|
||||
])
|
||||
}
|
||||
|
||||
do()
|
||||
main()
|
||||
`;
|
||||
|
||||
const PRESET_QUIZ = `/// @ ${AISCRIPT_VERSION}
|
||||
|
||||
@@ -63,11 +63,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<script lang="ts" setup>
|
||||
import { computed, onDeactivated, onUnmounted, ref, watch, shallowRef, defineAsyncComponent } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { Interpreter, Parser, values } from '@syuilo/aiscript';
|
||||
import { url } from '@@/js/config.js';
|
||||
import type { Ref } from 'vue';
|
||||
import type { AsUiComponent, AsUiRoot } from '@/aiscript/ui.js';
|
||||
import type { MenuItem } from '@/types/menu.js';
|
||||
import type { Interpreter } from '@syuilo/aiscript';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/utility/misskey-api.js';
|
||||
@@ -180,8 +180,6 @@ async function unlike() {
|
||||
|
||||
watch(() => props.id, fetchFlash, { immediate: true });
|
||||
|
||||
const parser = new Parser();
|
||||
|
||||
const started = ref(false);
|
||||
const aiscript = shallowRef<Interpreter | null>(null);
|
||||
const root = ref<AsUiRoot>();
|
||||
@@ -196,6 +194,12 @@ async function run() {
|
||||
if (aiscript.value) aiscript.value.abort();
|
||||
if (!flash.value) return;
|
||||
|
||||
const isLegacy = !flash.value.script.replaceAll(' ', '').startsWith('///@1.0.0');
|
||||
|
||||
const { Interpreter, Parser, values } = isLegacy ? await import('@syuilo/aiscript-0-19-0') : await import('@syuilo/aiscript');
|
||||
|
||||
const parser = new Parser();
|
||||
|
||||
components.value = [];
|
||||
|
||||
aiscript.value = new Interpreter({
|
||||
|
||||
Reference in New Issue
Block a user