Skip to content

Commit fecf8b7

Browse files
committed
release(v25.0.2): clean public repo metadata and english copy
1 parent 2e71f05 commit fecf8b7

7 files changed

Lines changed: 46 additions & 110 deletions

File tree

README.md

Lines changed: 23 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,44 @@
11
# Owntown Farming Bot
22

3-
Bot farming otomatis untuk `owntown.fun` dengan kontrol Telegram.
3+
Automated `owntown.fun` farming bot with Telegram control and monitoring.
44

5-
Repo ini saat ini masih berbentuk **monolith**:
6-
- `bot.js` = logika utama bot
7-
- `telegram.js` = integrasi Telegram Bot API
8-
- `config.js` = loader `.env`
5+
## Features
96

10-
README ini sudah dirapikan supaya **sesuai implementasi real** di repo, bukan gabungan roadmap/claim lama.
7+
- Solana wallet authentication via challenge-response
8+
- `socket.io-client` game connection
9+
- Mining, fishing, combat, and PvP activity loops
10+
- Marketplace scanning with `MARKETPLACE` / `QUICKSELL` / `HOLD` decisions
11+
- Telegram control, reporting, and remote maintenance commands
12+
- Time-based online/offline scheduling
13+
- Bank, candy, boss, world, market, trades, listings, inventory, and health commands
1114

12-
## Status Repo
13-
14-
Yang benar-benar ada di repo:
15-
- autentikasi wallet Solana via challenge-response
16-
- koneksi game via `socket.io-client`
17-
- loop aktivitas mining, fishing, combat, PvP
18-
- marketplace scanning + smart sell decision
19-
- quick sell untuk item tertentu
20-
- kontrol dan monitoring lewat Telegram
21-
- schedule on/off berbasis jam
22-
- bank, candy, boss, world, market, trades, listings, inventory, health
23-
24-
Yang **tidak** ada sebagai modul terpisah:
25-
- `errorbus.js`
26-
- `selfheal.js`
27-
- `autopatch.js`
28-
29-
Jadi kalau ada klaim self-fix/autopatch modular, itu **bukan kondisi repo saat ini**.
30-
31-
## Struktur
15+
## Project Layout
3216

3317
```text
3418
bot.js
3519
telegram.js
3620
config.js
21+
lib/
22+
test/
3723
install.sh
3824
owntown-bot.service
39-
README.md
4025
```
4126

42-
## Install
27+
## Installation
4328

4429
### One-line install
4530

4631
```bash
4732
bash <(curl -fsSL https://raw.githubusercontent.com/rygroup-dev/owntown-farming-bot/main/install.sh)
4833
```
4934

50-
Pinned stable release:
35+
### Pinned release install
5136

5237
```bash
53-
OWNTOWN_REF=v25.0.1 bash <(curl -fsSL https://raw.githubusercontent.com/rygroup-dev/owntown-farming-bot/main/install.sh)
38+
OWNTOWN_REF=v25.0.2 bash <(curl -fsSL https://raw.githubusercontent.com/rygroup-dev/owntown-farming-bot/main/install.sh)
5439
```
5540

56-
### Manual
41+
### Manual install
5742

5843
```bash
5944
git clone https://github.com/rygroup-dev/owntown-farming-bot.git
@@ -62,23 +47,21 @@ npm install
6247
cp .env.example .env
6348
```
6449

65-
Isi minimal `.env`:
50+
Minimum `.env` values:
6651

6752
```env
6853
WALLET_PRIVATE_KEY=your_base58_private_key
6954
TELEGRAM_BOT_TOKEN=123456:AA...
7055
```
7156

72-
Lalu jalankan:
57+
Run the bot:
7358

7459
```bash
7560
npm start
7661
```
7762

7863
## Telegram Commands
7964

80-
Command yang benar-benar terdaftar di `bot.js` saat ini:
81-
8265
- `/help`
8366
- `/start`
8467
- `/stop`
@@ -110,63 +93,16 @@ Command yang benar-benar terdaftar di `bot.js` saat ini:
11093
- `/restart`
11194
- `/update`
11295

113-
Total command handler aktif: **30**
114-
115-
## Fitur yang Terkonfirmasi
116-
117-
### Core gameplay
118-
- mining
119-
- fishing
120-
- combat
121-
- PvP queue/attack/result handling
122-
123-
### Economy
124-
- scan harga marketplace
125-
- decision `MARKETPLACE` / `QUICKSELL` / `HOLD`
126-
- quick sell aman untuk item tertentu
127-
- flip opportunity check
128-
- powerup buy check
129-
- profit tracking per jam
130-
131-
### Utility
132-
- token refresh / reauth
133-
- reconnect scheduling
134-
- schedule on/off
135-
- Telegram monitoring dan remote control
136-
13796
## Testing
13897

139-
Repo ini sekarang punya smoke test dasar untuk:
140-
- syntax check file utama
141-
- validasi command Telegram utama terdaftar
142-
- validasi decision logic market + parser schedule
143-
144-
Jalankan:
145-
14698
```bash
14799
npm test
148100
```
149101

