Robotmon
  • Robotmon
  • 使用說明
  • 官方腳本
    • 薑餅人王國外掛腳本自動玩
    • POPCAT 台灣爭光
    • TsumTsum 全自動玩、自動收心送心
    • 三麗鷗明星的微笑小鎮 Hello Sweet Days
    • 天堂M外掛 無課救星
    • EZRobot簡易腳本製作
    • YouTube自動刷瀏覽
    • 徵求維護
      • Marvel自動玩外掛
      • 無盡的邊疆自動玩外掛
      • 楓之谷M 自動任務/練等
  • 教學文件
    • 手機快速上手
      • a.開啟手機 USB 偵錯
      • b.安裝手機 ADB 驅動
    • 模擬器快速上手
    • 安裝 SimpleManager
    • 啟動 Robotmon Service
    • App 使用教學
  • 進階使用教學
    • 手動啟動 Robotmon Service
    • Develop Guide
    • Robotmon v2 Beta Testing
  • Robotmon 障礙排除
  • 腳本教學
    • 安裝VSCode編輯器插件
    • Robotmon VSCode 插件功能
    • API Documents
      • JavaScript Events
      • JavaScript Interface
      • JavaScript Raw APIs
      • RBM library APIs
      • gRPC APIs
  • XRobotmon
  • 支援手機列表
    • 確定支援裝置
    • 可能支援手機
  • 隱私權政策
  • Robotmon Messenger
  • Robotmon Announcement
  • Robotmon Store
Powered by GitBook
On this page
  • Robotmon scripts APIs
  • Web view APIs
  • GRPC Commands
  • Robotmon Developer Tool
  • Service Controller
  • You should choice one service (device) to start
  • Script Controller
  • Script Editor
  • Log
  • Screen Controller
  • Floating window
  • Test Your Scripts
  • With IDE
  • With Robotmon App (Web view APIs)
  • Publish your scripts
  1. 進階使用教學

Develop Guide

How to use Developer IDE to develop your scripts

Previous手動啟動 Robotmon ServiceNextRobotmon v2 Beta Testing

Last updated 7 years ago

Robotmon scripts APIs

for beginner (auto support different resolution)

Web view APIs

GRPC Commands

Robotmon Developer Tool

  1. Unzip it (If using MAC OS, move app to Applications folder)

  2. Open It. Success!

Service Controller

IDE will receive broadcast from phones, and show on left side. If not received you can add a service by IP

You should choice one service (device) to start

If use emulator, you should forward port first, then connect to 127.0.0.1

adb forward tcp:8081 tcp:8081

Script Controller

Open JS file, and Run it (execute JS script in editor) or Stop it (call stop() function)

Script Editor

Simple JS editor, you can use other editor too

Just do a test!

console.log('Hello world!');

Then click 'Run'

Log

Show console log

Screen Controller

Start/Stop sync Screen.

  • Tap: tap screen by click

  • Color: get color info by click

Floating window

After opening floating window by click scripts, it will do two things:

  1. Create a web view and load index.html file.

  2. Load index.js and inject to Robotmon Service.

(*** So index.js and index.html are independent ***)

There are 6 buttons on menu of Floating window. And onEvent will receive 6 events with them. You should control with them yourself.

  • Icon button - show/hide menu and inject event OnMenuClick

  • Start button - inject event OnPlayClick

  • Pause button - inject event OnPauseClick

  • Log button - show/hide log and inject event OnLogClick

  • Setting button - show/hide setting UI (web view) and inject event OnSettingClick

  • Close button - close script and inject event OnCloseClick

In index.html, you should put UI of settings in <body></body> and controller in <script></scripts> (like function onEvent(){})

Example

<html>
<!-- You can load any library here like jQuery -->
<script>
  function onEvent(eventType) {
    if (eventType == 'OnPlayClick') {
      JavaScriptInterface.runScript('start();'); // call start function in index.js
      // you can also put parameters like 'start(10, "run", "stop")'
    } else if (eventType == 'OnPauseClick') {
      JavaScriptInterface.runScript('stop();'); // call stop function in index.js
    }
  }
  function onLog(message) {
    console.log(message);
  }
</script>
<body>
  <div>Setting UI</div>
  <button>Setting</button>
</body>
</html>

Test Your Scripts

With IDE

You can just click Run in Developer Tool, then developer tool will send your scripts to Robotmon service and run it.

With Robotmon App (Web view APIs)

Preparing two file index.js and index.html (Or zip two file as index.zip) and put them into phone /sdcard/Robotmon/scripts/your.script.name/index.(js)(html)(zip)

Publish your scripts

2. Add your scripts in scripts folder

3. ZIP all your files as index.zip

4. Editor script-config.json and add information about your scripts

5. Commit and push to your branch

for efficiency, You should hold every thing yourself.

for controlling Floating Window and Robotmon Service (JavascriptInterface.runScript();)

for receiving events from Floating Window and Robotmon Service (onLog())

for communicating with Robotmon Service. You can connect to robotmon service anywhere.

(or )

Crop: crop an image (by selection) in to /sdcard/Robotmon/scripts/com.my.newProject/images (You may want to editor app name first) (This function is base on )

1. Git fork and clone

Make a pull request to

Raw APIs
Javascript interface
Javascript Events
GRPC commands
Download Develop IDE
Build it yourself
RBM library
More examples
https://github.com/r2-studio/robotmon-scripts
https://github.com/r2-studio/robotmon-scripts
RBM library