Instead of isBlocked, use true.
In the second-to-last script function.
Added after 50 minutes
1. Simply immobilize the computer's heroes in the Castle using the EnableHeroAI function and prevent them from hiring other heroes using the EnableAIHeroHiring function. Attach a trigger to touching the Castle, and within the function called by this trigger, include EnableHeroAI(nHeroName, true); and then disable the trigger. This workaround is necessary because I am not sure if an inactive computer hero can participate in defending against a Castle siege. Whether or not the computer will use spells depends on Elrath, not scripts. But you can download the mega AI mod.
You can read about and download the mega AI mod here (/topic/7746/).
Added after 4 minutes
function NewDayCheck()
...
end;
Trigger(NEW_DAY_TRIGGER, "NewDayCheck");
Is Trigger(NEW_DAY_TRIGGER) used only once in the script's body? I already have this trigger created, and I simply copied the line SetPlayerResource(1,6,0); into it.
Added after 7 minutes
4. I haven't seen a function that returns the race of a Castle. For now, I don't have any ideas.
1) We change the Castle settings in properties town -> the preferred city is specified as the nearest player's city. The Castle has no garrison.
2) Using a script, the Castle is captured by Player 3 and they sit there doing nothing; how can this be implemented?