用户:
第零法则查看:0 回复:1 评论:0 创建时间:2023-09-10T11:20:52

代码:
console.clear() async function createTable() { await db.sql`CREATE TABLE IF NOT EXISTS leaderboard ( userkey CHAR(16) NOT NULL, gelleons INT NOT NULL, spell LIST, spell_combination LIST, bag LIST )`; } createTable()async function b(userkey, gelleons){ await db.sql`INSERT INTO leaderboard(userKey, gelleons) VALUE (${userkey}, ${gelleons})` }
b("aaaaaaaaaaaaaaaa", 1) async function getPlayerRecord(userkey) { for await (const row of db.sql`SELECT * FROM leaderboard WHERE userkey=${userkey} ORDER BY gelleons`) { world.say(`${row.userkey} : ${row.gelleons}`) } }
getPlayerRecord("aaaaaaaaaaaaaaaa") world.onPlayerJoin(({entity}) => { 1 })