Update script.py

Used getRule(ruleId) method instead of iterating through all rules.