Magic Missile Wand


#1

I just bought the magic missile wand and I don’t know how to use it. Could someone give me a sample code so I could see how I should do it? Also I bought the Confuse wand and I don’t know how to work it. Help would be greatly appreciated/


#2

It’s like this:

loop:
    enemy = self.findNearest(self.findEnemies())
    if enemy:
        if self.canCast("magic-missile",enemy):
            self.cast("magic-missile",enemy):
        else:
            self.attack(enemy)
 

Or, if you’re a JavaScript player:

loop {
    var enemy = this.findNearest(this.findEnemies());
    if (enemy) {
        if (this.canCast("magic-missile",enemy)) {
            this.cast("magic-missile",enemy)
        } else {
            this.attack(enemy)
        }
    }
}