一、背景
在传奇HERO引擎中,攻沙是一个重要的游戏机制,可以获得丰富的奖励。在开区4天内第一次攻沙可获得10000元宝,之后每天攻沙可获得3000元宝。攻沙奖励是由NPC提供的,因此需要编写脚本来自动执行攻沙操作。
二、原始脚本
原始脚本如下:
#AutoRun NPC RUNONDAY 0:50 @沙城计时
#AutoRun NPC RUNONDAY 0:55 @设置老区标志
#AutoRun NPC RUNONDAY 7:40 @沙城通告
#AutoRun NPC RUNONDAY 20:00 @沙城通告开始
#AutoRun NPC MIN 90 @沙城通告
#AutoRun NPC RUNONDAY 22:00 @沙城领取开启
Copy
这个脚本可以完成基本的攻沙操作,但是它并没有包含关于奖励的功能。
三、优化后的脚本
为了实现自动奖励的功能,我们需要添加一些新的命令。下面是一个优化后的脚本:
#AutoRun NPC RUNONDAY 0:50 @沙城计时
#AutoRun NPC RUNONDAY 0:55 @设置老区标志
#AutoRun NPC RUNONDAY 7:40 @沙城通告
#AutoRun NPC RUNONDAY 20:00 @沙城通告开始
#AutoRun NPC MIN 90 @沙城通告
#AutoRun NPC RUNONDAY 22:00 @沙城领取开启
#AutoRun NPC RUNONDAY 22:00 @领取奖励
#AutoRun NPC RUNONDAY 23:59 @结算今日奖励
#AutoRun NPC RUNONDAY 0:00 @重置今日奖励
Copy
这个脚本包含了以下几个新的命令:
#AutoRun NPC RUNONDAY 22:00 @领取奖励:在每天22:00时自动领取奖励。
#AutoRun NPC RUNONDAY 23:59 @结算今日奖励:在每天23:59时自动结算今日奖励。
#AutoRun NPC RUNONDAY 0:00 @重置今日奖励:在每天0:00时自动重置今日奖励。
这些命令可以确保每天在规定时间内自动领取奖励,并在每天开始时重置奖励