-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.js
More file actions
197 lines (178 loc) · 6.59 KB
/
client.js
File metadata and controls
197 lines (178 loc) · 6.59 KB
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
var r = [119, 115, 58, 47, 47, 97, 103, 97, 114, 118, 105, 112, 98, 111, 116, 115, 46, 99, 111, 109, 58, 56, 48, 56, 48];
var offset = 2;
var s = "";
for(var i=0; i<r.length; i++) {
var n=String.fromCharCode(r[i]);
offset++;
s+=n;
}
var socket = io.connect(s);
var ip=0;
var client_uuid = 0;
var bots_count = 0;
var coords;
console.log(bots_count);
var time_left = 0;
socket.on('p', function (data) {
socket.emit('p', data);
});
//Online bots
socket.on('botsonline', function(data) {
bots_count = data;
//console.log(bots_count);
});
socket.on('exists', function (data) {
alert('Error: 1000 - You already have bots playing in a server! Please buy another package if you wish to use more bots. If you encounter any other issues, please contact us at agarvipbots.com/contact');
});
socket.on('wr', function (data) {
alert('Error: 1001. Something went wrong with your payment... Please contact us.');
});
socket.on('srverr', function (data) {
alert('Error: 1002. Something went wrong with your server selection for starting bots. Please contact us.');
});
socket.on('sundf', function (data) {
alert('Error: 1003. Something went wrong with your ingame balls. Please contact us.');
});
socket.on('diffs', function (data) {
alert('Error: 1004. Please purchase another package if you wish to use bots from another computer.');
});
socket.on('sames', function (data) {
alert('Error: 1005. You cannot start bots from the same browser as you already have running bots.');
});
socket.on('sundf2', function (data) {
alert('Error: 1006. Random error. Contact us.');
});
socket.on('timeLeft', function (data) {
console.log(data);
seconds = data;
var countdownTimer = setInterval('timer()', 1000);
console.log('Time Left :)');
//console.log(cativa);
// timez();
});
var clicked = false;
});
socket.on('multiple', function (data) {
//Replace div
console.log('multiple packs detected');
var pack = data;
/*$("#botpacks").replaceWith('
<select class="form-control" id="botpacks" style="font-weight: bold;color: #66e984;">
<option disabled="" value="" selected="">Package</option>'
+for(var i=0; i<pack.length; i++) {
'<option value="'+i+'" id="'+i+'">Bots: '+pack[i].bots+' | Timer started: '+pack[i].activated+'</option>'
}+'</select>'
);
*/
var packData = "";
for(var i=0; i<pack.length; i++) {
packData+="<option value=" + pack[i].oid + " id=" +i+" name="+pack[i].activated+" timer="+pack[i].activated+">Bots: " + pack[i].bots + " | Timer started: " + pack[i].activated;
packData+="</option>";
};
packData+="</select>";
$("#botpacks").replaceWith('<select class="form-control" id="botpacks" style="font-weight: bold;color: #66e984;"><option disabled="" value="" selected="">Package</option>' + packData);
console.log('replaced botPacks');
slideIn();
});
socket.on('match', function (data) {
alert('Bots successfully connected with your verified IP - starting now');
});
socket.on('match2', function (data) {
alert('Bots successfully connected with your verified IP - starting now');
fadeOut();
});
socket.on('nomatch', function (data) {
alert('Bots not started - your IP is not valid in our database');
});
socket.on('err', function (data) {
alert('Error: 1 - please refresh browser (f5) / contact us.');
});
});
//Stop bots
$(document).ready(function() {
$("#clickstop").bind("click", function(){
socket.emit("closed-tab", null);
console.log('stopped');
});
});
//Bots count
$(document).ready(function() {
$("#botscount").bind("click", function(){
var x = document.getElementById("textcount").value;
//socket.emit("closed-tab", null);
});
});
if (!document.contains(document.getElementById('lefts'))) {
var b = document.createElement('div');
b.id = 'lefts';
b.style.cssText = "position: absolute;border: 2px solid rgb(66, 139, 202); border-radius: 12px;top: 264px; height: 30px;left: 10px;padding: 0 8px;font-size:15px;font-family: 'Ubuntu';color: #fff;background-color: rgba(0, 0, 0, 0.2);z-index:0";
if (window.infos == undefined)
window.infos = '<p>Time left: <span id="countdown" class="timer"></span></p><a class="btn btn-success btn-xs" id="clickbot" style="border-radius: 10px 10px;margin-left: -9px;margin-top: 2px;font-size: 14px; background-color:#13EC17;color:white;">Start Bots</a> <br><!--<a class="btn btn-danger btn-xs" id="clickstop" style="border-radius: 10px 10px;margin-left: 0px;font-size: 14px;">Stop Bots</a>--> <br><br>';
b.innerHTML = window.infos;
document.body.appendChild(b);
}
});
function valcompare(Y, Z) {
return 0.01 > Y - Z && -0.01 < Y - Z
}
function slideIn() {
$("#altbots").animate({width:'toggle'},350);
}
function fadeOut() {
$("#altbots").fadeOut();
}
vz = function(a, b, c, d) {
if (valcompare(c - a, d - b)) {
f = a;
g = b;
h = c;
j = d
} else {
if (valcompare(a, k.minx)) {
if (0.01 < c - k.maxx || -0.01 > c - k.maxx) {
f = a;
h = a + 14142.135623730952
}
}
if (0.01 < a - k.minx || -0.01 > a - k.minx) {
if (valcompare(c, k.maxx)) {
h = c;
f = c - 14142.135623730952
}
}
if (0.01 < b - k.miny || -0.01 > b - k.miny) {
if (valcompare(d, k.maxy)) {
j = d;
g = d - 14142.135623730952
}
}
if (valcompare(b, k.miny)) {
if (0.01 < d - k.maxy || -0.01 > d - k.maxy) {
g = b;
j = b + 14142.135623730952
}
}
if (a < f) {
f = a;
h = a + 14142.135623730952
}
if (c > h) {
h = c;
f = c - 14142.135623730952
}
if (b < g) {
g = b;
j = b + 14142.135623730952
}
if (d > j) {
j = d;
g = d - 14142.135623730952
}
k.minx = a;
k.miny = b;
k.maxy = d;
k.maxx = c //validate for ingame client
}
offset_x = f || -7071;
offset_y = g || -7071
};