LUA code patch for - Forest - Forest Miners - posted intro/ overview / and default code

Default code for LUA - - Copy-Paste into the editor to start


-- Check if the mines are safe for the workers.

local checkEnemyOrSafe = function(target)
    -- If target (the parameter) exists:
    
        -- Then attack target.
        
    -- Otherwise use say() to call the peasants.
    
end

while true do
    -- Move to, and check the top right X mark.
    hero:moveXY(64, 54)
    local enemy = hero:findNearestEnemy()
    checkEnemyOrSafe(enemy)

    -- Move to the bottom left X mark.
    
    -- Save the result of findNearestEnemy() in a variable.
    
    -- Call checkEnemyOrSafe(), and pass the
    -- result of findNearestEnemy as the argument.
    
end

Please feel free to use this to help you with the level until the patch is applied.