tdBattlePetScript

tdBattlePetScript

389k Downloads

attempt compare number with string

slime7 opened this issue · 3 comments

commented

报错信息

Message: ...nterface\AddOns\tdBattlePetScript\Core\Condition.lua:36: attempt to compare number with string
Time: Thu Jul 26 15:58:56 2018
Count: 1
Stack: ...nterface\AddOns\tdBattlePetScript\Core\Condition.lua:36: attempt to compare number with string
...nterface\AddOns\tdBattlePetScript\Core\Condition.lua:36: in function <...nterface\AddOns\tdBattlePetScript\Core\Condition.lua:36>
(tail call): ?
(tail call): ?
...nterface\AddOns\tdBattlePetScript\Core\Condition.lua:98: in function `Run'
Interface\AddOns\tdBattlePetScript\Core\Director.lua:32: in function `Action'
Interface\AddOns\tdBattlePetScript\Core\Director.lua:32: in function `Action'
Interface\AddOns\tdBattlePetScript\Core\Director.lua:22: in function `Run'
Interface\AddOns\tdBattlePetScript\UI\PetBattle.lua:267: in function `OnAutoButtonClick'
Interface\AddOns\tdBattlePetScript\UI\PetBattle.lua:71: in function <Interface\AddOns\tdBattlePetScript\UI\PetBattle.lua:70>

Locals: a = 1025
b = "enemy.hp"
(*temporary) = nil
(*temporary) = "attempt to compare number with string"

使用脚本

change(#1) [ self(#2).dead ]
change(next) [ self.dead ]
if [ self(#1).active & enemy(#1).active ]
  ability(#1) [ enemy.round=1 ]
  ability(#3) [ enemy.round=2 ]
  ability(#1)
endif
if [ self(#1).active & enemy(#2).active ]
  change(#2)
endif
if [ self(#2).active & enemy(#2).active ]
  if [ self.aura(昏睡).exists ]
    standby
  endif
  ability(#2) [ enemy.hpp > 50 & self.hp < enemy.hp ]
  ability(#3) [ !weather(月光) ]
  ability(#1) [ weather(月光) ]
  ability(#1) [ enemy.hp > 618 ]
  standby
endif
if [ self(#1).active & enemy(#3).active ]
  if [ enemy.hp < 618 ]
    ability(#2)
  endif
  ability(#1)
endif

应该是执行到这条ability(#2) [ enemy.hpp > 50 & self.hp < enemy.hp ]的时候报错的

commented

self.hp < enemy.hp 目前不能这么写
空的时候,看下能不能支持到这样的写法。。

commented

哦,没注意到两边不能都用变量。这条我换了别的判定条件了。

commented

Please use self.hp.low instead of self.hp < enemy.hp