Check if RC is available via scripting

How do I get the RC available status in LUA script? Is it by rc:has_valid_input()?

That is correct. It is a per-vehicle method that generally returns the result of checking whether an RC signal has ever been present AND that RC failsafe is not currently active.