#Technical help
1 messages · Page 1 of 1 (latest)
🤔
"text": "{{context.Verification_result.computer}}",加个computer就读取不了,感觉现在是字符串"Verification_result":" "
格式固定的話
"context.player":"{{test_reply.match(/player:\s*(\d+)/)}}"
不懂的話,丟給claude問他這句怎麼解
"context.player":"{{test_reply.match(/player:\s*(\d+)/)}}"
"context.computer":"{{test_reply.match(/computer:\s*(\d+)/)}}"
"context.result":"{{test_reply.match(/result:\s*(\d+)/)}}"
大致上就這樣吧,這樣就提取了3個variable給你用了
反而是user prompt那裡要加個ALWAYS prompt強調AI的回應格式
類似ALWAYS response in format: [ xxxxxxxxxxxx (breakline) player: (石头,剪刀或布) (breakline) computer: (石头,剪刀或布) (breakline) (你输了,打平或你赢了)]
這個要自己調試
不過....我突然想到,你這個有必要用AI跑嗎
如果只是單純猜拳,隨機勝負的話,你用Math.random不就可以了
是的
(雖然這樣要跑AI,你倒是可以騙電量)
没有pass让用户花更多的电量也没啥好处,应该让用户节省点电量吧
(花電才有使用量)
也对
我是小白,还没接触高深的用法🥹
就是簡單概念,Math.random 會回報0到1的數值
Math.random() * 3就是0-3,然後rounddown就會給你隨機3個數字(0,1,2)
那用法很簡單
一個array variable,"computer": ["布","石","剪"]
那提取就可以很簡單地{{computer[rounddown(Math.random)]}},應該就隨機給你布石剪了。
隨手地不肯定語法是否正確,
還是那句,丟給AI問
因為把隨機工作交給AI的話,一般都做得不好,像IDK說,你即使叫AI隨機,那他其實會按他的想法,例如覺得要贏,就一直給你它贏的結果

gm
Reason: Bad word usage
Hi, I’m creating a bot called „AI Love Assistant” in Dev Mode, and I want to set up Shell Points monetization. I can’t see the „Economy” tab in my dashboard. Can you please verify my account as a Creator and unlock monetization features? Thanks!