-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathbot.html
115 lines (109 loc) · 5.25 KB
/
bot.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>MA Bot</title>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<meta name="description" content="ma bot">
<meta name="author" content="binux">
</head>
<body>
<section id=login>
<form id=login_form onsubmit="return login(this);">
login_id: <input name=id />
password: <input type=password name=pwd />
area_id: <input name=area />
server: <select name=server>
<option value="http://game1-cbt.ma.sdo.com:10001">CN1</option>
<option value="http://game2-cbt.ma.sdo.com:10001">CN2</option>
<option value="http://game3-cbt.ma.sdo.com:10001">CN3</option>
</select>
<input type=checkbox name=offline /> offline
<input id=submit type=submit value=login />
</form>
<div id="setting" style="display: none;">
<hr />
预留AP:<input onchange="ws.send('set AP_LIMIT '+this.value)" value="20" />
预留BC:<input onchange="ws.send('set BC_LIMIT '+this.value)" value="9999" />
自动卖卡:低于<input onchange="ws.send('set SELL_CARDS '+this.value)" value="0" />星
<br />
<input type="checkbox" onchange="ws.send('set_bool NEXT_AREA '+this.checked)" checked />自动换区域
<input type="checkbox" onchange="ws.send('set_bool NEXT_FLOOR '+this.checked)" checked />自动上楼
<input type="checkbox" onchange="ws.send('set_bool REWARDS '+this.checked)" />自动领奖
<input type="checkbox" onchange="ws.send('set_bool GACHA_GACHA '+this.checked)" />自动抽DS卷
<input type="checkbox" onchange="ws.send('set_bool GACHA_FRIEND '+this.checked)" />自动抽伴点
<button onclick="ws.send('item_use 1')">吃绿:AP</button>
<button onclick="ws.send('item_use 2')">吃红:BC</button>
<button onclick="ws.send('report 1')">状态</button>
<button onclick="log.innerHTML=''">清除日志</button>
<br />
舔怪卡组:<input onchange="ws.send('roundtable low_cost '+this.value)" value="" />
大刀卡组:<input onchange="ws.send('roundtable high_damage '+this.value)" value="" />
尾刀卡组:<input onchange="ws.send('roundtable kill '+this.value)" value="" />
<br />
<a onclick="compound.style.display=compound.style.display=='block'?'none':'block'" href="javascript:void();">合成面板</a>
<div id="compound" style="display: none;">
<button onclick="ws.send('fairy_rewards 1')">领取妖精奖励</button>
|
<button onclick="ws.send('merge 5')">合成5星以上相同卡</button>
| 以
<select id="sort_cards_by">
<option selected>rarity</option>
<option>cp</option>
<option>lv</option>
<option>sale_price</option>
<option>hp_power</option>
<option>hp</option>
<option>power</option>
<option>max_lv</option>
</select>
排序,并过滤<input id="sort_cards_filter" type="checkbox" checked />一级和满级的卡
<button onclick="ws.send('sort_card '+sort_cards_by.value+' '+sort_cards_filter.checked)">go</button>
<br />
用<input id='compound_max_lv' value=4 />级以下的狗粮,合成id为<input id='compound_base' />的卡到<input id='compound_target_lv' value=77 />级
<button onclick="ws.send('compound '+compound_base.value+' '+compound_target_lv.value+' '+compound_max_lv.value)">go</button>
</div>
</div>
</section>
<section id=log>
</section>
</body>
<script>
if (window.WebSocket === undefined) {
submit.disabled = true;
login_form.id.disabled = true;
login_form.pwd.disabled = true;
log.innerHTML += "<br />WebSocket not supported. Using Chrome!";
}
function login(form) {
if (window.ws) {
return;
}
var login_id = form.id.value,
password = form.pwd.value,
area = form.area.value,
server = form.server.value,
offline = form.offline.checked && "1" || "";
window.ws = new WebSocket("ws://"+location.host+"/bot?id="+login_id+"&password="+password+"&area="+area+"&offline="+offline+"&server="+encodeURIComponent(server));
ws.onopen = function() {
log.innerHTML += "<br />connected.";
document.querySelector("#setting").style.display = 'block';
};
ws.onclose = function() {
log.innerHTML += "<br /><span class=error>disconnected.</span>";
document.querySelector("#setting").style.display = 'none';
setTimeout(function() { login(form); }, 60*1000);
submit.disabled = login_form.id.disabled = login_form.pwd.disabled = login_form.area.disabled = login_form.server.disabled = login_form.offline.disabled = false;
window.ws = null;
};
ws.onmessage = function(event) {
log.innerHTML += "<br />"+event.data;
};
submit.disabled = login_form.id.disabled = login_form.pwd.disabled = login_form.area.disabled = login_form.server.disabled = login_form.offline.disabled = true;
return false;
}
</script>
</html>
<!-- vim: set et sw=2 ts=2 sts=2 ff=unix fenc=utf8: -->