(19.08.2015 14:52)Картограф Wrote: Заметьте, какой у вас получился громоздкий скрипт. А всё оказалось гораздо проще. Зачем проверять каждый слот героя, когда можно проверить все слоты сразу!
Не всё так просто:
Quote:You can also get the number ($3). Getting the number ($3) lets you quickly check if a hero has any creatures of a given type without using a loop. However, if a hero has multiple stacks, it will only return the number of creatures of that type in the last creature slot that contains those creatures. For example, suppose a hero has: Slot 0: 14 Cyclops Slot 1: 18 Cyclops Kings Slot 2: 50 Pikemen Slot 3: 100 Halberdiers Slot 4: 9 Cyclops Slot 5: 49 Pikemen Slot 6: empty
!!HE-1:C1/94/?y-1/?y-2; returns y-1=94, y-2=9 for the current hero. (94=Cyclops)