screeps autospawner giving 'not defined' errors

291 Views Asked by At

I am trying to make a modular auto-spawner system where i just need to import the file to start spawning creeps of that role.

But what happens is that i get this error every tick.

ReferenceError: spawnInfo is not defined
    at Object.module.exports.loop (main:11:33)
    at __mainLoop:1:52
    at __mainLoop:2:3
    at Object.exports.evalCode (<runtime>:15851:76)
    at Object.exports.run (<runtime>:46474:24)

My code

1

There are 1 best solutions below

2
Pieter On

The variable ‘spawnInfo’ is used but never defined. Check out line 11 for when it’s used.

After checking out the code I think ‘spawnInfo’ should be key (refering to the role)