Skill Discovery for Software Scripting Automation via Offline Simulations with LLMs