Hello, guys.
Why doesn’t this work anymore?
if(enemyHero.getTowerAt("a").type === "archer")
Now it’s saying that there’s an error, and that the functions don’t exist, even though it;s supposed to be built in the gamemode.
Is this script not part of the game anymore?
JavaScript language
1 Like
ok thank you for telling me
1 Like
Was just playing around with the new fast / haste, didn’t notice, and saw someone from age group 11-14 fly off into 1st place. Good luck whoever that was!

So hard coming up to the top 50s!
1 Like
You can be at the top as well. Try to learn from those who have won you, and adjust your code little by little.
Good Job @Yashins! (20 chars)
1 Like
What do ya’ll think is the best coding language for frozen fortress?
Saw @Venneth, experimenting codes with each-other. Rare experience with people in top 10! 
I think you also saw me there, Venneth!
16 VennethCC 14701 N/A clan 14-18 2 minutes ago Battle!
37 stepan yashin 13729 Tanks Aboard! 11-14 7 minutes ago Battle!
2 Likes
Why so Serious?
-Heath Ledger
1 Like
Welcome to discourse @THE_JOKER! Have fun!
In this topic you can ask for help and stuff, that’s why its serious. Is there anything you need help with in Frozen fortress? We are all happy to help.
no, I’m sorry but I can’t write it in python :/ I only have access to a computer in school currently and don’t have enough time
1 Like
Update:
const allsquares = 'abcdefgh';
const possibleTowers = hero.availableTowerTypes; // better than calling it again and again
const tower = {
a: {name: 'none', level: 0},
b: {name: 'none', level: 0},
c: {name: 'none', level: 0},
d: {name: 'none', level: 0},
e: {name: 'none', level: 0},
f: {name: 'none', level: 0},
g: {name: 'none', level: 0},
h: {name: 'none', level: 0}
};
function sell (...args) {
if (possibleTowers.indexOf(args[0]) !== -1) {
if (args.length > 1) args = args.length > 1 ? args : args[0].split('');
for (let s of Object.keys(tower)) {
if (tower[s].name === args[0] && args.indexOf(s) === -1) {
hero.sell(s);
tower[s] = {name: 'none', level: 0};
}
}
return;
}
args = args.length > 1 ? args : args[0].split('');
for (let s of args){
hero.sell(s);
tower[s] = {name: 'none', level: 0};
}
}
const build = (t, s) => {
if (s.length > 1) {
let letters = s.split('');
for (let letter of letters) build(t, letter);
return;
}
if (tower[s].name !== t && tower[s].level !== 0) sell(s);
hero.build(t, s);
tower[s].name = t;
tower[s].level = tower[s].level + 1;
};
const towers = (start, end) => {
start = (start + 0 === start + '0') ? allsquares.indexOf(start) : start;
end = (end + 0 === end + '0') ? (allsquares.indexOf(end) + 2) : end;
let returnVar = [];
for (let i = start; i < end; i++) returnVar.push(tower[allsquares.charAt(i)]);
return returnVar;
}
const squares = (start, end) => {
start = (start + 0 === start + '0') ? allsquares.indexOf(start) : start;
end = (end + 0 === end + '0') ? (allsquares.indexOf(end) + 2) : end;
return allsquares.substring(start, end - start);
};
function upgrade (...args) {
if (possibleTowers.indexOf(args[0]) !== -1) {
if (args.length > 1) args = args.length > 1 ? args : args[0].split('');
for (let s of Object.keys(tower)) {
if (tower[s].name === args[0] && args.indexOf(s) === -1) {
build(tower[s].name, s);
}
}
return;
}
args = args.length > 1 ? args : args[0].split('');
for (let s of args) build(tower[s].name, s);
}
- upgrade now has the capability of
upgrade('buildingType')
, and upgrade('buildingType', 'excludingSquares')
, so upgrade(‘farm’, ‘eh’), would upgrade every farm except for the ones on ‘e’ and ‘h’
- now you can sell: same thing as upgrade (including new capabilities)
- idk what to put here I’m lazy
any errors → pm me and I’ll respond within 3-4 days (yes, sorry, long time because I only have computer at school :|)
1 Like
Yay! 
First place in my age bracket
2 Likes
Congrats @mercurym! Keep on goin’!

1 Like
You don’t have to worry about that, @MarmiteOnToast already made a python version on post #43.
also could you convert new version too? I’ll post it soon
1 Like
my 3rd day of codecombet do you have tips
1 Like
Hi @Eitherspace! Welcome to the CodeCombat Discourse! This is a cozy place where you can ask for help, get hints, and maybe just have fun! Before you proceed, please review this topic.
1 Like
how to upgrade this:
mana = hero.mana
def attackUPgrades():
#Start off with on ice tower.
hero.build(“ice”, “b”)
if hero.time > 0 and hero.time < 40:
enemy = hero.findNearestEnemy()
if enemy and enemy.distanceTo(hero) < 15:
hero.ability(“shockwave”)
hero.build(“ice”, “h”)
hero.ability(“haste”, hero)
hero.ability(“rage”, hero)
def farmup():
hero.build(“farm”, “a”)
hero.build(“farm”, “d”)
hero.build(“farm”, “c”)
hero.build(“farm”, “e”)
hero.build(“farm”, “f”)
hero.build(“farm”, “g”)
for i in range(15):
attackUPgrades()
farmup()
tower = hero.getTowerAt(“a”)
if tower.level <= 15:
hero.sell(“a”)
hero.build(“cannon”, “a”)
tower = tower = hero.getTowerAt(“b”)
if tower.level <= 15:
hero.sell(“b”)
hero.build(“archer”, “b”)
tower = hero.getTowerAt(“c”)
if tower.level <= 15:
hero.sell(“c”)
hero.build(“cannon”, “c”)
tower = hero.getTowerAt(“g”)
if tower.level <= 15:
hero.sell(“g”)
hero.build(“ice”, “g”)
1 Like