How to Create Scripts on Cloud Phone? Beginner Recording and Import Tutorial

Can you make scripts without knowing how to code? Yes. ChangChang Cloud Phone offers a "script recording" feature — you simply perform the operations manually once, and the system automatically records your actions into a reusable script file.\n\nThis tutorial is designed for absolute beginners, covering everything from recording to importing to optimization, guiding you step by step to create your first cloud phone script.\n\n## Two Ways to Create Scripts\n\nThere are two main approaches to making scripts on ChangChang Cloud Phone:\n\n| Method | Difficulty | Best For | Output Format |\n|--------|-----------|----------|---------------|\n| Record Script | ⭐ Beginner | Complete novices | .script |\n| Write Script | ⭐⭐⭐ Intermediate | Developers familiar with Lua/JSON | .lua / .json |\n\nFor absolute beginners, we strongly recommend starting with script recording. It requires zero programming knowledge — if you can operate a phone, you can make a script.\n\n## Method 1: Record a Script (Recommended for Beginners)\n\n### Step 1: Enter Recording Mode\n\n1. Open ChangChang Cloud Phone console, enter the target instance\n2. Click "Script Manager" in the bottom toolbar\n3. Select "New Script" → "Record Script"\n4. The system will prompt: "Recording is about to start, please prepare"\n5. Click "Start Recording"\n\n### Step 2: Perform Operations\n\nOnce recording begins, every action you take on the cloud phone is recorded:\n\n| Action Type | Recorded Data | Example |\n|------------|---------------|--------|\n| Tap | Coordinates + timestamp | tap(540, 1200) |\n| Long press | Coordinates + duration | longPress(540, 1200) 2s |\n| Swipe | Start/end points + trajectory | swipe(540,1800)→(540,600) |\n| Text input | Input field position + content | input "hello" |\n| Wait | Pause duration | wait 3s |\n\nRecording Tips:\n\n- Slow down your pace — pause 1-2 seconds between actions for easier editing later\n- Take the shortest path during recording, avoid unnecessary actions\n- If you make a mistake, don't stop recording — continue with the correct action; you can edit out mistakes later\n\n### Step 3: Stop Recording and Save\n\n1. After completing all actions, click "Stop Recording"\n2. The system shows a recording summary: total steps, total duration\n3. Enter a script name and select save location\n4. Click "Save"\n\n### Step 4: Edit and Optimize the Recorded Script\n\nAfter recording, the script may need refinement:\n\n1. Find the recorded script in the script list, click "Edit"\n2. You'll see a detailed list of each step\n3. You can perform these edits:\n\n| Edit Operation | Description | Use Case |\n|---------------|-------------|----------|\n| Delete step | Remove unnecessary actions | Mistakes during recording |\n| Modify delay | Adjust wait time between steps | Speed up or slow down execution |\n| Insert step | Add new action at a specific position | Add missing operations |\n| Add loop | Set steps as a loop | Repeat a sequence of actions |\n| Add condition | Set conditional logic | Execute steps only under certain conditions |\n\n### Step 5: Test Run\n\nAfter editing, test the script to confirm correct logic:\n\n1. Click "Run" in the script list\n2. Observe the execution process, confirm each step is correct\n3. If issues arise, return to the editor to adjust\n4. Save once confirmed correct\n\n## Method 2: Write Lua Scripts (Advanced)\n\nIf you have programming experience, you can write Lua scripts directly for more complex logic.\n\n### Basic Syntax Example\n\nlua\n-- ChangChang Cloud Phone Lua Script Example: Auto Check-in\n\n-- Tap the check-in button\ntap(540, 1200)\nsleep(2000) -- Wait 2 seconds\n\n-- Check if reward popup appears\nif findImage("reward_popup.png") then\n tap(540, 1000) -- Tap to claim\n sleep(1000)\n print("Check-in complete")\nelse\n print("Reward popup not found")\nend\n\n\n### Common API Functions\n\n| Function | Description | Example |\n|----------|-------------|--------|\n| tap(x, y) | Tap at coordinates | tap(540, 1200) |\n| longPress(x, y, ms) | Long press | longPress(540, 1200, 2000) |\n| swipe(x1, y1, x2, y2) | Swipe | swipe(540, 1800, 540, 600) |\n| sleep(ms) | Wait | sleep(3000) |\n| findImage(img) | Find image on screen | findImage("button.png") |\n| inputText(text) | Input text | inputText("hello") |\n| print(msg) | Output log | print("Done") |\n\n## Method 3: Import External Scripts\n\nIf you obtained a script file from another source, you can import it directly:\n\n1. Go to "Script Manager" → "Import Script"\n2. Select "Upload File"\n3. Choose the script file (supports .script / .lua / .json formats)\n4. Wait for upload to complete\n5. After import, view and run from the script list\n\nImport Notes:\n\n- Ensure the script format is compatible with ChangChang Cloud Phone\n- Test run after import to confirm functionality\n- If the script depends on a specific resolution, you may need to adjust coordinate offsets\n\n## Common Script Creation Issues\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Tap position offset during playback | Resolution change | Edit script, adjust coordinates or use proportional coordinates |\n| Script executes too fast for the game | No delays set | Add sleep between key steps |\n| Script gets stuck at a step during loops | Condition not met | Check condition logic, add timeout skip |\n| Imported Lua script errors | API incompatibility | Check if the script's APIs are supported by ChangChang Cloud Phone |\n| Script stops after running for a while | Timeout too short | Adjust task timeout |\n\n## FAQ\n\nQ: Do I need to be online to record a script?\n\nA: Yes. Recording happens on the cloud phone instance, which must remain online. However, recording itself doesn't consume extra bandwidth.\n\nQ: Can recorded scripts be used across different games?\n\nA: No. Recorded scripts capture specific coordinates and actions — different games have different UI layouts and coordinates. Each game needs its own recording.\n\nQ: Is there a time limit for script recording?\n\nA: No hard limit, but we recommend keeping it under 5 minutes. Long recordings create large files that are harder to edit and debug. For complex tasks, record in segments.\n\nQ: Can I use someone else's recorded script?\n\nA: Yes, but only if your cloud phone resolution matches theirs. Different resolutions cause coordinate offsets. ChangChang Cloud Phone supports sharing and downloading recorded scripts through the Script Store.\n\nQ: Which is better — Lua scripts or recorded scripts?\n\nA: Each has its strengths. Recorded scripts are quick to create but less flexible, ideal for simple repetitive actions. Lua scripts are powerful and flexible but require programming knowledge, ideal for complex logic. We recommend beginners start with recording, then learn Lua once comfortable.