Skip to content

Commit

Permalink
更新导表工具
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Jul 23, 2024
1 parent 762ffbe commit 1cf6a43
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
* `2-自动执行的脚本.js`
* `3-读取excel.js`
* `4-excel生成物编.js`
* `5-excel生成物编·极.js`(未完成)
* `5-excel生成物编·极.js`
* `6-更多的演示` (会根据作者需求逐步更新)

## 如何对本插件进行二次开发?

Expand Down
8 changes: 4 additions & 4 deletions template/plugin/2.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ let os = require('os')

export async function onGame() {
y3.print('启动游戏!')
// 在你的Lua代码里加入 `require 'y3-helper.plugin.onGame'` 试试看
y3.fs.writeFile(y3.uri(y3.env.scriptUri, 'y3-helper/plugin/onGame.lua'), `
// 在你的Lua代码里加入 `require 'log.onGame'` 试试看
y3.fs.writeFile(y3.uri(y3.env.scriptUri, 'log/onGame.lua'), `
print('运行者:${os.userInfo().username},运行时间:${new Date().toLocaleString()}')
`)
}
Expand All @@ -28,8 +28,8 @@ export async function onEditor() {

export async function onSave() {
y3.print('保存地图!')
// 在你的Lua代码里加入 `require 'y3-helper.plugin.onSave'` 试试看
y3.fs.writeFile(y3.uri(y3.env.scriptUri, 'y3-helper/plugin/onSave.lua'), `
// 在你的Lua代码里加入 `require 'log.onSave'` 试试看
y3.fs.writeFile(y3.uri(y3.env.scriptUri, 'log/onSave.lua'), `
print('保存者:${os.userInfo().username},保存时间:${new Date().toLocaleString()}')
`)
}
17 changes: 17 additions & 0 deletions template/plugin/6/6.1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
let y3 = require('y3-helper')

export async function 多维表() {
y3.excel.setBaseDir(y3.env.pluginUri)

let excel = await y3.excel.loadFile('6-更多的演示/6.1-多维表')
let table = excel.makeMultiTable()

y3.assert(table['风暴之锤']['字段1'][0] === '伤害')
y3.assert(table['风暴之锤']['字段1'][1] === '100|200|300')

y3.assert(table['雷霆一击']['编号'][0] === '1002')

y3.assert(table['重击']['名字'][0] === '重击')

y3.print('多维表读取成功!')
}
Binary file added template/plugin/6/6.1.xlsx
Binary file not shown.
4 changes: 4 additions & 0 deletions template/plugin/6/listfile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"6.1.js": "6.1-多维表.js",
"6.1.xlsx": "6.1-多维表.xlsx"
}
4 changes: 3 additions & 1 deletion template/plugin/listfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
"5.js": "5-excel生成物编·极.js",

"3.xlsx": "3-读取excel.xlsx",
"5.xlsx": "5-excel生成物编·极.xlsx"
"5.xlsx": "5-excel生成物编·极.xlsx",

"6": "6-更多的演示"
}

0 comments on commit 1cf6a43

Please sign in to comment.