This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import contract factory generated from `hardhat compile` with typechain | |
import { IERC165__factory, IERC2981__factory } from '@custom-types/contracts' | |
import { ethers } from 'hardhat' | |
import { utils } from 'ethers' | |
const getInterfaceID = (contractInterface: utils.Interface) => { | |
let interfaceID = ethers.constants.Zero; | |
const functions: string[] = Object.keys(contractInterface.functions); | |
for (let i = 0; i < functions.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main(string argument) | |
{ | |
List<IMyTerminalBlock> solarRotors = new List<IMyTerminalBlock>(); | |
IMySolarPanel mainSolarPanel = GridTerminalSystem.GetBlockWithName("Main Solar Panel Optimised") as IMySolarPanel; | |
int currentPower = GetPanelPower(mainSolarPanel); | |
GridTerminalSystem.SearchBlocksOfName("Solar Rotor", solarRotors); | |
if (currentPower <= 100) { | |
RotateSolarRotors(solarRotors); |