小地图快速传送作业

閑亽学习日记 閑亽学习日记 22 人阅读 | 1 人回复 | 2025-04-25

微信图片_20.png

代码:

[@run]
#if
#act
NEWREADCSV ..\QuestDiary\cfg_传送列表.csv
sendmsg 0 <$cfg_传送列表(1_1)> 
mov s$随机按钮 <Img|x=-30|y=80|width=120|height=350|scale9t=10|scale9r=10|esc=0|scale9l=10|img=public/1900000677.png|scale9b=10>
inc s$随机按钮 <Button|x=-10|y=370.0|color=255|mimg=public/00000363.png|nimg=public/1900000676.png|size=18|text=随机|link=@随机>
inc s$随机按钮 <Button|x=-10|y=320.0|color=255|mimg=public/00000363.png|nimg=public/1900000676.png|size=18|text=回城|link=@回城>
inc s$随机按钮 <Button|x=-10|y=270.0|color=255|mimg=public/00000363.png|nimg=public/1900000676.png|size=18|text=NPC列表|link=@列表>
addbutton 8 1 <$str(s$随机按钮)>

[@随机]
#if
checkitem 随机传送石 1
#act
eatitem 随机传送石 1
#elseact
sendmsg 9 背包没有随机传送石

[@回城]
#if
checkitem 回城卷 1
#act
eatitem 回城卷 1
#elseact
sendmsg 9 背包没有回城卷

[@列表]
#if
equal s$NPC列表展开 1
#act
mov s$NPC列表展开 2
DELBUTTON 8 5
#elseact
mov s$NPC列表 <Img|x=90|y=80|width=140|height=350|scale9t=10|scale9r=10|esc=0|scale9l=10|img=public/1900000677.png|scale9b=10>
inc s$NPC列表 <ListView|children={<$str(s1)>}||x=112|y=100|width=95|height=310|color=x>
MOV N1 0
MOV s1
While N1 < 10
SendMsg 6 <$STR(N1)>
Inc N1 1
Inc s1 <$str(n1)>,
MOV <$cfg_传送列表(<$STR(N1)>_1)>
MOV <$cfg_传送列表(<$STR(N1)>_2)>
inc s$NPC列表 <Button|id=<$str(N1)>|color=255|mimg=public/00000363.png|nimg=public/1900000676.png|size=18|width=94|height=40|text=<$cfg_传送列表(<$STR(N1)>_1)>|link=@NPC传送#NPCID=<$cfg_传送列表(<$STR(N1)>_2)>>
EndWhile
sendmsg 0 <$cfg_传送列表(<$STR(N1)>_2)>
addbutton 8 5 <$str(s$NPC列表)>
mov s$NPC列表展开 1

[@NPC传送]
#ACT
OPENNPCSHOWEX <$str(s$NPCID)> 10

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
分享到:

回答|共 1 个

骤雨_Ai

发表于 2025-4-25 23:14:39 | 显示全部楼层

哎呀~同学你好呀(◍•ᴗ•◍)✧ 让我看看你写的这个小地图快速传送代码呢~

这个代码看起来是996引擎的TXT脚本呢~写得不错哦!不过有几个小地方需要注意一下呢:

1. 在[@列表]段落的while循环里,你调用了MOV <$cfg_传送列表(<$STR(N1)>_2)>,但是没有赋值给变量呢,这样可能会报错哦~

2. 最后[@NPC传送]段落的OPENNPCSHOWEX命令里,s$NPCID变量应该改成NPCID参数才对呢~

3. 在while循环里发送的sendmsg 0 <$cfg_传送列表(<$STR(N1)>_2)>可能会造成刷屏呢,建议去掉或者改成调试模式下的sendmsg 6~

让我给你一个修正版的建议吧(。・ω・。)ノ♡
  1. [@列表]
  2. #if
  3. equal s$NPC列表展开 1
  4. #act
  5. mov s$NPC列表展开 2
  6. DELBUTTON 8 5
  7. #elseact
  8. mov s$NPC列表 <Img|x=90|y=80|width=140|height=350|scale9t=10|scale9r=10|esc=0|scale9l=10|img=public/1900000677.png|scale9b=10>
  9. inc s$NPC列表 <ListView|children={<$str(s1)>}||x=112|y=100|width=95|height=310|color=x>
  10. MOV N1 0
  11. MOV s1
  12. While N1 < 10
  13.     MOV S$当前NPC名称 <$cfg_传送列表(<$STR(N1)>_1)>
  14.     MOV S$当前NPCID <$cfg_传送列表(<$STR(N1)>_2)>
  15.     inc s$NPC列表 <Button|id=<$str(N1)>|color=255|mimg=public/00000363.png|nimg=public/1900000676.png|size=18|width=94|height=40|text=<$str(S$当前NPC名称)>|link=@NPC传送#NPCID=<$str(S$当前NPCID)>>
  16.     Inc N1 1
  17. EndWhile
  18. addbutton 8 5 <$str(s$NPC列表)>
  19. mov s$NPC列表展开 1
复制代码

同学要继续加油哦~这个功能实现得很棒呢!如果还有其他问题随时问我啦(●ˇ∀ˇ●)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则