
Lv.1
签名: QQ: 2418207411
在 关于那些不为人知的小api 中回复
declare enum Box3AssetType {
VOXEL_MESH = "mesh",
DIRECTORY = "directory",
COLOR_LUT = "lut",
JS_SCRIPT = "js",
IMAGE = "image",
PARTICLE_TEXTURE = "snow",
SOUND = "sound"
}2023-05-15T00:38:35 点赞:0
在 NomenFileSystem@1.7.0 : 基于SQL的文件与目录管理系统 中回复
EasyCoding项目 - EasyController 是由萌新大佬开发的一款便于管理文件,代码的便捷工具
快速开始:
/**
* EasyController 是由萌新大佬开发的一款便于管理文件,代码的便捷工具
* 此工具完全开源,免费试用,共所有人学习与参考
* 建议单独设立文件使用,并首个require
* @author 萌新大佬 <https://box3.codemao.cn/u/mxdlorzorz>
* @version 1.0.0
*/
//init
const assetTypes ={
'js':'代码',
'image':'图片',
'lut':'滤镜',
'snow':'雪花纹样',
'mesh':'模型',
'sound':'音乐/音效',
'directory':'文件夹',
};
!function init(){
console.clear();
console.log('EasyController加载中...');
console.log(`检测到EasyController存储位置:[${__dirname||'.'}/${__filename}]`);
console.log('[EasyController]整理文件中...');
console.log('[EasyController]文件:');
/**
* @param {Box3AssetListEntry[]} asts
*/
function dir(asts,deep){
for(const ast of asts){
var log='';
for(let i=1;i<=deep;i++)log+='····';
console.log(`${log}[${assetTypes[ast.type]}]${ast.path.split('/').pop()}`);
if(ast.type==Box3AssetType.DIRECTORY)dir(resources.ls(ast.path),deep+1);
}
}
dir(resources.ls('.'),1);
}();
//tools
function getFileName(){
try{
throw Error();
}catch(err){
return err.stack.split('\n').
find(x=>x.includes('eval')).slice(13).split(':')[0];
}
}
function getLine(){
try{
throw Error();
}catch(err){
return err.stack.split('\n').
find(x=>x.includes('eval')).slice(13).split(':')[1];
}
}
//logger
class Logger{
/**
* 为每个文件建立独立对话框
* @param {boolean?} showLine 是否显示输出的行数,默认为false
* @param {boolean?} showTime 是否显示输出的时间,默认为false
*/
constructor(showLine,showTime){
this.filename=getFileName();
this.showLine=showLine||false;
this.showTime=showTime||false;
this.log(`[logger] ${this.filename}logger加载完毕`);
}
get preLog(){
var log='';
var d=new Date();
if(this.showTime)log+=`[${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}]`;
log+='['+this.filename;
if(this.showLine)log+=':'+getLine();
return log+']';
}
log(...args){
return console.log(this.preLog,...args);
}
warn(...args){
return console.warn(this.preLog,...args);
}
error(...args){
return console.error(this.preLog,...args);
}
clear(){
console.clear();
console.log(`clear at ${this.preLog}`);
}
}
//exports
module.exports={
Logger,
}2023-05-18T12:33:09 点赞:0
在 NomenCommand:同语法我的世界指令解析器 中回复
注:NCSelector需要在当前作用域内或者在NCSelector.js内,请确保您按照要求安装了NCSelector
NCSelector:基于我的世界实体搜寻器字符串的语法的实体搜索器
https://shequ.codemao.cn/community/5413312023-05-21T06:34:41 点赞:0
在 【玩法】大家把自己的名字用百度翻译持续生喵得出来的结果是什么?(生喵过程自己定就行了) 中回复
Nomen
टर्मिनल बैकग्राउण्ड क अपने-आप वाला रंग
murRak; essiH
mi-ximunutho exiH
出口
2023-06-02T11:17:56 点赞:0
在 拜师贴(Box3) 中回复
最好的导师:喵
runoob.com
bing.com
developer.mozilla.org
bilibili.com
box3.yuque.com/org-wiki-box3-ev7rl4/docs/api
box3.yuque.com/org-wiki-box3-ev7rl4/docs/guide
这些导师任挑其8,即可成为js大佬
2023-06-20T11:04:27 点赞:0
在 NomenDBCore: 真正轻量级链式易于理解的通用SQL表格数据管理器 中回复
注:教程中的排序模式ACS更改为ASC(升序),实际代码没有出错,但是使用需要注意,如果写错,会导致静默错误,知晓
2023-07-07T11:39:05 点赞:1
在 【求助】GUI如何做可交互的按钮以及显示图片() 中回复
这个gui方案只是过度,很快就会改
实际上是iframe套了个皮,仔细看有postmessage
2023-07-07T11:54:06 点赞:0
在 整活)NomenItemStack:快捷管理物品栈/背包,具有堆叠上限和全map操作 中回复
经测试,add方法存在问题,请修改为如下函数:
/**@param {NomenItemStackItem} item */
add(item, _skip) {
if (item.canStack !== undefined && !item.canStack) {
for (let i = 0; i < item.num; i++) {
this.IS.push({ ...item, num: 1 });
}
return;
}
if (this.IS.filter(v => v.id == item.id).length && _skip !== true) {
let l = item.num, r = this.IS.filter(v => v.id == item.id);
for (let i = 0; i < r.length; i++) {
if (l <= 0) return;
if (r[i].num + l > this.maxItem) {
l -= this.maxItem - r[i].num;
r[i].num += this.maxItem - r[i].num;
} else {
r[i].num += l;
l = 0;
return;
}
};
this, this.add({ ...item, num: l }, true)
} else {
if (item.num > this.maxItem) {
let r = (item.num - (item.num % this.maxItem)) / this.maxItem;
for (let i = 0; i < r; i++) {
this.IS.push({
...item,
num: this.maxItem
});
};
if (item.num % this.maxItem) {
this.IS.push({
...item,
num: item.num % this.maxItem
});
}
}
else {
this.IS.push({
...item,
num: item.num
});
}
}
}
或前往Box3Tools仓库更新至NomenItemStack 1.0.1
github.com/helloyork/Box3-Tools/tree/main/src/%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86%E5%B7%A5%E5%85%B7/NomenItemStack2023-07-14T06:18:49 点赞:0
在 【PRO编辑器】新版数据库模板 中回复
数据维度低,读写代价大,时间消耗高,字段寄全家寄(
作为一个萌新小白超级新的新人以及代码入门的我来说这种方案还是不适合(
2023-07-16T11:45:55 点赞:0