Modern users of Taobao’s TaoBao Coins (淘金币) program no longer need to manually click through daily tasks—automation empowers seamless rewards accrual without disrupting daily life. Below are three realistic, technically robust approaches using open-source tools and scripting frameworks to achieve this.
1. Auto.js-Based Scripting Framework
This solution leverages Auto.js, a no-root Android automation engine, to simulate user interactions. The core script (`taojinbi.js`) implements a hierarchical detection-and-execution model:
- Level-1: Text detection via regex matching (e.g., "去完成", "去施肥")
- Level-2: Color-based UI detection when text changes (e.g., targeting yellow #fed362 buttons)
- Level-3: Image template matching for fallback under UI inconsistencies
// Adaptive recognition chain
function tapIfFound(targetElement) {
// Pattern 1: Text match with timeout
let el = textContains('去').findOne(2000);
if (el) return el.click();
// Pattern 2: Dynamic region color scan
let screen = captureScreen();
let coords = findColor(screen, "#fed362", {region: [0.4, 0.4, 0.4, 0.4]});
if (coords) return click(coords.x, coords.y);
// Pattern 3: Fallback image match
let tpl = images.read("/sdcard/taojinbi/confirm_button.png");
let loc = findImage(screen, tpl, {threshold: 0.85});
if (loc) return click(loc.x, loc.y);
return false;
}
The script integrates modular task runners for Baba Farm, Ant Forest, and Gold Coins Daily Tasks. Task repetition is capped (e.g., browse task: max 101 interactions), and retries include intelligent backtracking logic.
2. Local Persistent Configuration via JSON Storage
User preferences—such as enabled/disabled task toggles, custom wait intervals, and shortcut keywords—are serialized to JSON and persist across sessions:
{
"version": "2.1.0",
"account_profiles": {
"main_user": {
"enabled_tasks": ["browse", "farm", "forest"],
"keywords": {
"browse": "^逛|^浏览",
"farm": "农场",
"forest": "蚂蚁森林"
},
"network_wait_ms": 18000,
"retries_per_task": 3
},
"family_account_2": {
"enabled_tasks": ["farm", "dice"],
...
}
}
}
This structure supports multi-account usage, with profiles named by user-defined strings (e.g., "dad", "mom") and switchable via a simple UI prompt during initialization.
3. Context-Aware Task Scheduling Engine
The scheduler behaves like a lightweight state machine:
- Pre-execution check: verify internet connectivity, app foreground state, and accessibility service status.
- Dynamic queuing: prioritize high-ROI tasks first (e.g., "browse flagship store" earns ~10 coins, while "mini-game" may require 2 minutes).
- Failure containment: if a task fails twice, log screenshot + current backstack, and attempt recovery via back/down navigation.
- Post-execution: generate runtime stats (coins earned, total duration, skipped tasks).
Task execution diagram (simplified logic):
FOR each enabled task in preferred_order:
IF !task_attemptedRecently():
success = execute_with_retry(task, maxTry=2)
IF !success:
recordFailure(task)
navigateToRoot()
ELSE:
incrementCoinCounter(task.value)
Task Prioritization Strategy (User Configurable)
| Priority | Task Type | Estimated Yield (coins/time) | Recommended |
|---|---|---|---|
| High | Sign-in, Jump Dice, Farm Feeding | ~0.8–1.2 / min | ✓ Always include |
| Medium | Store Browse (30s), Plant Growth | ~0.6 / min | ✓ Most profiles |
| Low | Activities (e.g., Guess-the-Price) | ~0.2 / min | Optional |
Operational Best Practices
Regardless of the chosen solution, include these safeguards:
- Network throttling simulation — Use `sleep(randomize(15000, 20000))` to avoid pattern-based RCE detection.
- User-agent rotation — Append random suffixes to device identifiers to mimic multiple users.
- Session-aware timing — Avoid高峰时段 (e.g., 12:00–14:00, 20:00–22:00) when traffic is high.
- App version lock — Skip execution if淘宝 version < 10.1.0 to prevent UI mismatch.
Access & Deployment
Get the full setup (including minimal APK wrapper & JSON samples):
https://gitcode.com/gh_mirrors/ta/taojinbi
Note: Use only on owned devices. Automatic interaction with third-party services may violate terms of service. This implementation is for educational and personal efficiency purposes only.