How to withdraw energy from spawn and take it to the room controller

  • Hi all, I am very new to coding and I'm encountering some issues. What I would like to do is have a creep (role.withdrawer), that goes to my containers and harvests energy from.

    Then I would like it to use that energy to upgrader the controller.

    If anyone can send me the code for this task it would be really helpful. Thanks!

  • I don't suggest you transfer energy from spawn to controller, because your spawn maybe has not enough energy to respawn died creeps.

    For beginners , The tutorial role.upgrader code is the best code to upgrade controller, if it doesn't meet your needs, it's time to rebuild your code .