-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBetterHex.user.js
More file actions
292 lines (273 loc) · 10.4 KB
/
BetterHex.user.js
File metadata and controls
292 lines (273 loc) · 10.4 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
// ==UserScript==
// @name Better HEx by Logfro
// @namespace https://logfro.de/
// @version 0.61
// @description Better HEx adds useful functions to the "legacy" hacker experience
// @author Logfro
// @match *://*.hackerexperience.com/*
// @updateURL https://gitcdn.xyz/repo/Logfro/BetterHex/master/BetterHex.meta.js
// @downloadURL https://gitcdn.xyz/repo/Logfro/BetterHex/master/BetterHex.user.js
// @grant none
// ==/UserScript==
// IPChecker from Jasper Include
// Credits: Thx to Jasper (Original Repo: https://github.com/jmerle/hacker-experience-ip-checker)
$.getScript("https://gitcdn.xyz/repo/jmerle/hacker-experience-ip-checker/master/he-ip-checker.user.js");
var lang;
if(window.location.href.indexOf("//br.") > -1) {
lang="br";
}
if(window.location.href.indexOf("//legacy.") > -1) {
lang="legacy";
}
if(window.location.href.indexOf("//en.") > -1) {
lang="en";
}
var NO_NUMBER,NOT_NUMBER,NO_IP,NO_IP2,CLEAR_OWN_LOGS_BTN,TIMES,BUY_TIMES,DEL_ENTRIES,LOGGED_INTO,DDOS_BTN;
switch(lang){
case "en":
NO_NUMBER = "You need to type in a number!";
NOT_NUMBER = " Not a number!";
NO_IP = "Your IP (";
NO_IP2 = ") isnt present in this log!";
CLEAR_OWN_LOGS_BTN = "Clear own logs";
TIMES = "How many times?";
BUY_TIMES = "Buy x times";
DEL_ENTRIES = "Remove your entries";
LOGGED_INTO = "You logged in to the address";
DDOS_BTN = "Launch DDoS!";
break;
case "br":
NO_NUMBER = "Precisas de inserir um numero!";
NOT_NUMBER = "Não é um numero!";
NO_IP = "O teu IP (";
NO_IP2 = ") não está presente neste log!";
CLEAR_OWN_LOGS_BTN = "Limpar os teus Logs";
TIMES = "Comprar quantas vezes?";
BUY_TIMES = "Comprar x vezes";
DEL_ENTRIES = "Apaga o teu log";
LOGGED_INTO = "Você entrou no endereço";
DDOS_BTN = "lanca ddos!";
break;
case "legacy":
NO_NUMBER = "You need to type in a number!";
NOT_NUMBER = " Not a number!";
NO_IP = "Your IP (";
NO_IP2 = ") isnt present in this log!";
CLEAR_OWN_LOGS_BTN = "Clear own logs";
TIMES = "How many times?";
BUY_TIMES = "Buy x times";
DEL_ENTRIES = "Remove your entries";
LOGGED_INTO = "You logged in to the address";
DDOS_BTN = "Launch DDoS!";
break;
}
(function () {
'use strict';
function clearLogs() {
var elm = document.getElementsByName("log")[0];
var x = elm.value;
var ownIP = document.getElementsByClassName("header-ip-show")[0].innerHTML;
var button = $("input.btn-inverse").get(1);
if (x.search(ownIP) === -1) {
alert(NO_IP + ownIP + NO_IP2);
return false;
}
x = x.replaceAll(ownIP, "");
elm.value = x;
button.click();
}
String.prototype.replaceAll = function (search, replacement) {
var target = this;
return target.replace(new RegExp(search, 'g'), replacement);
};
$("#he2").remove();
function submitBuyForm(times) {
if (times.length < 1) {
alert(NO_NUMBER);
return false;
}
if (isNaN(times)) {
alert(NOT_NUMBER);
return false;
}
var x = 0;
var val = setInterval(function () {
if (x === times) {
clearInterval(val);
} else {
x++;
$("form")[1].submit();
}
}, 300);
}
function openPopUp(url, name) {
var w = window.open(url, name, "width=600,height=400,status=yes,scrollbars=yes,resizable=yes");
return w;
}
function clearOwnLogs() {
$.post("https://"+lang+".hackerexperience.com/logEdit", {id: "1", log: ""}, function (result) {
var w = openPopUp("https://"+lang+".hackerexperience.com/", "logEdit");
w.document.open();
w.document.write(result);
w.document.close();
var realConfirm = w.confirm;
w.confirm = function () {
w.confirm = realConfirm;
return true;
};
var seconds;
$(w.document).ready(function () {
setTimeout(function () {
var a = w.$(".elapsed")[0].innerText;
a = a.replace("h", "");
a = a.replace("m", "");
a = a.replace("s", "");
a = a.split(':');
seconds = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]) * 1000 + 1000;
console.log(seconds);
setTimeout(function () {
w.close();
}, seconds);
}, 500);
});
});
}
function addBarBtn(name, btnId, spanId) {
var parentElem = document.getElementsByClassName("btn-group")[0];
var li = document.createElement("li");
var a = document.createElement("a");
var span = document.createElement("span");
$(li).addClass("btn btn-inverse");
li.id = btnId;
$(li).addClass("text");
span.id = spanId;
span.innerText = name;
a.appendChild(span);
li.appendChild(a);
parentElem.insertBefore(li, parentElem.children[1]);
}
function addNavButton(name, id) {
var li = document.createElement("li");
var a = document.createElement("a");
var span = document.createElement("span");
var text = document.createTextNode(name);
span.className = "hide-phone";
a.id = id;
li.appendChild(a);
a.appendChild(span);
span.appendChild(text);
li.className = "link";
document.getElementsByClassName("nav nav-tabs")[0].appendChild(li);
}
function loadLogFunc() {
addNavButton(DEL_ENTRIES, "LogfroLogClickID");
$(document).ready(function () {
$("#LogfroLogClickID").on("click", function () {
clearLogs();
});
});
}
function loadClearOwnLogBtn() {
$(document).ready(function () {
addBarBtn(CLEAR_OWN_LOGS_BTN, "LogfroClearOwnLogsBtn", "LogfroClearOwnLogsBtnSpan");
$("#LogfroClearOwnLogsBtn").on("click", function () {
clearOwnLogs();
});
});
}
function loadHDDBuyBtn() {
$(document).ready(function () {
var btn = document.createElement("input");
var input = document.createElement("input");
input.type = "text";
input.id = "LogfroHDDBuyBtnTimes";
input.style = "margin: 10px;";
input.placeholder = TIMES;
btn.className = "btn btn-success";
btn.id = "LogfroHDDBuyBtn";
btn.value = BUY_TIMES;
btn.type = "button";
var temp = $("#buy .modal-footer form");
temp[0].appendChild(btn);
temp[0].appendChild(input);
$("#LogfroHDDBuyBtn").on("click", function () {
submitBuyForm($("#LogfroHDDBuyBtnTimes")[0].value);
});
});
}
function loadServerBuyBtn() {
$(document).ready(function () {
var btn = document.createElement("input");
var input = document.createElement("input");
input.type = "text";
input.id = "LogfroServerBuyBtnTimes";
input.style = "margin: 10px;";
input.placeholder = TIMES;
btn.className = "btn btn-success";
btn.id = "LogfroServerBuyBtn";
btn.value = BUY_TIMES;
btn.type = "button";
var temp = $("#buy .modal-footer form");
temp[0].appendChild(btn);
temp[0].appendChild(input);
$("#LogfroServerBuyBtn").on("click", function () {
submitBuyForm($("#LogfroServerBuyBtnTimes")[0].value);
});
});
}
function loadNoneVbrk(){
if($("center:contains('DDoS Breaker')").length > 0){
var form = $("form.ddos_form")[0];
var btn = document.createElement("input");
btn.type = "submit";
btn.className = "btn btn-danger";
btn.value = DDOS_BTN;
btn.setAttribute("onClick","$(\"form.ddos_form\")[0].submit();");
form.appendChild(btn);
}
}
loadClearOwnLogBtn();
$(document).ready(function () {
switch (window.location.href) {
case "https://"+lang+".hackerexperience.com/internet?view=logs":
if (document.getElementsByName("log").length > 0) {
loadLogFunc();
}
break;
case "https://"+lang+".hackerexperience.com/internet":
if (document.getElementsByName("log").length > 0) {
loadLogFunc();
}
var temp = $(".alert-success");
if (temp.length > 1 && $("#btc-login").length < 1 && temp[0].innerText.indexOf(LOGGED_INTO) > -1) {
clearOwnLogs();
}
break;
case "https://"+lang+".hackerexperience.com/internet?ip=7.28.21.234":
var temp = $(".alert-success");
if (temp.length > 1 && $("#btc-login").length < 1 && temp[0].innerText.indexOf(LOGGED_INTO) > -1) {
clearOwnLogs();
}
break;
case "https://"+lang+".hackerexperience.com/list?action=collect&show=last":
clearOwnLogs();
break;
case "https://"+lang+".hackerexperience.com/list?action=ddos":
loadNoneVbrk();
break;
default:
break;
}
if (window.location.href.indexOf("https://"+lang+".hackerexperience.com/hardware?opt=xhd&acc=") > -1) {
loadHDDBuyBtn();
}
if (window.location.href.indexOf("https://"+lang+".hackerexperience.com/hardware?opt=buy&acc=") > -1) {
loadServerBuyBtn();
}
var realConfirm = window.confirm;
window.confirm = function () {
window.confirm = realConfirm;
return true;
};
});
})();