citedd commited on
Commit
fdd11fb
·
verified ·
1 Parent(s): c4f0e70

Update start.sh

Browse files
Files changed (1) hide show
  1. start.sh +62 -2
start.sh CHANGED
@@ -13,6 +13,12 @@ cat << EOF > $HOME/.openclaw/openclaw.json
13
  "token": "${GATEWAY_TOKEN}"
14
  }
15
  },
 
 
 
 
 
 
16
  "channels": {
17
  "telegram": {
18
  "enabled": true,
@@ -167,8 +173,62 @@ Ketika pengguna meminta untuk dibuatkan gambar, lukisan, atau foto, kamu WAJIB m
167
  1. Terjemahkan permintaan ke prompt bahasa Inggris.
168
  2. Eksekusi perintah terminal ini dengan tool exec:
169
  \`echo '{"prompt": "PROMPT_INGGRIS"}' | node $HOME/.openclaw/workspace/generate_image.js\`
170
- 3. Setelah sukses, kirim pesan berisi gambar dengan Markdown persis seperti ini:
171
- ![Hasil Gambar]($HOME/.openclaw/workspace/photo.png)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  EOF
173
 
174
  # 5. Trik Anti-Nganggur (Dummy Web Server agar HF tetap hijau)
 
13
  "token": "${GATEWAY_TOKEN}"
14
  }
15
  },
16
+ "browser": {
17
+ "enabled": true,
18
+ "executablePath": "/usr/bin/chromium",
19
+ "headless": true,
20
+ "noSandbox": true
21
+ },
22
  "channels": {
23
  "telegram": {
24
  "enabled": true,
 
173
  1. Terjemahkan permintaan ke prompt bahasa Inggris.
174
  2. Eksekusi perintah terminal ini dengan tool exec:
175
  \`echo '{"prompt": "PROMPT_INGGRIS"}' | node $HOME/.openclaw/workspace/generate_image.js\`
176
+ 3. Setelah sukses, kirim gambar sebagai attachment Telegram, bukan Markdown image.
177
+ Gunakan message send dengan media file:
178
+ `openclaw message send --channel telegram --target <TARGET> --media $HOME/.openclaw/workspace/photo.png --force-document`
179
+ EOF
180
+
181
+ # 4.5 Tambahin script screenshot viewport (ANTI FULL PAGE)
182
+ cat << 'EOF' > $HOME/.openclaw/workspace/screenshot_viewport.sh
183
+ #!/bin/bash
184
+
185
+ URL="$1"
186
+ OUT="$2"
187
+
188
+ if [ -z "$URL" ]; then
189
+ echo "URL kosong!"
190
+ exit 1
191
+ fi
192
+
193
+ if [ -z "$OUT" ]; then
194
+ OUT="$HOME/.openclaw/workspace/screenshot.png"
195
+ fi
196
+
197
+ chromium \
198
+ --headless \
199
+ --no-sandbox \
200
+ --disable-gpu \
201
+ --disable-dev-shm-usage \
202
+ --window-size=1280,720 \
203
+ --screenshot="$OUT" \
204
+ "$URL"
205
+
206
+ echo "SUKSES: $OUT"
207
+ EOF
208
+
209
+ chmod +x $HOME/.openclaw/workspace/screenshot_viewport.sh
210
+
211
+ mkdir -p $HOME/.openclaw/workspace/skills/web_screenshot
212
+
213
+ cat << EOF > $HOME/.openclaw/workspace/skills/web_screenshot/SKILL.md
214
+ ---
215
+ name: web_screenshot_viewport
216
+ description: Ambil screenshot website hanya viewport (bukan full page).
217
+ ---
218
+
219
+ # Web Screenshot Viewport
220
+
221
+ Jika user meminta screenshot website:
222
+
223
+ 1. Ambil URL dari user atau cari dulu URL yang valid
224
+ 2. Jalankan perintah ini:
225
+
226
+ \`$HOME/.openclaw/workspace/screenshot_viewport.sh "URL" "$HOME/.openclaw/workspace/screenshot.png"\`
227
+
228
+ 3. Kirim hasilnya:
229
+ Gunakan message send dengan media file:
230
+ `openclaw message send --channel telegram --target <TARGET> --media $HOME/.openclaw/workspace/photo.png --force-document`
231
+ ![Screenshot]($HOME/.openclaw/workspace/screenshot.png)
232
  EOF
233
 
234
  # 5. Trik Anti-Nganggur (Dummy Web Server agar HF tetap hijau)