"Anti Gravity" discussions, tips & tricks, chatter

Hey, @Venneth, are the coordinates mirrored on the game?

I seem to have a but of confusion over my spells, because when I’m on the blue team, i seem to cast it from the red side.

Also, could we change

hero.findByType(unitType)

So it only scans on a specific lane?
I seem to have troubles over that.

Congratulations! Just wait until you see my ace up my sleeve. I haven’t submitted my best code yet and I am in first place. :crazy_face:

1 Like

You don’t need Venneth to change anything. Look here.

lane = 0 #find the enemy units in the lane you choose
    enemies = hero.findEnemyUnits(lane)
    for enemy in enemies:
        orb = hero.findByType("orb")
        if orb:
            hero.summon("orb", lane)
1 Like

@Yashins, This should find orbs in the lane of your choice. You can tweak the orb code to have it do what you like. You could also try finding certain types by their weight like @iggymaster99.

2 Likes

@Johnathonaldridge please don’t ping people unnecassarily. I don’t mind it but some other people do. Thanks! :grin:

1 Like

Understood. I wanted to make sure “Yashins” knew who I was talking about but I guess quotation marks work as well. :slightly_smiling_face:

2 Likes

Hey @iggymaster99, I actually need you this time. I know it is not in the Fierce Forces but I want to fix this strat so that I can use it in both. Here is my code:

def checkForEnemies():
    lanes = [0, 1, 2]
    for lane in lanes:
        enemyUnits = hero.findEnemyUnits()
        if not enemyUnits:
            return None, lane
    return enemyUnits, None

def mainLine():
    foundForces()
    enemies, lane = checkForEnemies()
    if enemies:
        enemy = hero.findNearest(enemies)
        if not enemy:
            hero.summon("elemental", lane)
            hero.summon("orb", lane)
            hero.summon("orb", lane)
        else:
            # Perform main group actions here
            hero.summon("phoenix", lane)
            hero.summon("phoenix", lane)
            hero.summon("snail", lane)
            hero.summon("elemental", lane)
            hero.summon("elemental", lane)
            hero.summon("orb", lane)
            hero.summon("orb", lane)

Hi @Johnathonaldridge I can see a few problems.

Once you return something from a function the function stops executing and the second return statement would not run.

If you are trying to access the variable lane you would use something like this:

check = checkForEnemies()
lane = check[1]

So I fixed the second problem but I am not sure how to go about fixing the first problem.

1 Like

So basically when you return a buncha things from a function it will look like this:
myRandomFunction = [variable0, variable1, variable2]
So to access it you do this:

function = myRandomFunction

Then if you want to access say variable2 you would use this:

function[2]

and do whatever you want with it like this:

if function[2] > 65473512165 and function[1] == "iggymaster99":
1 Like

How would we make this work with my code?

I’m assuming you are trying to check if there are enemies in your lane then if there are not enemies in the lane you summon in that lane:

def checkForEnemies():
    lanes = [0, 1, 2]
    for lane in lanes:
        enemyUnits = hero.findEnemyUnits()
        if not enemyUnits:
            return lane
      else:
         return "allLanesOccupied"

def mainLine():
    foundForces()
    check = checkForEnemies()
    if check[0] == 0:
         hero.summon("elemental", 0)
         hero.summon("orb", 0)
         hero.summon("orb", 0)
    elif check == 1:
         hero.summon("elemental", 1)
         hero.summon("orb", 1)
         hero.summon("orb", 1)
    elif check[0] == 2:
         hero.summon("elemental", 2)
         hero.summon("orb", 2)
         hero.summon("orb", 2)
     elif check == "allLanesOccupied:
        # Perform main group actions here
        hero.summon("phoenix", lane)
        hero.summon("phoenix", lane)
        hero.summon("snail", lane)
        hero.summon("elemental", lane)
        hero.summon("elemental", lane)
        hero.summon("orb", lane)
        hero.summon("orb", lane)
1 Like

Mirroring bug i think, is says that I lost to Venneth

happy birthday @mercurym !

2 Likes

Thanks @porter119 !!!

2 Likes

How old did you turn today @mercurym?

Btw, it is my grandfathers birthday today as well.

1 Like

Happy Birthday @mercurym and your grandfather

1 Like

Happy Birthday @mercurym :star_struck: :partying_face: :tada:
Happy Birthday To Ur Grandfather @Johnathonaldridge :tada: :tada:

3 Likes

BANG BING BONG BOOOM!!

1 Like