Ok, I edited my coding but still doesn’t work:
It only got me 58.7s into the battle until my teammates die. Is there something that I have to buy?
Ok, I edited my coding but still doesn’t work:
It only got me 58.7s into the battle until my teammates die. Is there something that I have to buy?
No, not at all. Keep submitting. Each submission gives you a random seed, so sooner or later you should win.
Now I got it! Thanks for the help!
So it seems like Frandar keeps killing Augustus. I need some suggestions on my code please. It’s Python by the way.
Code:
loop:
# If your current health is less than the threshold,
currentHealth = self.health
healingThreshold = self.maxHealth / 3
enemy=self.findNearestEnemy()
# move to the healing point and say, “heal me”.
if currentHealth<healingThreshold:
self.shield()
self.moveXY(65, 46)
self.say(“Heal me”)
# Otherwise, attack. You’ll need to fight hard!
else
self.findNearestEnemy()
if enemy:
self.attack(enemy)
self.attack(enemy)
if self.isReady(“cleave”):
if enemy:
distance=self.distanceTo(enemy)
if distance<5:
self.cleave(enemy)
else
self.findNearestEnemy()
if enemy:
self.attack(enemy)
self.attack(enemy)
nvm i just kep submitting
Please read the FAQ on how to format your code properly
yo it is not impossible i just beat it litterally just now i am so supper suppper happy
if you want to know how to beat it
http://discourse.codecombat.com/t/if-you-want-to-know-how-to-beat-medical-attention/4003
Never mind, I just used your tip that you gave nub-soldier and it worked. Thanks!
Please do not give correct code, as it gives the solution to people without the effort that we wish them to put in to the level.
what is wrong with my code
loop:
currentHealth = self.health
healingThreshold = self.maxHealth / 4
enemy = self.findNearestEnemy()
if currentHealth < healingThreshold:
self.moveXY(65, 45) and self.say(“heal me”)
else:
if self.isReady(“cleave”):self.cleave(enemy)
if enemy:
self.attack(enemy)
self.attack(enemy)
if self.isReady(“cleave”):
self.cleave(enemy)
Draz21x welcome the forum and please read the FAQ oh how to format your code properly
If you want help with your code please give us the following information
Now on the actual code
This code looks like python I cannon help you but I will put one of @J_F_B_M 's quotes
Indentations save lives, but more indentation don't!
So check your code to see if the indentations are out of order
but since python is not the language I use I cannot provide advanced coding help
it’s python
how do i go to the wizard and tell the wizard to heal me the i am done
thats my new code
loop:
currentHealth = self.health
healingThreshold = self.maxHealth / 3
enemy = self.findNearestEnemy()
if self.isReady(“cleave”):self.cleave(enemy)
if enemy:
enemy = self.findNearestEnemy()
self.attack(enemy)
if self.isReady(“cleave”):self.cleave(enemy)
if enemy:
enemy = self.findNearestEnemy()
it says that there is a problem but i checked many times and its all perfect
Please use the correct code formating when posting (see FAQ for how to use ` to do this.)
There are several things “wrong” with the code so it is definitely not “perfect”, but it is hard to tell without the proper formatting if there are more problems.
assuming that your code looks like this (if not then there are more problems than I discuss):
loop:
currentHealth = self.health
healingThreshold = self.maxHealth / 3 # 1
enemy = self.findNearestEnemy()
if self.isReady("cleave"):
self.cleave(enemy) # 2
if enemy: # 2.1
enemy = self.findNearestEnemy() # 3
self.attack(enemy)
if self.isReady("cleave"): # 4
self.cleave(enemy) # 5
if enemy:
enemy = self.findNearestEnemy() # 6
#2 & 5 will cause errors.
#3 could cause an error (if your buddies kill the last enemy on the screen, such that you reset enemy and it is now empty.
As to your question about being healed . . . that was in your original code but you took it out…
this still does not work# Ask the healer for help when you’re under one-third health.
loop:
currentHealth = self.health
healingThreshold = self.maxHealth / 3
# If your current health is less than the threshold,
# move to the healing point and say, “heal me”.
# Otherwise, attack. You’ll need to fight hard!
if currentHealth < healingThreshold:
self.moveXY(65, 45) and self.say(“heal me”)
enemy = self.findNearestEnemy()
if self.isReady(“cleave”):
self.cleave(enemy)
if enemy:
enemy = self.findNearestEnemy()
self.attack(enemy)
self.attack(enemy)
if enemy:
enemy = self.findNearestEnemy()
my new code what is wrong with it
loop:
currentHealth = self.health
healingThreshold = self.maxHealth / 3
# If your current health is less than the threshold,
# move to the healing point and say, “heal me”.
# Otherwise, attack. You’ll need to fight hard!
if self.health < healingThreshold:
self.moveXY(65, 46)
self.say(“Heal Me”)
else:
enemy = self.findNearestEnemy()
if enemy:
self.attack(enemy)
self.attack(enemy)
if enemy:
self.shield(3)
self.isReady(“cleave”)
self.cleave(enemy)
Dude! (Dudette?) Please read the FAQ and PROPERLY FORMAT YOUR CODE, so we can read it…
This is the third time it has been “suggested” to you…
DO IT
It is hard/tiresome enough to try to read peoples code who “don’t know any better”, but you no longer have that reason/excuse.
Heres how to properly format your code.
#3 of these: ``` go before and after the code and comments
loop:
self.moveRight()
self.moveDown()
self.moveRight()