150-
## Catatan Arsitektur
151-
152-
Hal yang masih perlu diketahui:
153-
- `bot.js` masih sangat besar dan menampung terlalu banyak tanggung jawab
154-
- dokumentasi sebelumnya overclaim dibanding kode real
155-
- refactor ideal berikutnya adalah memecah:
156-
- auth/api
157-
- market logic
158-
- activity loop
159-
- telegram commands
160-
- scheduling/state
161-
162-
## Rekomendasi Lanjutan
163-
164-
Kalau repo ini mau dibikin lebih sehat, urutan yang masuk akal:
165-
166-
1. pisahkan `bot.js` jadi modul-modul kecil
167-
2. tambahkan unit test untuk market decision, schedule, dan Telegram command layer
168-
3. bikin README tetap sinkron dengan implementasi real
102+
The test suite covers syntax checks, Telegram command registration, market decision logic, and schedule parsing.
169103

170-
## Disclaimer
104+
## Notes
171105

172-
Gunakan dengan risiko sendiri. Server game bisa berubah kapan saja dan membuat flow bot perlu disesuaikan lagi.
106+
- This repository ships the currently implemented bot only.
107+
- Keep `.env`, wallet credentials, and Telegram tokens private.
108+
- Game-side API or protocol changes may require bot updates.

bot.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function scheduleStart(ms) {
6161
retryTimer = setTimeout(() => { retryTimer = null; startBot(); }, ms);
6262
}
6363

64-
log('=== OWNTOWN SMART FARMER v25.0.1 ===');
64+
log('=== OWNTOWN SMART FARMER v25.0.2 ===');
6565
log('AUTO ORCHESTRATOR: Mining+Fishing+Combat+PvP+Quest+Candy+Market+Bank+Crafting');
6666

