Lv.1
()
在 定时重启的代码是(什? 中回复
1小时重启实例:
sleep(1000*3600).then(async()=>{
world.say(`即将重启!`)
await sleep(0)
for(;;){}
})2023-08-21T12:34:31 点赞:0
在 【高级教程】居然还有人不知道管喵代码怎么编?——管喵代码(进阶) 中回复
顶
要顶
必须顶
不得不顶
用尽全力顶
再加上千斤顶
总之把它顶到顶
接着使出葵花宝顶
就算顶到史前也要顶
老子看了会用道德经顶
孔子亲自拜你为师天天顶
秦始皇站在阿房宫上使劲顶
汉高祖挥师杀向东罗马为你顶
吕布抛弃了貂禅而选择了帮你顶
张三丰见了后用太极拳九式全力顶
左冷禅召开武林盟主大会商讨如何顶
西门吹雪从此学会了最强一招剑神一顶
龙剑飞的儒来神掌最后一式改为万佛朝顶
陆小凤从此再也不管闲事了而专门来为你顶
四大名捕四面出击看天下还有没有人敢不在顶
顶到阎罗王说我制造噪音我刁根烟看看他继续顶
顶到火山喷发太平洋海啸我还要继续往喵里顶
顶到益阳地震山崩地裂地下水泛滥我还要顶
顶到地下水喷发造成洪灾损失惨重我也顶
要是你觉得敢兴趣你也可以过来一起顶
要是你看我不爽我没办法还要继续顶
要是 C T敢过来阻止我就更加要顶
要是别人见了骂我傻我还是要顶
要是踩到我脚喵我也继续顶
要是地面凹了我不管继续顶
要是天真塌下来了继续顶
就算天塌下来我都要顶
就算鸡店倒闭也要顶
就算鞋子烂也要顶
我用尽全力去顶
我非常用力顶
我很用力顶
我用力顶
我再顶
顶顶
顶
2023-08-28T10:05:19 点赞:0
在 【教程】背包教程(自带SQL) 中回复
格式化了(啊啊啊累s了 constInitCap=10;//这里写背包的初始容量 db.sql` CREATETABLEIFNOTEXISTSbag( idCHAR(16)NOTNULL,--这里存userKey recordTEXTNOTNULL--这里存背包 )`//建立sql world.onPlayerJoin(async({entity})=>{//当玩家进入地图 functioninit(){//建立初始背包 entity.bag=newBag(entity, {/*如果有初始物品在这里写*/}, InitCap );//初始背包的构造 } if(entity.player.userKey){//如果玩家非游客 constrows=awaitdb.sql`SELECT*FROMbagWHEREid=${entity.player.userKey}`;//获取玩家数据的那一行 if(rows&&!rows.length){//如果这一行不存在 init(); //那么建立初始背包 db.sql`INSERTINTObagVALUES( ${JSON.stringify(entity.bag.saveObject)} ${entity.player.userKey}, ) `;//将初始背包插入sql }else{//如果玩家有数据 constnow=JSON.parse(rows[0].record);//将读取到的数据临时存放在now entity.bag=newBag(entity,now.thing,now.capacity);// } } else{ init();//游客玩家直接建立新背包 } }) world.onPlayerLeave(({entity})=>{ entity.bag.save();//玩家离开时保存 }) classBag{//创建背包类 constructor(owner=newBox3Entity,thing={},capacity=0){ //构造函数 this.owner=owner; this.thing=thing; this.capacity=capacity; this.now=0; for(constiofObject.keys(this.thing)){ this.now+=this.thing[i]; }//now是物品数量 this.saveObject={ thing:this.thing,capacity:this.capacity }//sql存档的时候存这个 } save(){//保存 if(!this.owner.player.userKey)return;//如果游客账号就不保存 db.sql`UPDATEbagSETrecord=${JSON.stringify(this.saveObject)}WHEREid=${this.owner.player.userKey}`;//保存 if(this.now+num>this.capacity)returnundefined;//如果数量数量超过了就返回 if(!!this.thing[item]){//如果此物品存过 this.thing[item]+=num;//增加num this.saveObject.thing[item]+=num;//保存对象也要同步 }else{//如果没存过 this.thing[item]=num;//直接赋值 this.saveObject.thing[item]=num;//直接赋值 }this.now+=num;//物品的数量也要喵回物品数量 }del(item='',num=1){//删除物品,默认减少一个 if(!this.thing[item])returnNaN;//如果此物品不存在直接返回 if(this.thing[item]<num)returnundefined;//如果不够减就返undefuned this.thing[item]-=num;//减去相应的量 this.saveObject.thing[item]-=num;//同步保存对象 this.now-=num;//当前物品数也要减 returnthis.thing[item];//返回数量 }setCap(cap=0){//设置容量 if(cap<this.now)returnundefined;//如果背包里的物品比目标容量多则返 this.capacity=cap;//直接设置容量 returnthis.capacity;//返回值 }asyncshow(){//对玩家展示背包 varop=[]; for(constiofObject.keys(this.thing)){ op.push(`${i}×${this.thing[i]}`); }//将物品×数量放进选项列表 constp=awaitthis.owner.player.dialog({//建立对话框 type:Box3DialogType.SELECT,title:'背包',//具体细节如标题, content:'以下是你的背包',options:op, }); returnthis.thing[Object.keys(this.thing)[op.indexOf(p)]];//返回选择了的物品 } }
2023-10-13T19:42:33 点赞:0
在 【教程】背包教程(自带SQL) 中回复
constInitCap=10;//这里写背包的初始容量 db.sql` CREATETABLEIFNOTEXISTSbag( idCHAR(16)NOTNULL,--这里存userKey recordTEXTNOTNULL--这里存背包 )`//建立sql world.onPlayerJoin(async({entity})=>{//当玩家进入地图 functioninit(){//建立初始背包 entity.bag=newBag(entity, {/*如果有初始物品在这里写*/}, InitCap );//初始背包的构造 } if(entity.player.userKey){//如果玩家非游客 constrows=awaitdb.sql`SELECT*FROMbagWHEREid=${entity.player.userKey}`;//获取玩家数据的那一行 if(rows&&!rows.length){//如果这一行不存在 init(); //那么建立初始背包 db.sql`INSERTINTObagVALUES( ${JSON.stringify(entity.bag.saveObject)} ${entity.player.userKey}, ) `;//将初始背包插入sql }else{//如果玩家有数据 constnow=JSON.parse(rows[0].record);//将读取到的数据临时存放在now entity.bag=newBag(entity,now.thing,now.capacity);// } } else{ init();//游客玩家直接建立新背包 } }) world.onPlayerLeave(({entity})=>{ entity.bag.save();//玩家离开时保存 }) classBag{//创建背包类 constructor(owner=newBox3Entity,thing={},capacity=0){ //构造函数 this.owner=owner; this.thing=thing; this.capacity=capacity; this.now=0; for(constiofObject.keys(this.thing)){ this.now+=this.thing[i]; }//now是物品数量 this.saveObject={ thing:this.thing,capacity:this.capacity }//sql存档的时候存这个 } save(){//保存 if(!this.owner.player.userKey)return;//如果游客账号就不保存 db.sql`UPDATEbagSETrecord=${JSON.stringify(this.saveObject)}WHEREid=${this.owner.player.userKey}`;//保存 if(this.now+num>this.capacity)returnundefined;//如果数量数量超过了就返回 if(!!this.thing[item]){//如果此物品存过 this.thing[item]+=num;//增加num this.saveObject.thing[item]+=num;//保存对象也要同步 }else{//如果没存过 this.thing[item]=num;//直接赋值 this.saveObject.thing[item]=num;//直接赋值 }this.now+=num;//物品的数量也要喵回物品数量 }del(item='',num=1){//删除物品,默认减少一个 if(!this.thing[item])returnNaN;//如果此物品不存在直接返回 if(this.thing[item]<num)returnundefined;//如果不够减就返undefuned this.thing[item]-=num;//减去相应的量 this.saveObject.thing[item]-=num;//同步保存对象 this.now-=num;//当前物品数也要减 returnthis.thing[item];//返回数量 }setCap(cap=0){//设置容量 if(cap<this.now)returnundefined;//如果背包里的物品比目标容量多则返 this.capacity=cap;//直接设置容量 returnthis.capacity;//返回值 }asyncshow(){//对玩家展示背包 varop=[]; for(constiofObject.keys(this.thing)){ op.push(`${i}×${this.thing[i]}`); }//将物品×数量放进选项列表 constp=awaitthis.owner.player.dialog({//建立对话框 type:Box3DialogType.SELECT,title:'背包',//具体细节如标题, content:'以下是你的背包',options:op, }); returnthis.thing[Object.keys(this.thing)[op.indexOf(p)]];//返回选择了的物品 } }
2023-10-13T19:42:54 点赞:0
在 【教程】背包教程(自带SQL) 中回复
啊啊用js格式上传好像不行 constInitCap=10;//这里写背包的初始容量 db.sql` CREATETABLEIFNOTEXISTSbag( idCHAR(16)NOTNULL,--这里存userKey recordTEXTNOTNULL--这里存背包 )`//建立sql world.onPlayerJoin(async({entity})=>{//当玩家进入地图 functioninit(){//建立初始背包 entity.bag=newBag(entity, {/*如果有初始物品在这里写*/}, InitCap );//初始背包的构造 } if(entity.player.userKey){//如果玩家非游客 constrows=awaitdb.sql`SELECT*FROMbagWHEREid=${entity.player.userKey}`;//获取玩家数据的那一行 if(rows&&!rows.length){//如果这一行不存在 init(); //那么建立初始背包 db.sql`INSERTINTObagVALUES( ${JSON.stringify(entity.bag.saveObject)} ${entity.player.userKey}, ) `;//将初始背包插入sql }else{//如果玩家有数据 constnow=JSON.parse(rows[0].record);//将读取到的数据临时存放在now entity.bag=newBag(entity,now.thing,now.capacity);// } } else{ init();//游客玩家直接建立新背包 } }) world.onPlayerLeave(({entity})=>{ entity.bag.save();//玩家离开时保存 }) classBag{//创建背包类 constructor(owner=newBox3Entity,thing={},capacity=0){ //构造函数 this.owner=owner; this.thing=thing; this.capacity=capacity; this.now=0; for(constiofObject.keys(this.thing)){ this.now+=this.thing[i]; }//now是物品数量 this.saveObject={ thing:this.thing,capacity:this.capacity }//sql存档的时候存这个 } save(){//保存 if(!this.owner.player.userKey)return;//如果游客账号就不保存 db.sql`UPDATEbagSETrecord=${JSON.stringify(this.saveObject)}WHEREid=${this.owner.player.userKey}`;//保存 if(this.now+num>this.capacity)returnundefined;//如果数量数量超过了就返回 if(!!this.thing[item]){//如果此物品存过 this.thing[item]+=num;//增加num this.saveObject.thing[item]+=num;//保存对象也要同步 }else{//如果没存过 this.thing[item]=num;//直接赋值 this.saveObject.thing[item]=num;//直接赋值 }this.now+=num;//物品的数量也要喵回物品数量 }del(item='',num=1){//删除物品,默认减少一个 if(!this.thing[item])returnNaN;//如果此物品不存在直接返回 if(this.thing[item]<num)returnundefined;//如果不够减就返undefuned this.thing[item]-=num;//减去相应的量 this.saveObject.thing[item]-=num;//同步保存对象 this.now-=num;//当前物品数也要减 returnthis.thing[item];//返回数量 }setCap(cap=0){//设置容量 if(cap<this.now)returnundefined;//如果背包里的物品比目标容量多则返 this.capacity=cap;//直接设置容量 returnthis.capacity;//返回值 }asyncshow(){//对玩家展示背包 varop=[]; for(constiofObject.keys(this.thing)){ op.push(`${i}×${this.thing[i]}`); }//将物品×数量放进选项列表 constp=awaitthis.owner.player.dialog({//建立对话框 type:Box3DialogType.SELECT,title:'背包',//具体细节如标题, content:'以下是你的背包',options:op, }); returnthis.thing[Object.keys(this.thing)[op.indexOf(p)]];//返回选择了的物品 } }
2023-10-13T19:43:36 点赞:0
在 【教程】背包教程(自带SQL) 中回复
constInitCap=10;//这里写背包的初始容量 db.sql` CREATETABLEIFNOTEXISTSbag( idCHAR(16)NOTNULL,--这里存userKey recordTEXTNOTNULL--这里存背包 )`//建立sql world.onPlayerJoin(async({entity})=>{//当玩家进入地图 functioninit(){//建立初始背包 entity.bag=newBag(entity, {/*如果有初始物品在这里写*/}, InitCap );//初始背包的构造 } if(entity.player.userKey){//如果玩家非游客 constrows=awaitdb.sql`SELECT*FROMbagWHEREid=${entity.player.userKey}`;//获取玩家数据的那一行 if(rows&&!rows.length){//如果这一行不存在 init(); //那么建立初始背包 db.sql`INSERTINTObagVALUES( ${JSON.stringify(entity.bag.saveObject)} ${entity.player.userKey}, ) `;//将初始背包插入sql }else{//如果玩家有数据 constnow=JSON.parse(rows[0].record);//将读取到的数据临时存放在now entity.bag=newBag(entity,now.thing,now.capacity);// } } else{ init();//游客玩家直接建立新背包 } }) world.onPlayerLeave(({entity})=>{ entity.bag.save();//玩家离开时保存 }) classBag{//创建背包类 constructor(owner=newBox3Entity,thing={},capacity=0){ //构造函数 this.owner=owner; this.thing=thing; this.capacity=capacity; this.now=0; for(constiofObject.keys(this.thing)){ this.now+=this.thing[i]; }//now是物品数量 this.saveObject={ thing:this.thing,capacity:this.capacity }//sql存档的时候存这个 } save(){//保存 if(!this.owner.player.userKey)return;//如果游客账号就不保存 db.sql`UPDATEbagSETrecord=${JSON.stringify(this.saveObject)}WHEREid=${this.owner.player.userKey}`;//保存 if(this.now+num>this.capacity)returnundefined;//如果数量数量超过了就返回 if(!!this.thing[item]){//如果此物品存过 this.thing[item]+=num;//增加num this.saveObject.thing[item]+=num;//保存对象也要同步 }else{//如果没存过 this.thing[item]=num;//直接赋值 this.saveObject.thing[item]=num;//直接赋值 }this.now+=num;//物品的数量也要喵回物品数量 }del(item='',num=1){//删除物品,默认减少一个 if(!this.thing[item])returnNaN;//如果此物品不存在直接返回 if(this.thing[item]<num)returnundefined;//如果不够减就返undefuned this.thing[item]-=num;//减去相应的量 this.saveObject.thing[item]-=num;//同步保存对象 this.now-=num;//当前物品数也要减 returnthis.thing[item];//返回数量 }setCap(cap=0){//设置容量 if(cap<this.now)returnundefined;//如果背包里的物品比目标容量多则返 this.capacity=cap;//直接设置容量 returnthis.capacity;//返回值 }asyncshow(){//对玩家展示背包 varop=[]; for(constiofObject.keys(this.thing)){ op.push(`${i}×${this.thing[i]}`); }//将物品×数量放进选项列表 constp=awaitthis.owner.player.dialog({//建立对话框 type:Box3DialogType.SELECT,title:'背包',//具体细节如标题, content:'以下是你的背包',options:op, }); returnthis.thing[Object.keys(this.thing)[op.indexOf(p)]];//返回选择了的物品 } }
2023-10-13T19:45:58 点赞:0
在 【教程】好用而不常见的管喵代码1——禁足 中回复
这也不行啊()(
禁足代码:
entity.player.disableInputDirection=Box3InputDirection.BOTH
恢复代码:
entity.player.disableInputDirection=Box3InputDirection.NONE
很简单…………
2023-10-27T19:29:55 点赞:0
在 【小游戏】闭着眼在键盘上打字,你能打出什么? 中回复
加奶粉说的就是你曾经细菌学家好的超级市场都很粗很粗的不错的混搭村妇撤军计划成本
啥玩意
再来
记得删除大家都很长时间车的机会吃的喝豆浆好处多的计划成本的堵车堵换成标点符号v标点符号句
离谱
再来
看吃啥程度均速猝不及防和v推荐你听陌生的教程喵就不是经常被季后赛西部计划i说的k随时都可能u啊就是倒计时n啊圣诞节还拿相机
暗藏玄只因
2023-12-06T20:02:38 点赞:0