-
Notifications
You must be signed in to change notification settings - Fork 0
/
launcher.js
103 lines (94 loc) · 2.93 KB
/
launcher.js
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
//Made By Jesen N#9071
const place = "C:\\Windows\\System32\\drivers\\etc\\hosts";
const fs = require("fs");
const rl = require("readline").createInterface({
input: process.stdin,
output: process.stdout,
});
//setup here
var ip = "ip gtps";
let nameserver = "your name gtps";
let on = `
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
${ip} growtopia1.com
${ip} growtopia2.com
`;
let off = `
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
`;
var loop = function () {
rl.question("Press enter to turn on: ", (text) => {
if (text == "") {
main()
} else {
loop()
}
})
}
console.clear();
var main = function () {
fs.writeFile(place, on, function (err) {
if (err) {
console.log(
"ERROR: Please open the application/command prompt with administrator!!"
);
} else {
console.clear();
console.log(`${nameserver} Launcher Is ON!`);
rl.question("Press enter to turn off: ", function (enter) {
if (enter === "") {
console.clear();
fs.writeFile(place, off, function (err) {
if (err) {
console.log(
"ERROR: Please open the application/command prompt with administrator!!"
);
} else {
console.log(`${nameserver} Launcher Is OFF`);
loop()
}
});
}
});
}
});
}
main()