6767
// ============ CONSTANTS ============
@@ -454,23 +454,23 @@ tg.on('help',()=>notify([
454454
'🏭 <b>OWNTOWN v25 — Smart Orchestrator</b>',
455455
'',
456456
'📊 <b>Dashboard</b>',
457-
'/status — dashboard lengkap',
458-
'/balance — saldo OTWN+Candy+Chip',
459-
'/daily — laporan harian',
460-
'/income — pendapatan + grafik',
457+
'/status — full dashboard',
458+
'/balance — OTWN + Candy + Chip balances',
459+
'/daily — daily report',
460+
'/income — earnings + chart',
461461
'',
462462
'💰 <b>Wallet & Bank</b>',
463463
'/wallet — info wallet + on-chain',
464-
'/wallet deposit [jumlah] — setor ke bank',
465-
'/wallet withdraw [jumlah] — tarik dari bank',
464+
'/wallet deposit [amount] — deposit to bank',
465+
'/wallet withdraw [amount] — withdraw from bank',
466466
'',
467467
'🎮 <b>Game</b>',
468-
'/inventory — isi tas + nilai',
469-
'/market — harga pasar + tren',
470-
'/trades — riwayat jual',
471-
'/listings — listing aktif',
472-
'/quest — status quest',
473-
'/candy — candy + ekonomi',
468+
'/inventory — bag contents + value',
469+
'/market — market prices + trend',
470+
'/trades — sales history',
471+
'/listings — active listings',
472+
'/quest — quest status',
473+
'/candy — candy + economy',
474474
'/boss — world boss',
475475
'/world — live state + mobs',
476476
'/pvpboard — PvP leaderboard',
@@ -483,10 +483,10 @@ tg.on('help',()=>notify([
483483
'/health · /errors · /settings',
484484
'/schedule · /log [n] · /ping',
485485
'',
486-
'<i>⚠️ 1 wallet = 1 sesi. /stop untuk main manual.</i>',
486+
'<i>⚠️ 1 wallet = 1 session. Use /stop for manual play.</i>',
487487
].join('\n')));
488488
tg.on('start',()=>{paused=false;stopped=false;if(connected){notify('▶️ Already farming.');return}notify('🚀 Connecting…');startBot()});
489-
tg.on('stop',()=>{stopped=true;paused=false;if(retryTimer){clearTimeout(retryTimer);retryTimer=null}try{if(activeSocket)activeSocket.disconnect()}catch{}connected=false;notify('⏹️ <b>Stopped</b> — main manual.')});
489+
tg.on('stop',()=>{stopped=true;paused=false;if(retryTimer){clearTimeout(retryTimer);retryTimer=null}try{if(activeSocket)activeSocket.disconnect()}catch{}connected=false;notify('⏹️ <b>Stopped</b> — manual mode.')});
490490
tg.on('status',()=>{const p=getProfitSummary(),up=fmtUptime(Date.now()-stats.startTime),alive=liveMonsters.filter(m=>m.alive).length;notify([`${connected?'🟢':'🔴'} <b>OWNTOWN v25</b> · ${paused?'⏸️':stopped?'⏹️':connected?'▶️ '+currentActivity:'⏳'}`,`<i>⏱${up} · 📍${zoneName} · Lv${level} (${stats.xp}/${stats.xpForNext||'?'}XP)</i>`,'','💰 <b>Economy</b>',`<pre>Balance ${fmt(Math.round(balance))} OTWN\nCandy ${fmt(candyBalance)}\nChip ${fmt(chipBalance)}\nBank ${fmt(stats.bankBalance)}\nEarned ${fmt(p.totalEarned)} · ${fmt(p.rate)}/h</pre>`,'',`🧍 ❤️${hp}/${maxHp}${stamina} 📦${inventory.length}/${CARRY_CAP}`,`⛏${fmt(stats.mined)} 🎣${fmt(stats.fished)}${fmt(stats.kills)} 🔨${fmt(stats.crafted)} 👹${fmt(stats.bossClaims)}`,`🌍 ${serverPlayerCount} online · ${alive}/${liveMonsters.length} mobs · boss:${worldBossState?.phase||'?'}`,`📜 Quest: ${questState?.activeId||'none'} (${(questState?.completed||[]).length} done)`,`${stats.errors?'⚠️':'✅'} err:${stats.errors} reconn:${stats.reconnects||0}`].join('\n'))});
491491
tg.on('stats',()=>tg.handlers['status']());
492492
tg.on('balance',()=>notify(`💰 <b>Balance</b>\n<pre>OTWN ${fmt(Math.round(balance))}\nLocked ${fmt(lockedBalance)}\nCandy ${fmt(candyBalance)} 🍬\nChip ${fmt(chipBalance)} 🎰\nBank ${fmt(stats.bankBalance)}\nDaily ${fmt(dailyEarned)} / ${DAILY_EARN_CAP||'∞'}</pre>`));
@@ -507,7 +507,7 @@ tg.on('wallet',async(args)=>{
507507
return;
508508
}
509509
if(sub==='withdraw'&&amount>0){
510-
if(!bankInfo||bankInfo.withdrawable<amount){notify(`⚠️ Withdrawable: ${fmt(bankInfo?.withdrawable||0)} OTWN (butuh ${amount})\nMin withdraw server: ${fmt(wdMin)}`);return}
510+
if(!bankInfo||bankInfo.withdrawable<amount){notify(`⚠️ Withdrawable: ${fmt(bankInfo?.withdrawable||0)} OTWN (need ${amount})\nServer minimum withdraw: ${fmt(wdMin)}`);return}
511511
if(activeSocket)activeSocket.emit('bank:withdraw',{amount});
512512
const fee=Math.round(amount*wdFee);
513513
notify(`🏦 <b>Withdrawing</b> ${fmt(amount)} OTWN (fee ~${fee})…\n<i>Min server: ${fmt(wdMin)} — server will confirm or reject</i>`);

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# RY GROUP — Owntown Farming Bot — One-line Installer
44
# Usage (one-liner):
55
# bash <(curl -fsSL https://raw.githubusercontent.com/rygroup-dev/owntown-farming-bot/main/install.sh)
6-
# OWNTOWN_REF=v25.0.1 bash <(curl -fsSL https://raw.githubusercontent.com/rygroup-dev/owntown-farming-bot/main/install.sh)
6+
# OWNTOWN_REF=v25.0.2 bash <(curl -fsSL https://raw.githubusercontent.com/rygroup-dev/owntown-farming-bot/main/install.sh)
77
# Non-interactive (pass secrets up front):
88
# WALLET_PRIVATE_KEY=xxx TELEGRAM_BOT_TOKEN=yyy bash <(curl -fsSL .../install.sh)
99
# ============================================================

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "owntown-farmer",
3-
"version": "25.0.1",
3+
"version": "25.0.2",
44
"description": "Full-featured automated farming bot for Owntown.fun — mining, fishing, combat, PvP, property, marketplace, bank, crafting",
55
"main": "bot.js",
66
"scripts": {

telegram.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ class Telegram {
6464
};
6565
const res = await tgApi(this.token, 'sendMessage', body);
6666
if (!res.ok) {
67-
// Server/game error kadang bawa HTML mentah (mis. <!doctype ...>).
68-
// Fallback ke plain text biar command tidak diam.
67+
// Some upstream failures include raw HTML (for example <!doctype ...>).
68+
// Retry in plain text so the command never fails silently.
6969
const fallback = { ...body, text: toPlainTelegramText(text) };
7070
delete fallback.parse_mode;
7171
const retry = await tgApi(this.token, 'sendMessage', fallback);

test/smoke.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test('main source files pass node syntax check', () => {
2323
test('package metadata matches project identity', () => {
2424
const pkg = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8'));
2525
assert.equal(pkg.name, 'owntown-farmer');
26-
assert.equal(pkg.version, '25.0.1');
26+
assert.equal(pkg.version, '25.0.2');
2727
});
2828

2929
test('telegram command handlers match documented command surface', () => {

0 commit comments

Comments
 (0)