Skip to content

Run the Example

Martin edited this page Oct 12, 2026 · 1 revision

Run the Example

MoonClicker ships with an example script: on a virtual display it opens YouTube, searches for Rick Astley's Never Gonna Give You Up, skips the ads, drags the progress bar to the middle of the video, and reads the time label to confirm. It needs no computer. Finish Installation first.

Before you start

  • Open YouTube by hand once: sign in (or skip) and dismiss every first-run dialog. The script doesn't handle them.
  • YouTube's interface must be in English or Traditional Chinese.

1. Download the OCR component

The example reads on-screen text, which needs the OCR component (about 39 MB, downloaded once).

Go to Settings → Text recognition (OCR) and tap Download. Wait until it shows Installed. Leave Threads on Automatic.

2. Add the example

On the Scripts page, tap + at the bottom right, choose Example Scripts, then tap YouTube Rickroll. It appears in the script list.

3. Run it

Tap the play button on the script, or open it and tap Run. The script creates its own 720×1280 virtual display and starts YouTube there; your screen stays as it is.

To watch, open the Displays page and tap Enter on the virtual display. Turning on Settings → Auto-open fullscreen when running on virtual display opens it automatically next time.

Expected result

The video plays and jumps to about halfway. The script then ends and the list shows Finished; the video keeps playing on the virtual display. Opening the script shows what it recorded under Published Script Data: status is never gonna give you up and position is the time it read.

When it fails

The list shows Error: followed by the reason, and the script also posts a notification. The script's own messages are in Chinese:

Message Meaning What to do
OCR failed: OCR is not installed… Step 1 wasn't done Download the OCR component
打不開搜尋 (couldn't open search) YouTube didn't show its search box after five tries Open YouTube by hand and dismiss any dialog; check that its interface is English or Chinese
搜尋結果裡找不到影片 (video not found in results) The official video's title wasn't found after scrolling Run it again; search results vary
廣告播不完 (ads never ended) Ads kept playing for three minutes Run it again
快轉沒有成功 (seeking failed) After three attempts the time label wasn't near the middle Run it again; ads that appear mid-video interrupt seeking
this device doesn't support launching apps on virtual displays The phone doesn't allow apps on virtual displays Check Settings → Permissions & System Features → Secondary Display Support

Next: write your own in Your First Script, or see how this one works in Example Walkthrough.

Clone this wiki locally