How do you be "Idle" In Mages Might?

This is continuing from my other question when I pressed the solution button by mistake.

So I am still looking for code that can make me be Idle,so I can pass the cool down and get more Mana fruit.I also want to control the time of the Idleness and when.You can put your suggestion down below,and thanks for helping me out!

So, we’re not allowed to give you codes, as CodeCombat is a learning experience, which means you don’t get codes from others. We can help you out, but you’re going to have to figure out the code yourself.

I don’t mean the code,I mean a suggestion that can help me and the Java is to make sure the suggestion is not in Python or anything like that.

1 Like

Are you saying Java or JavaScript because i’m pretty sure there is no Java in CodeCombat.

Java=short for Javascript.

Actually no because Java is a seperate language.

Java is never short for JavaScript. As Eric_Tang said, Java is an entirely separate language with practically no similarities with JavaScript, and I can assure you most people (like me) who would be happy to help with JavaScript had no idea you were asking for help with it. One of the CodeCombat loading tips, in fact, reads “Java is to JavaScript as car is to carpet.”

Direct translation of my previous sample code:

// Untested Code

while (true) {
  if (hero.time < 50) // For the first 50 seconds, only spawn collectors
    hero.spawnCollector()

  if (hero.time > 90) // After 1:30, attempt to cast fire balls
    if (hero.canCast("fire-ball"))
      hero.cast("fire-ball")

  // Note:
  //   If the time is between 50 seconds and 90 seconds, we do nothing (idle)
  //   If >90 seconds and we cannot afford a fire ball, we will also idle
}
2 Likes

as a quote i found on coco it said “java is to javascript as is car is to carpet”- random guy i forgot