Flameso_o16

ROBLOX SERVER REGION FINDER

Feb 9th, 2025
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 67.94 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Roblox Region Locator
  3. // @namespace http://tampermonkey.net/
  4. // @version 9.2
  5. // @description AutoRegion Loading in Roblox Servers with City and Country Selection. RoPro, RoGold, and RoQol alternative.
  6. // @icon https://media.discordapp.net/attachments/1327406738793566292/1338145186496254025/Flames.png?ex=67aa0451&is=67a8b2d1&hm=7c1f630b3ae5283e00192b7d862258afea0e522960ebde5bc95ae97f33de1b4d&=&format=webp&quality=lossless&width=992&height=557
  7. // @license MIT
  8. // @author Flames
  9. // @match https://www.roblox.com/games/*
  10. // @grant GM_xmlhttpRequest
  11. // @downloadURL https://update.greasyfork.org/scripts/522164/Roblox%20Region%20Locator.user.js
  12. // @updateURL https://update.greasyfork.org/scripts/522164/Roblox%20Region%20Locator.meta.js
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. const serverRegionsByIp = {
  19. "128.116.0.0": {
  20. city: "Hong Kong",
  21. country: {
  22. name: "Hong Kong",
  23. code: "HK"
  24. }
  25. },
  26. "128.116.1.0": {
  27. city: "Los Angeles",
  28. country: {
  29. name: "United States",
  30. code: "US"
  31. },
  32. region: {
  33. name: "California",
  34. code: "CA"
  35. }
  36. },
  37. "128.116.2.0": {
  38. city: "Warsaw",
  39. country: {
  40. name: "Poland",
  41. code: "PL"
  42. },
  43. region: {
  44. name: "Mazowieckie",
  45. code: "14"
  46. }
  47. },
  48. "128.116.3.0": {
  49. city: "Warsaw",
  50. country: {
  51. name: "Poland",
  52. code: "PL"
  53. },
  54. region: {
  55. name: "Mazowieckie",
  56. code: "14"
  57. }
  58. },
  59. "128.116.4.0": {
  60. city: "Paris",
  61. country: {
  62. name: "France",
  63. code: "FR"
  64. },
  65. region: {
  66. name: "Île-de-France",
  67. code: "IDF"
  68. }
  69. },
  70. "128.116.5.0": {
  71. city: "Frankfurt am Main",
  72. country: {
  73. name: "Germany",
  74. code: "DE"
  75. },
  76. region: {
  77. name: "Hessen",
  78. code: "HE"
  79. }
  80. },
  81. "128.116.6.0": {
  82. city: "Tokyo",
  83. country: {
  84. name: "Japan",
  85. code: "JP"
  86. },
  87. region: {
  88. name: "Tokyo",
  89. code: "13"
  90. }
  91. },
  92. "128.116.7.0": {
  93. city: "Mumbai",
  94. country: {
  95. name: "India",
  96. code: "IN"
  97. },
  98. region: {
  99. name: "Mahārāshtra",
  100. code: "MH"
  101. }
  102. },
  103. "128.116.8.0": {
  104. city: "Frankfurt am Main",
  105. country: {
  106. name: "Germany",
  107. code: "DE"
  108. },
  109. region: {
  110. name: "Hessen",
  111. code: "HE"
  112. }
  113. },
  114. "128.116.9.0": {
  115. city: "Mumbai",
  116. country: {
  117. name: "India",
  118. code: "IN"
  119. },
  120. region: {
  121. name: "Mahārāshtra",
  122. code: "MH"
  123. }
  124. },
  125. "128.116.10.0": {
  126. city: "Ashburn",
  127. country: {
  128. name: "United States",
  129. code: "US"
  130. },
  131. region: {
  132. name: "Virginia",
  133. code: "VA"
  134. }
  135. },
  136. "128.116.11.0": {
  137. city: "Ashburn",
  138. country: {
  139. name: "United States",
  140. code: "US"
  141. },
  142. region: {
  143. name: "Virginia",
  144. code: "VA"
  145. }
  146. },
  147. "128.116.12.0": {
  148. city: "San Mateo",
  149. country: {
  150. name: "United States",
  151. code: "US"
  152. },
  153. region: {
  154. name: "California",
  155. code: "CA"
  156. }
  157. },
  158. "128.116.13.0": {
  159. city: "Amsterdam",
  160. country: {
  161. name: "Netherlands",
  162. code: "NL"
  163. },
  164. region: {
  165. name: "Noord-Holland",
  166. code: "NH"
  167. }
  168. },
  169. "128.116.14.0": {
  170. city: "Hong Kong",
  171. country: {
  172. name: "Hong Kong",
  173. code: "HK"
  174. }
  175. },
  176. "128.116.15.0": {
  177. city: "Secaucus",
  178. country: {
  179. name: "United States",
  180. code: "US"
  181. },
  182. region: {
  183. name: "New Jersey",
  184. code: "NJ"
  185. }
  186. },
  187. "128.116.16.0": {
  188. city: "Secaucus",
  189. country: {
  190. name: "United States",
  191. code: "US"
  192. },
  193. region: {
  194. name: "New Jersey",
  195. code: "NJ"
  196. }
  197. },
  198. "128.116.17.0": {
  199. city: "Secaucus",
  200. country: {
  201. name: "United States",
  202. code: "US"
  203. },
  204. region: {
  205. name: "New Jersey",
  206. code: "NJ"
  207. }
  208. },
  209. "128.116.18.0": {
  210. city: "Miami",
  211. country: {
  212. name: "United States",
  213. code: "US"
  214. },
  215. region: {
  216. name: "Florida",
  217. code: "FL"
  218. }
  219. },
  220. "128.116.19.0": {
  221. city: "Paris",
  222. country: {
  223. name: "France",
  224. code: "FR"
  225. },
  226. region: {
  227. name: "Île-de-France",
  228. code: "IDF"
  229. }
  230. },
  231. "128.116.20.0": {
  232. city: "Paris",
  233. country: {
  234. name: "France",
  235. code: "FR"
  236. },
  237. region: {
  238. name: "Île-de-France",
  239. code: "IDF"
  240. }
  241. },
  242. "128.116.21.0": {
  243. city: "Amsterdam",
  244. country: {
  245. name: "Netherlands",
  246. code: "NL"
  247. },
  248. region: {
  249. name: "Noord-Holland",
  250. code: "NH"
  251. }
  252. },
  253. "128.116.22.0": {
  254. city: "Atlanta",
  255. country: {
  256. name: "United States",
  257. code: "US"
  258. },
  259. region: {
  260. name: "Georgia",
  261. code: "GA"
  262. }
  263. },
  264. "128.116.23.0": {
  265. city: "Secaucus",
  266. country: {
  267. name: "United States",
  268. code: "US"
  269. },
  270. region: {
  271. name: "New Jersey",
  272. code: "NJ"
  273. }
  274. },
  275. "128.116.24.0": {
  276. city: "Atlanta",
  277. country: {
  278. name: "United States",
  279. code: "US"
  280. },
  281. region: {
  282. name: "Georgia",
  283. code: "GA"
  284. }
  285. },
  286. "128.116.25.0": {
  287. city: "Atlanta",
  288. country: {
  289. name: "United States",
  290. code: "US"
  291. },
  292. region: {
  293. name: "Georgia",
  294. code: "GA"
  295. }
  296. },
  297. "128.116.26.0": {
  298. city: "Paris",
  299. country: {
  300. name: "France",
  301. code: "FR"
  302. },
  303. region: {
  304. name: "Île-de-France",
  305. code: "IDF"
  306. }
  307. },
  308. "128.116.27.0": {
  309. city: "Chicago",
  310. country: {
  311. name: "United States",
  312. code: "US"
  313. },
  314. region: {
  315. name: "Illinois",
  316. code: "IL"
  317. }
  318. },
  319. "128.116.28.0": {
  320. city: "Chicago",
  321. country: {
  322. name: "United States",
  323. code: "US"
  324. },
  325. region: {
  326. name: "Illinois",
  327. code: "IL"
  328. }
  329. },
  330. "128.116.29.0": {
  331. city: "Chicago",
  332. country: {
  333. name: "United States",
  334. code: "US"
  335. },
  336. region: {
  337. name: "Illinois",
  338. code: "IL"
  339. }
  340. },
  341. "128.116.30.0": {
  342. city: "Hong Kong",
  343. country: {
  344. name: "Hong Kong",
  345. code: "HK"
  346. }
  347. },
  348. "128.116.31.0": {
  349. city: "Warsaw",
  350. country: {
  351. name: "Poland",
  352. code: "PL"
  353. },
  354. region: {
  355. name: "Mazowieckie",
  356. code: "14"
  357. }
  358. },
  359. "128.116.32.0": {
  360. city: "Secaucus",
  361. country: {
  362. name: "United States",
  363. code: "US"
  364. },
  365. region: {
  366. name: "New Jersey",
  367. code: "NJ"
  368. }
  369. },
  370. "128.116.33.0": {
  371. city: "Slough",
  372. country: {
  373. name: "United Kingdom",
  374. code: "GB"
  375. },
  376. region: {
  377. name: "England",
  378. code: "ENG"
  379. }
  380. },
  381. "128.116.34.0": {
  382. city: "Chicago",
  383. country: {
  384. name: "United States",
  385. code: "US"
  386. },
  387. region: {
  388. name: "Illinois",
  389. code: "IL"
  390. }
  391. },
  392. "128.116.35.0": {
  393. city: "Slough",
  394. country: {
  395. name: "United Kingdom",
  396. code: "GB"
  397. },
  398. region: {
  399. name: "England",
  400. code: "ENG"
  401. }
  402. },
  403. "128.116.36.0": {
  404. city: "Slough",
  405. country: {
  406. name: "United Kingdom",
  407. code: "GB"
  408. },
  409. region: {
  410. name: "England",
  411. code: "ENG"
  412. }
  413. },
  414. "128.116.37.0": {
  415. city: "Miami",
  416. country: {
  417. name: "United States",
  418. code: "US"
  419. },
  420. region: {
  421. name: "Florida",
  422. code: "FL"
  423. }
  424. },
  425. "128.116.38.0": {
  426. city: "Miami",
  427. country: {
  428. name: "United States",
  429. code: "US"
  430. },
  431. region: {
  432. name: "Florida",
  433. code: "FL"
  434. }
  435. },
  436. "128.116.39.0": {
  437. city: "Frankfurt am Main",
  438. country: {
  439. name: "Germany",
  440. code: "DE"
  441. },
  442. region: {
  443. name: "Hessen",
  444. code: "HE"
  445. }
  446. },
  447. "128.116.40.0": {
  448. city: "Frankfurt am Main",
  449. country: {
  450. name: "Germany",
  451. code: "DE"
  452. },
  453. region: {
  454. name: "Hessen",
  455. code: "HE"
  456. }
  457. },
  458. "128.116.41.0": {
  459. city: "Frankfurt am Main",
  460. country: {
  461. name: "Germany",
  462. code: "DE"
  463. },
  464. region: {
  465. name: "Hessen",
  466. code: "HE"
  467. }
  468. },
  469. "128.116.42.0": {
  470. city: "Frankfurt am Main",
  471. country: {
  472. name: "Germany",
  473. code: "DE"
  474. },
  475. region: {
  476. name: "Hessen",
  477. code: "HE"
  478. }
  479. },
  480. "128.116.43.0": {
  481. city: "Frankfurt am Main",
  482. country: {
  483. name: "Germany",
  484. code: "DE"
  485. },
  486. region: {
  487. name: "Hessen",
  488. code: "HE"
  489. }
  490. },
  491. "128.116.44.0": {
  492. city: "Frankfurt am Main",
  493. country: {
  494. name: "Germany",
  495. code: "DE"
  496. },
  497. region: {
  498. name: "Hessen",
  499. code: "HE"
  500. }
  501. },
  502. "128.116.45.0": {
  503. city: "Miami",
  504. country: {
  505. name: "United States",
  506. code: "US"
  507. },
  508. region: {
  509. name: "Florida",
  510. code: "FL"
  511. }
  512. },
  513. "128.116.46.0": {
  514. city: "Chicago",
  515. country: {
  516. name: "United States",
  517. code: "US"
  518. },
  519. region: {
  520. name: "Illinois",
  521. code: "IL"
  522. }
  523. },
  524. "128.116.47.0": {
  525. city: "Chicago",
  526. country: {
  527. name: "United States",
  528. code: "US"
  529. },
  530. region: {
  531. name: "Illinois",
  532. code: "IL"
  533. }
  534. },
  535. "128.116.48.0": {
  536. city: "Chicago",
  537. country: {
  538. name: "United States",
  539. code: "US"
  540. },
  541. region: {
  542. name: "Illinois",
  543. code: "IL"
  544. }
  545. },
  546. "128.116.49.0": {
  547. city: "Los Angeles",
  548. country: {
  549. name: "United States",
  550. code: "US"
  551. },
  552. region: {
  553. name: "California",
  554. code: "CA"
  555. }
  556. },
  557. "128.116.50.0": {
  558. city: "Singapore",
  559. country: {
  560. name: "Singapore",
  561. code: "SG"
  562. }
  563. },
  564. "128.116.51.0": {
  565. city: "Sydney",
  566. country: {
  567. name: "Australia",
  568. code: "AU"
  569. },
  570. region: {
  571. name: "New South Wales",
  572. code: "NSW"
  573. }
  574. },
  575. "128.116.52.0": {
  576. city: "Ashburn",
  577. country: {
  578. name: "United States",
  579. code: "US"
  580. },
  581. region: {
  582. name: "Virginia",
  583. code: "VA"
  584. }
  585. },
  586. "128.116.53.0": {
  587. city: "Ashburn",
  588. country: {
  589. name: "United States",
  590. code: "US"
  591. },
  592. region: {
  593. name: "Virginia",
  594. code: "VA"
  595. }
  596. },
  597. "128.116.54.0": {
  598. city: "Amsterdam",
  599. country: {
  600. name: "Netherlands",
  601. code: "NL"
  602. },
  603. region: {
  604. name: "Noord-Holland",
  605. code: "NH"
  606. }
  607. },
  608. "128.116.55.0": {
  609. city: "Tokyo",
  610. country: {
  611. name: "Japan",
  612. code: "JP"
  613. },
  614. region: {
  615. name: "Tokyo",
  616. code: "13"
  617. }
  618. },
  619. "128.116.56.0": {
  620. city: "Ashburn",
  621. country: {
  622. name: "United States",
  623. code: "US"
  624. },
  625. region: {
  626. name: "Virginia",
  627. code: "VA"
  628. }
  629. },
  630. "128.116.57.0": {
  631. city: "San Jose",
  632. country: {
  633. name: "United States",
  634. code: "US"
  635. },
  636. region: {
  637. name: "California",
  638. code: "CA"
  639. }
  640. },
  641. "128.116.58.0": {
  642. city: "Tokyo",
  643. country: {
  644. name: "Japan",
  645. code: "JP"
  646. },
  647. region: {
  648. name: "Tokyo",
  649. code: "13"
  650. }
  651. },
  652. "128.116.59.0": {
  653. city: "Tokyo",
  654. country: {
  655. name: "Japan",
  656. code: "JP"
  657. },
  658. region: {
  659. name: "Tokyo",
  660. code: "13"
  661. }
  662. },
  663. "128.116.60.0": {
  664. city: "Tokyo",
  665. country: {
  666. name: "Japan",
  667. code: "JP"
  668. },
  669. region: {
  670. name: "Tokyo",
  671. code: "13"
  672. }
  673. },
  674. "128.116.61.0": {
  675. city: "San Mateo",
  676. country: {
  677. name: "United States",
  678. code: "US"
  679. },
  680. region: {
  681. name: "California",
  682. code: "CA"
  683. }
  684. },
  685. "128.116.62.0": {
  686. city: "Seattle",
  687. country: {
  688. name: "United States",
  689. code: "US"
  690. },
  691. region: {
  692. name: "Washington",
  693. code: "WA"
  694. }
  695. },
  696. "128.116.63.0": {
  697. city: "Los Angeles",
  698. country: {
  699. name: "United States",
  700. code: "US"
  701. },
  702. region: {
  703. name: "California",
  704. code: "CA"
  705. }
  706. },
  707. "128.116.64.0": {
  708. city: "San Mateo",
  709. country: {
  710. name: "United States",
  711. code: "US"
  712. },
  713. region: {
  714. name: "California",
  715. code: "CA"
  716. }
  717. },
  718. "128.116.65.0": {
  719. city: "Secaucus",
  720. country: {
  721. name: "United States",
  722. code: "US"
  723. },
  724. region: {
  725. name: "New Jersey",
  726. code: "NJ"
  727. }
  728. },
  729. "128.116.66.0": {
  730. city: "Secaucus",
  731. country: {
  732. name: "United States",
  733. code: "US"
  734. },
  735. region: {
  736. name: "New Jersey",
  737. code: "NJ"
  738. }
  739. },
  740. "128.116.67.0": {
  741. city: "San Jose",
  742. country: {
  743. name: "United States",
  744. code: "US"
  745. },
  746. region: {
  747. name: "California",
  748. code: "CA"
  749. }
  750. },
  751. "128.116.68.0": {
  752. city: "Santa Clara",
  753. country: {
  754. name: "United States",
  755. code: "US"
  756. },
  757. region: {
  758. name: "California",
  759. code: "CA"
  760. }
  761. },
  762. "128.116.69.0": {
  763. city: "Santa Clara",
  764. country: {
  765. name: "United States",
  766. code: "US"
  767. },
  768. region: {
  769. name: "California",
  770. code: "CA"
  771. }
  772. },
  773. "128.116.70.0": {
  774. city: "Ashburn",
  775. country: {
  776. name: "United States",
  777. code: "US"
  778. },
  779. region: {
  780. name: "Virginia",
  781. code: "VA"
  782. }
  783. },
  784. "128.116.71.0": {
  785. city: "Ashburn",
  786. country: {
  787. name: "United States",
  788. code: "US"
  789. },
  790. region: {
  791. name: "Virginia",
  792. code: "VA"
  793. }
  794. },
  795. "128.116.72.0": {
  796. city: "Slough",
  797. country: {
  798. name: "United Kingdom",
  799. code: "GB"
  800. },
  801. region: {
  802. name: "England",
  803. code: "ENG"
  804. }
  805. },
  806. "128.116.73.0": {
  807. city: "Slough",
  808. country: {
  809. name: "United Kingdom",
  810. code: "GB"
  811. },
  812. region: {
  813. name: "England",
  814. code: "ENG"
  815. }
  816. },
  817. "128.116.74.0": {
  818. city: "Ashburn",
  819. country: {
  820. name: "United States",
  821. code: "US"
  822. },
  823. region: {
  824. name: "Virginia",
  825. code: "VA"
  826. }
  827. },
  828. "128.116.75.0": {
  829. city: "Ashburn",
  830. country: {
  831. name: "United States",
  832. code: "US"
  833. },
  834. region: {
  835. name: "Virginia",
  836. code: "VA"
  837. }
  838. },
  839. "128.116.76.0": {
  840. city: "Ashburn",
  841. country: {
  842. name: "United States",
  843. code: "US"
  844. },
  845. region: {
  846. name: "Virginia",
  847. code: "VA"
  848. }
  849. },
  850. "128.116.77.0": {
  851. city: "Ashburn",
  852. country: {
  853. name: "United States",
  854. code: "US"
  855. },
  856. region: {
  857. name: "Virginia",
  858. code: "VA"
  859. }
  860. },
  861. "128.116.78.0": {
  862. city: "Ashburn",
  863. country: {
  864. name: "United States",
  865. code: "US"
  866. },
  867. region: {
  868. name: "Virginia",
  869. code: "VA"
  870. }
  871. },
  872. "128.116.79.0": {
  873. city: "Singapore",
  874. country: {
  875. name: "Singapore",
  876. code: "SG"
  877. }
  878. },
  879. "128.116.80.0": {
  880. city: "Ashburn",
  881. country: {
  882. name: "United States",
  883. code: "US"
  884. },
  885. region: {
  886. name: "Virginia",
  887. code: "VA"
  888. }
  889. },
  890. "128.116.81.0": {
  891. city: "Santa Clara",
  892. country: {
  893. name: "United States",
  894. code: "US"
  895. },
  896. region: {
  897. name: "California",
  898. code: "CA"
  899. }
  900. },
  901. "128.116.82.0": {
  902. city: "Tokyo",
  903. country: {
  904. name: "Japan",
  905. code: "JP"
  906. },
  907. region: {
  908. name: "Tokyo",
  909. code: "13"
  910. }
  911. },
  912. "128.116.83.0": {
  913. city: "Tokyo",
  914. country: {
  915. name: "Japan",
  916. code: "JP"
  917. },
  918. region: {
  919. name: "Tokyo",
  920. code: "13"
  921. }
  922. },
  923. "128.116.84.0": {
  924. city: "Elk Grove Village",
  925. country: {
  926. name: "United States",
  927. code: "US"
  928. },
  929. region: {
  930. name: "Illinois",
  931. code: "IL"
  932. }
  933. },
  934. "128.116.85.0": {
  935. city: "Miami",
  936. country: {
  937. name: "United States",
  938. code: "US"
  939. },
  940. region: {
  941. name: "Florida",
  942. code: "FL"
  943. }
  944. },
  945. "128.116.86.0": {
  946. city: "San Mateo",
  947. country: {
  948. name: "United States",
  949. code: "US"
  950. },
  951. region: {
  952. name: "California",
  953. code: "CA"
  954. }
  955. },
  956. "128.116.87.0": {
  957. city: "Ashburn",
  958. country: {
  959. name: "United States",
  960. code: "US"
  961. },
  962. region: {
  963. name: "Virginia",
  964. code: "VA"
  965. }
  966. },
  967. "128.116.88.0": {
  968. city: "Elk Grove Village",
  969. country: {
  970. name: "United States",
  971. code: "US"
  972. },
  973. region: {
  974. name: "Illinois",
  975. code: "IL"
  976. }
  977. },
  978. "128.116.89.0": {
  979. city: "Slough",
  980. country: {
  981. name: "United Kingdom",
  982. code: "GB"
  983. },
  984. region: {
  985. name: "England",
  986. code: "ENG"
  987. }
  988. },
  989. "128.116.90.0": {
  990. city: "San Mateo",
  991. country: {
  992. name: "United States",
  993. code: "US"
  994. },
  995. region: {
  996. name: "California",
  997. code: "CA"
  998. }
  999. },
  1000. "128.116.91.0": {
  1001. city: "San Mateo",
  1002. country: {
  1003. name: "United States",
  1004. code: "US"
  1005. },
  1006. region: {
  1007. name: "California",
  1008. code: "CA"
  1009. }
  1010. },
  1011. "128.116.92.0": {
  1012. city: "San Mateo",
  1013. country: {
  1014. name: "United States",
  1015. code: "US"
  1016. },
  1017. region: {
  1018. name: "California",
  1019. code: "CA"
  1020. }
  1021. },
  1022. "128.116.93.0": {
  1023. city: "San Mateo",
  1024. country: {
  1025. name: "United States",
  1026. code: "US"
  1027. },
  1028. region: {
  1029. name: "California",
  1030. code: "CA"
  1031. }
  1032. },
  1033. "128.116.94.0": {
  1034. city: "San Mateo",
  1035. country: {
  1036. name: "United States",
  1037. code: "US"
  1038. },
  1039. region: {
  1040. name: "California",
  1041. code: "CA"
  1042. }
  1043. },
  1044. "128.116.95.0": {
  1045. city: "Dallas",
  1046. country: {
  1047. name: "United States",
  1048. code: "US"
  1049. },
  1050. region: {
  1051. name: "Texas",
  1052. code: "TX"
  1053. }
  1054. },
  1055. "128.116.96.0": {
  1056. city: "Ashburn",
  1057. country: {
  1058. name: "United States",
  1059. code: "US"
  1060. },
  1061. region: {
  1062. name: "Virginia",
  1063. code: "VA"
  1064. }
  1065. },
  1066. "128.116.97.0": {
  1067. city: "Singapore",
  1068. country: {
  1069. name: "Singapore",
  1070. code: "SG"
  1071. }
  1072. },
  1073. "128.116.98.0": {
  1074. city: "San Mateo",
  1075. country: {
  1076. name: "United States",
  1077. code: "US"
  1078. },
  1079. region: {
  1080. name: "California",
  1081. code: "CA"
  1082. }
  1083. },
  1084. "128.116.99.0": {
  1085. city: "Atlanta",
  1086. country: {
  1087. name: "United States",
  1088. code: "US"
  1089. },
  1090. region: {
  1091. name: "Georgia",
  1092. code: "GA"
  1093. }
  1094. },
  1095. "128.116.100.0": {
  1096. city: "San Mateo",
  1097. country: {
  1098. name: "United States",
  1099. code: "US"
  1100. },
  1101. region: {
  1102. name: "California",
  1103. code: "CA"
  1104. }
  1105. },
  1106. "128.116.101.0": {
  1107. city: "Chicago",
  1108. country: {
  1109. name: "United States",
  1110. code: "US"
  1111. },
  1112. region: {
  1113. name: "Illinois",
  1114. code: "IL"
  1115. }
  1116. },
  1117. "128.116.102.0": {
  1118. city: "Ashburn",
  1119. country: {
  1120. name: "United States",
  1121. code: "US"
  1122. },
  1123. region: {
  1124. name: "Virginia",
  1125. code: "VA"
  1126. }
  1127. },
  1128. "128.116.103.0": {
  1129. city: "San Mateo",
  1130. country: {
  1131. name: "United States",
  1132. code: "US"
  1133. },
  1134. region: {
  1135. name: "California",
  1136. code: "CA"
  1137. }
  1138. },
  1139. "128.116.104.0": {
  1140. city: "Mumbai",
  1141. country: {
  1142. name: "India",
  1143. code: "IN"
  1144. },
  1145. region: {
  1146. name: "Mahārāshtra",
  1147. code: "MH"
  1148. }
  1149. },
  1150. "128.116.105.0": {
  1151. city: "Santa Clara",
  1152. country: {
  1153. name: "United States",
  1154. code: "US"
  1155. },
  1156. region: {
  1157. name: "California",
  1158. code: "CA"
  1159. }
  1160. },
  1161. "128.116.106.0": {
  1162. city: "San Mateo",
  1163. country: {
  1164. name: "United States",
  1165. code: "US"
  1166. },
  1167. region: {
  1168. name: "California",
  1169. code: "CA"
  1170. }
  1171. },
  1172. "128.116.107.0": {
  1173. city: "San Mateo",
  1174. country: {
  1175. name: "United States",
  1176. code: "US"
  1177. },
  1178. region: {
  1179. name: "California",
  1180. code: "CA"
  1181. }
  1182. },
  1183. "128.116.108.0": {
  1184. city: "San Mateo",
  1185. country: {
  1186. name: "United States",
  1187. code: "US"
  1188. },
  1189. region: {
  1190. name: "California",
  1191. code: "CA"
  1192. }
  1193. },
  1194. "128.116.109.0": {
  1195. city: "San Mateo",
  1196. country: {
  1197. name: "United States",
  1198. code: "US"
  1199. },
  1200. region: {
  1201. name: "California",
  1202. code: "CA"
  1203. }
  1204. },
  1205. "128.116.110.0": {
  1206. city: "San Mateo",
  1207. country: {
  1208. name: "United States",
  1209. code: "US"
  1210. },
  1211. region: {
  1212. name: "California",
  1213. code: "CA"
  1214. }
  1215. },
  1216. "128.116.111.0": {
  1217. city: "San Mateo",
  1218. country: {
  1219. name: "United States",
  1220. code: "US"
  1221. },
  1222. region: {
  1223. name: "California",
  1224. code: "CA"
  1225. }
  1226. },
  1227. "128.116.112.0": {
  1228. city: "Chicago",
  1229. country: {
  1230. name: "United States",
  1231. code: "US"
  1232. },
  1233. region: {
  1234. name: "Illinois",
  1235. code: "IL"
  1236. }
  1237. },
  1238. "128.116.113.0": {
  1239. city: "Chicago",
  1240. country: {
  1241. name: "United States",
  1242. code: "US"
  1243. },
  1244. region: {
  1245. name: "Illinois",
  1246. code: "IL"
  1247. }
  1248. },
  1249. "128.116.114.0": {
  1250. city: "Ashburn",
  1251. country: {
  1252. name: "United States",
  1253. code: "US"
  1254. },
  1255. region: {
  1256. name: "Virginia",
  1257. code: "VA"
  1258. }
  1259. },
  1260. "128.116.115.0": {
  1261. city: "Seattle",
  1262. country: {
  1263. name: "United States",
  1264. code: "US"
  1265. },
  1266. region: {
  1267. name: "Washington",
  1268. code: "WA"
  1269. }
  1270. },
  1271. "128.116.116.0": {
  1272. city: "Los Angeles",
  1273. country: {
  1274. name: "United States",
  1275. code: "US"
  1276. },
  1277. region: {
  1278. name: "California",
  1279. code: "CA"
  1280. }
  1281. },
  1282. "128.116.117.0": {
  1283. city: "San Jose",
  1284. country: {
  1285. name: "United States",
  1286. code: "US"
  1287. },
  1288. region: {
  1289. name: "California",
  1290. code: "CA"
  1291. }
  1292. },
  1293. "128.116.118.0": {
  1294. city: "Hong Kong",
  1295. country: {
  1296. name: "Hong Kong",
  1297. code: "HK"
  1298. }
  1299. },
  1300. "128.116.119.0": {
  1301. city: "Slough",
  1302. country: {
  1303. name: "United Kingdom",
  1304. code: "GB"
  1305. },
  1306. region: {
  1307. name: "England",
  1308. code: "ENG"
  1309. }
  1310. },
  1311. "128.116.120.0": {
  1312. city: "Tokyo",
  1313. country: {
  1314. name: "Japan",
  1315. code: "JP"
  1316. },
  1317. region: {
  1318. name: "Tokyo",
  1319. code: "13"
  1320. }
  1321. },
  1322. "128.116.121.0": {
  1323. city: "Amsterdam",
  1324. country: {
  1325. name: "Netherlands",
  1326. code: "NL"
  1327. },
  1328. region: {
  1329. name: "Noord-Holland",
  1330. code: "NH"
  1331. }
  1332. },
  1333. "128.116.122.0": {
  1334. city: "Paris",
  1335. country: {
  1336. name: "France",
  1337. code: "FR"
  1338. },
  1339. region: {
  1340. name: "Île-de-France",
  1341. code: "IDF"
  1342. }
  1343. },
  1344. "128.116.123.0": {
  1345. city: "Frankfurt am Main",
  1346. country: {
  1347. name: "Germany",
  1348. code: "DE"
  1349. },
  1350. region: {
  1351. name: "Hessen",
  1352. code: "HE"
  1353. }
  1354. },
  1355. "128.116.124.0": {
  1356. city: "Warsaw",
  1357. country: {
  1358. name: "Poland",
  1359. code: "PL"
  1360. },
  1361. region: {
  1362. name: "Mazowieckie",
  1363. code: "14"
  1364. }
  1365. },
  1366. "128.116.125.0": {
  1367. city: "San Mateo",
  1368. country: {
  1369. name: "United States",
  1370. code: "US"
  1371. },
  1372. region: {
  1373. name: "California",
  1374. code: "CA"
  1375. }
  1376. },
  1377. "128.116.126.0": {
  1378. city: "Secaucus",
  1379. country: {
  1380. name: "United States",
  1381. code: "US"
  1382. },
  1383. region: {
  1384. name: "New Jersey",
  1385. code: "NJ"
  1386. }
  1387. },
  1388. "128.116.127.0": {
  1389. city: "Miami",
  1390. country: {
  1391. name: "United States",
  1392. code: "US"
  1393. },
  1394. region: {
  1395. name: "Florida",
  1396. code: "FL"
  1397. }
  1398. },
  1399. };
  1400.  
  1401.  
  1402. // Inject CSS styles into the page
  1403. const style = document.createElement('style');
  1404. style.textContent = `
  1405. /* Overlay for the popup */
  1406. .overlay {
  1407. position: fixed;
  1408. top: 0;
  1409. left: 0;
  1410. width: 100%;
  1411. height: 100%;
  1412. background-color: rgba(0, 0, 0, 0.7);
  1413. z-index: 1000;
  1414. }
  1415.  
  1416. /* Popup Container for the server region */
  1417. .filter-popup {
  1418. background-color: #2d2d2d;
  1419. color: #ffffff;
  1420. padding: 20px;
  1421. border-radius: 10px;
  1422. box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  1423. width: 300px;
  1424. max-width: 90%;
  1425. position: fixed;
  1426. top: 50%;
  1427. left: 50%;
  1428. transform: translate(-50%, -50%);
  1429. text-align: center;
  1430. z-index: 1001;
  1431. }
  1432.  
  1433. /* Close Button for the server selector */
  1434. #closePopup {
  1435. position: absolute;
  1436. top: 10px;
  1437. right: 10px;
  1438. background: #ff4444;
  1439. border: none;
  1440. color: white;
  1441. font-size: 16px;
  1442. cursor: pointer;
  1443. width: 24px;
  1444. height: 24px;
  1445. border-radius: 50%;
  1446. display: flex;
  1447. align-items: center;
  1448. justify-content: center;
  1449. }
  1450.  
  1451. #closePopup:hover {
  1452. background: #cc0000;
  1453. }
  1454.  
  1455. /* Label */
  1456. .filter-popup label {
  1457. display: block;
  1458. margin-bottom: 10px;
  1459. font-size: 16px;
  1460. color: #ffffff;
  1461. }
  1462.  
  1463. /* Dropdown */
  1464. .filter-popup select {
  1465. background-color: #444;
  1466. color: #ffffff;
  1467. padding: 8px;
  1468. border-radius: 5px;
  1469. border: 1px solid #666;
  1470. width: 100%;
  1471. margin-bottom: 10px;
  1472. font-size: 14px;
  1473. }
  1474.  
  1475. .filter-popup select:focus {
  1476. border-color: #888;
  1477. outline: none;
  1478. }
  1479.  
  1480. /* Custom Input */
  1481. .filter-popup input[type="number"] {
  1482. background-color: #444;
  1483. color: #ffffff;
  1484. padding: 8px;
  1485. border-radius: 5px;
  1486. border: 1px solid #666;
  1487. width: 100%;
  1488. margin-bottom: 10px;
  1489. font-size: 14px;
  1490. }
  1491.  
  1492. .filter-popup input[type="number"]:focus {
  1493. border-color: #888;
  1494. outline: none;
  1495. }
  1496.  
  1497. /* Confirm Button */
  1498. #confirmServerCount {
  1499. background-color: #444;
  1500. color: #ffffff;
  1501. padding: 8px 16px;
  1502. border: 1px solid #666;
  1503. border-radius: 5px;
  1504. cursor: pointer;
  1505. font-size: 14px;
  1506. width: 100%;
  1507. transition: background-color 0.3s ease;
  1508. }
  1509.  
  1510. #confirmServerCount:hover {
  1511. background-color: #666;
  1512. }
  1513. .rbx-game-server-item.highlighted {
  1514. border: 2px solid green;
  1515. border-radius: 8px;
  1516. }
  1517. .fetch-button:disabled {
  1518. opacity: 0.5;
  1519. cursor: not-allowed;
  1520. }
  1521. `;
  1522. document.head.appendChild(style);
  1523.  
  1524. function showMessage(message) {
  1525. const serverListContainer = document.getElementById("rbx-game-server-item-container");
  1526. if (!serverListContainer) {
  1527. console.error("Server list container not found!");
  1528. return;
  1529. }
  1530.  
  1531. const messageElement = document.createElement('div');
  1532. messageElement.className = 'filter-message';
  1533. messageElement.textContent = message;
  1534.  
  1535. serverListContainer.innerHTML = ''; // Clear the container
  1536. serverListContainer.appendChild(messageElement);
  1537.  
  1538. return messageElement;
  1539. }
  1540.  
  1541. function hideMessage() {
  1542. const messageElement = document.querySelector('.filter-message');
  1543. if (messageElement) messageElement.remove();
  1544. }
  1545.  
  1546. function showPopup() {
  1547. const overlay = document.createElement('div');
  1548. overlay.className = 'overlay';
  1549.  
  1550. const popup = document.createElement('div');
  1551. popup.className = 'filter-popup';
  1552. popup.textContent = 'Filtering servers, please wait...';
  1553.  
  1554. document.body.appendChild(overlay);
  1555. document.body.appendChild(popup);
  1556.  
  1557. return popup;
  1558. }
  1559.  
  1560. function hidePopup() {
  1561. const popup = document.querySelector('.filter-popup');
  1562. const overlay = document.querySelector('.overlay');
  1563.  
  1564. if (popup) popup.remove();
  1565. if (overlay) overlay.remove();
  1566. }
  1567.  
  1568. async function fetchServerDetails(gameId, jobId) {
  1569. return new Promise((resolve, reject) => {
  1570. GM_xmlhttpRequest({
  1571. method: "POST",
  1572. url: "https://gamejoin.roblox.com/v1/join-game-instance",
  1573. headers: {
  1574. "Content-Type": "application/json",
  1575. "User-Agent": "Roblox/WinInet",
  1576. },
  1577. data: JSON.stringify({
  1578. placeId: gameId,
  1579. gameId: jobId
  1580. }),
  1581. onload: function(response) {
  1582. const json = JSON.parse(response.responseText);
  1583.  
  1584. if (json.status === 12 && json.message === 'You need to purchase access to this game before you can play.') {
  1585. reject('purchase_required');
  1586. return;
  1587. }
  1588.  
  1589. const address = json?.joinScript?.UdmuxEndpoints?.[0]?.Address ?? json?.joinScript?.MachineAddress;
  1590.  
  1591. if (!address) {
  1592. console.error("API Response (Unknown Location):", json);
  1593. reject(`Unable to fetch server location: Status ${json.status}`);
  1594. return;
  1595. }
  1596.  
  1597. const location = serverRegionsByIp[address.replace(/^(128\.116\.\d+)\.\d+$/, "$1.0")];
  1598.  
  1599. if (!location) {
  1600. console.error("API Response (Unknown Location):", json);
  1601. reject(`Unknown server address ${address}`);
  1602. return;
  1603. }
  1604.  
  1605. resolve(location);
  1606. },
  1607. onerror: function(error) {
  1608. console.error("API Request Failed:", error);
  1609. reject(`Failed to fetch server details: ${error}`);
  1610. },
  1611. });
  1612. });
  1613. }
  1614.  
  1615. function delay(ms) {
  1616. return new Promise(resolve => setTimeout(resolve, ms));
  1617. }
  1618.  
  1619. function createServerCountPopup(callback) {
  1620. const overlay = document.createElement('div');
  1621. overlay.className = 'overlay';
  1622.  
  1623. const popup = document.createElement('div');
  1624. popup.className = 'filter-popup';
  1625. popup.innerHTML = `
  1626. <button id="closePopup">X</button>
  1627. <label for="serverCount">Enter the number of servers to search:</label>
  1628. <select id="serverCount">
  1629. <option value="10">10 Servers</option>
  1630. <option value="25">25 Servers</option>
  1631. <option value="50">50 Servers</option>
  1632. <option value="100" selected>100 Servers</option>
  1633. <option value="200">200 Servers</option>
  1634. <option value="500">500 Servers</option>
  1635. <option value="1000">1000 Servers</option>
  1636. <option value="custom">Custom</option>
  1637. </select>
  1638. <input id="customServerCount" type="number" min="1" max="1000" placeholder="Enter a number (1-1000)" style="display: none;">
  1639. <button id="confirmServerCount">Confirm</button>
  1640. `;
  1641.  
  1642. document.body.appendChild(overlay);
  1643. document.body.appendChild(popup);
  1644.  
  1645. const serverCountDropdown = popup.querySelector('#serverCount');
  1646. const customServerCountInput = popup.querySelector('#customServerCount');
  1647. const confirmButton = popup.querySelector('#confirmServerCount');
  1648. const closeButton = popup.querySelector('#closePopup');
  1649.  
  1650. serverCountDropdown.addEventListener('change', () => {
  1651. if (serverCountDropdown.value === 'custom') {
  1652. customServerCountInput.style.display = 'block';
  1653. } else {
  1654. customServerCountInput.style.display = 'none';
  1655. }
  1656. });
  1657.  
  1658. confirmButton.addEventListener('click', () => {
  1659. let serverCount;
  1660.  
  1661. if (serverCountDropdown.value === 'custom') {
  1662. serverCount = parseInt(customServerCountInput.value);
  1663. if (isNaN(serverCount) || serverCount < 1 || serverCount > 1000) {
  1664. alert("Please enter a valid number between 1 and 1000.");
  1665. return;
  1666. }
  1667. } else {
  1668. serverCount = parseInt(serverCountDropdown.value);
  1669. }
  1670.  
  1671. if (serverCount > 100) {
  1672. alert("Warning: Searching over 100 servers may take some time and you might be rate limited!");
  1673. }
  1674.  
  1675. callback(serverCount);
  1676. hidePopup();
  1677. });
  1678.  
  1679. closeButton.addEventListener('click', () => {
  1680. hidePopup();
  1681. });
  1682.  
  1683. function hidePopup() {
  1684. document.body.removeChild(overlay);
  1685. document.body.removeChild(popup);
  1686. }
  1687. }
  1688.  
  1689. async function fetchPublicServers(gameId, totalLimit) {
  1690. let servers = [];
  1691. let cursor = null;
  1692.  
  1693. while (servers.length < totalLimit) {
  1694. const url = `https://games.roblox.com/v1/games/${gameId}/servers/public?excludeFullGames=true&limit=100${cursor ? `&cursor=${cursor}` : ''}`;
  1695.  
  1696. const response = await new Promise((resolve, reject) => {
  1697. GM_xmlhttpRequest({
  1698. method: "GET",
  1699. url: url,
  1700. onload: function(response) {
  1701. resolve(JSON.parse(response.responseText));
  1702. },
  1703. onerror: function(error) {
  1704. reject(`Failed to fetch public servers: ${error}`);
  1705. },
  1706. });
  1707. });
  1708.  
  1709. servers = servers.concat(response.data);
  1710.  
  1711. if (!response.nextPageCursor || servers.length >= totalLimit) {
  1712. break;
  1713. }
  1714.  
  1715. cursor = response.nextPageCursor;
  1716. await delay(5000); // Wait 5 seconds between page requests to avoid rate limiting
  1717. }
  1718.  
  1719. return servers.slice(0, totalLimit);
  1720. }
  1721.  
  1722. function createFilterDropdowns(servers) {
  1723. const filterContainer = document.createElement('div');
  1724. filterContainer.className = 'filter-container';
  1725.  
  1726. const countryDropdown = document.createElement('select');
  1727. countryDropdown.id = 'countryFilter';
  1728. countryDropdown.innerHTML = '<option value="">All Countries</option>';
  1729. countryDropdown.style.backgroundColor = '#333';
  1730. countryDropdown.style.color = '#fff';
  1731. countryDropdown.style.borderRadius = '8px';
  1732. countryDropdown.style.padding = '8px';
  1733. countryDropdown.style.fontSize = '16px';
  1734. countryDropdown.style.border = 'none';
  1735.  
  1736. const cityDropdown = document.createElement('select');
  1737. cityDropdown.id = 'cityFilter';
  1738. cityDropdown.innerHTML = '<option value="">All Cities</option>';
  1739. cityDropdown.style.backgroundColor = '#333';
  1740. cityDropdown.style.color = '#fff';
  1741. cityDropdown.style.borderRadius = '8px';
  1742. cityDropdown.style.padding = '8px';
  1743. cityDropdown.style.fontSize = '16px';
  1744. cityDropdown.style.border = 'none';
  1745. cityDropdown.style.marginLeft = '5px';
  1746.  
  1747. const countryCounts = {};
  1748. servers.forEach(server => {
  1749. const country = server.location.country.name;
  1750. countryCounts[country] = (countryCounts[country] || 0) + 1;
  1751. });
  1752.  
  1753. Object.keys(countryCounts).forEach(country => {
  1754. const option = document.createElement('option');
  1755. option.value = country;
  1756. option.textContent = `${country} (${countryCounts[country]})`;
  1757. countryDropdown.appendChild(option);
  1758. });
  1759.  
  1760. countryDropdown.addEventListener('change', () => {
  1761. const selectedCountry = countryDropdown.value;
  1762. cityDropdown.innerHTML = '<option value="">All Cities</option>';
  1763.  
  1764. if (selectedCountry) {
  1765. const cityCounts = {};
  1766. servers
  1767. .filter(server => server.location.country.name === selectedCountry)
  1768. .forEach(server => {
  1769. const city = server.location.city;
  1770. const region = server.location.region?.name;
  1771. const cityKey = region ? `${city}, ${region}` : city;
  1772. cityCounts[cityKey] = (cityCounts[cityKey] || 0) + 1;
  1773. });
  1774.  
  1775. Object.keys(cityCounts).forEach(city => {
  1776. const option = document.createElement('option');
  1777. option.value = city;
  1778. option.textContent = `${city} (${cityCounts[city]})`;
  1779. cityDropdown.appendChild(option);
  1780. });
  1781.  
  1782. const cities = Object.keys(cityCounts);
  1783. if (cities.length === 1) {
  1784. cityDropdown.value = cities[0];
  1785. displayFilteredServers(selectedCountry, cities[0]);
  1786. }
  1787. }
  1788. });
  1789.  
  1790. filterContainer.appendChild(countryDropdown);
  1791. filterContainer.appendChild(cityDropdown);
  1792.  
  1793. return filterContainer;
  1794. }
  1795.  
  1796. function filterServers(servers, country, city) {
  1797. return servers.filter(server => {
  1798. const matchesCountry = !country || server.location.country.name === country;
  1799. const matchesCity = !city || `${server.location.city}${server.location.region?.name ? `, ${server.location.region.name}` : ''}` === city;
  1800. return matchesCountry && matchesCity;
  1801. });
  1802. }
  1803.  
  1804. function sortServersByPing(servers) {
  1805. return servers.sort((a, b) => a.server.ping - b.server.ping);
  1806. }
  1807.  
  1808. async function fetchPlayerThumbnails(playerTokens) {
  1809. const body = playerTokens.map(token => ({
  1810. requestId: `0:${token}:AvatarHeadshot:150x150:png:regular`,
  1811. type: "AvatarHeadShot",
  1812. targetId: 0,
  1813. token,
  1814. format: "png",
  1815. size: "150x150",
  1816. }));
  1817.  
  1818. const response = await fetch("https://thumbnails.roblox.com/v1/batch", {
  1819. method: "POST",
  1820. headers: {
  1821. "Content-Type": "application/json",
  1822. Accept: "application/json",
  1823. },
  1824. body: JSON.stringify(body),
  1825. });
  1826.  
  1827. const data = await response.json();
  1828. return data.data || [];
  1829. }
  1830.  
  1831. async function rebuildServerList(gameId, fetchButton, totalLimit) {
  1832. const serverListContainer = document.getElementById("rbx-game-server-item-container");
  1833. if (!serverListContainer) {
  1834. console.error("Server list container not found!");
  1835. return;
  1836. }
  1837.  
  1838. const messageElement = showMessage("Filtering servers, please wait...");
  1839. fetchButton.disabled = true;
  1840.  
  1841. try {
  1842. const servers = await fetchPublicServers(gameId, totalLimit);
  1843. const totalServers = servers.length;
  1844. let skippedServers = 0;
  1845.  
  1846. messageElement.textContent = `Filtering servers, please do not leave this page...\n${totalServers} servers found, 0 servers loaded.`;
  1847.  
  1848. const serverDetails = [];
  1849. for (let i = 0; i < servers.length; i++) {
  1850. const server = servers[i];
  1851. const {
  1852. id: serverId,
  1853. maxPlayers,
  1854. playing,
  1855. ping,
  1856. fps,
  1857. playerTokens
  1858. } = server;
  1859.  
  1860. let location;
  1861. try {
  1862. location = await fetchServerDetails(gameId, serverId);
  1863. } catch (error) {
  1864. if (error === 'purchase_required') {
  1865. messageElement.textContent = "Cannot access server data because you haven't purchased the game.";
  1866. return;
  1867. } else {
  1868. console.error(error);
  1869. location = {
  1870. city: "Unknown",
  1871. country: {
  1872. name: "Unknown",
  1873. code: "??"
  1874. }
  1875. };
  1876. }
  1877. }
  1878.  
  1879. if (location.city === "Unknown" || playing >= maxPlayers) {
  1880. console.log(`Skipping server ${serverId} because it is full or location is unknown.`);
  1881. skippedServers++;
  1882. continue;
  1883. }
  1884.  
  1885. const playerThumbnails = playerTokens && playerTokens.length > 0 ? await fetchPlayerThumbnails(playerTokens) : [];
  1886.  
  1887. serverDetails.push({
  1888. server,
  1889. location,
  1890. playerThumbnails
  1891. });
  1892.  
  1893. messageElement.textContent = `Filtering servers, please do not leave this page...\n${totalServers} servers found, ${i + 1} server locations found`;
  1894. }
  1895.  
  1896. const loadedServers = totalServers - skippedServers;
  1897. messageElement.textContent = `Filtering complete!\n${totalServers} servers found, ${loadedServers} servers loaded, ${skippedServers} servers skipped (full).`;
  1898.  
  1899. const filterContainer = createFilterDropdowns(serverDetails);
  1900. serverListContainer.parentNode.insertBefore(filterContainer, serverListContainer);
  1901.  
  1902. serverListContainer.style.display = "grid";
  1903. serverListContainer.style.gridTemplateColumns = "repeat(4, 1fr)";
  1904. serverListContainer.style.gap = "16px";
  1905.  
  1906. const displayFilteredServers = (country, city) => {
  1907. serverListContainer.innerHTML = "";
  1908.  
  1909. const filteredServers = filterServers(serverDetails, country, city);
  1910. const sortedServers = sortServersByPing(filteredServers);
  1911.  
  1912. sortedServers.forEach(({ server, location, playerThumbnails }) => {
  1913. const serverCard = document.createElement("li");
  1914. serverCard.className = "rbx-game-server-item col-md-3 col-sm-4 col-xs-6";
  1915. serverCard.style.width = "100%";
  1916. serverCard.style.minHeight = "400px";
  1917. serverCard.style.display = "flex";
  1918. serverCard.style.flexDirection = "column";
  1919. serverCard.style.justifyContent = "space-between";
  1920. serverCard.style.boxSizing = "border-box";
  1921. serverCard.style.outline = 'none';
  1922.  
  1923. let outlineColor;
  1924. if (server.ping < 100) {
  1925. outlineColor = 'green';
  1926. } else if (server.ping < 200) {
  1927. outlineColor = 'orange';
  1928. } else {
  1929. outlineColor = 'red';
  1930. }
  1931.  
  1932. serverCard.style.outline = `3px solid ${outlineColor}`;
  1933. serverCard.style.outlineOffset = '-6px';
  1934. serverCard.style.padding = '6px';
  1935. serverCard.style.borderRadius = '8px';
  1936.  
  1937. const thumbnailsContainer = document.createElement("div");
  1938. thumbnailsContainer.className = "player-thumbnails-container";
  1939. thumbnailsContainer.style.display = "grid";
  1940. thumbnailsContainer.style.gridTemplateColumns = "repeat(3, 60px)";
  1941. thumbnailsContainer.style.gridTemplateRows = "repeat(2, 60px)";
  1942. thumbnailsContainer.style.gap = "5px";
  1943. thumbnailsContainer.style.marginBottom = "10px";
  1944.  
  1945. const maxThumbnails = 5;
  1946. const displayedThumbnails = playerThumbnails.slice(0, maxThumbnails);
  1947. displayedThumbnails.forEach(thumb => {
  1948. if (thumb && thumb.imageUrl) {
  1949. const img = document.createElement("img");
  1950. img.src = thumb.imageUrl;
  1951. img.className = "avatar-card-image";
  1952. img.style.width = "60px";
  1953. img.style.height = "60px";
  1954. img.style.borderRadius = "50%";
  1955. thumbnailsContainer.appendChild(img);
  1956. }
  1957. });
  1958.  
  1959. const hiddenPlayers = server.playing - displayedThumbnails.length;
  1960. if (hiddenPlayers > 0) {
  1961. const placeholder = document.createElement("div");
  1962. placeholder.className = "avatar-card-image";
  1963. placeholder.style.width = "60px";
  1964. placeholder.style.height = "60px";
  1965. placeholder.style.borderRadius = "50%";
  1966. placeholder.style.backgroundColor = "#BDBEBE80";
  1967. placeholder.style.display = "flex";
  1968. placeholder.style.alignItems = "center";
  1969. placeholder.style.justifyContent = "center";
  1970. placeholder.style.color = "#fff";
  1971. placeholder.style.fontSize = "14px";
  1972. placeholder.textContent = `+${hiddenPlayers}`;
  1973. thumbnailsContainer.appendChild(placeholder);
  1974. }
  1975.  
  1976. const cardItem = document.createElement("div");
  1977. cardItem.className = "card-item";
  1978. cardItem.style.display = "flex";
  1979. cardItem.style.flexDirection = "column";
  1980. cardItem.style.justifyContent = "space-between";
  1981. cardItem.style.height = "100%";
  1982.  
  1983. cardItem.innerHTML = `
  1984. ${thumbnailsContainer.outerHTML}
  1985. <div class="rbx-game-server-details game-server-details">
  1986. <div class="text-info rbx-game-status rbx-game-server-status text-overflow">
  1987. ${server.playing} of ${server.maxPlayers} people max
  1988. </div>
  1989. <div class="server-player-count-gauge border">
  1990. <div class="gauge-inner-bar border" style="width: ${(server.playing / server.maxPlayers) * 100}%;"></div>
  1991. </div>
  1992. <span data-placeid="${gameId}">
  1993. <button type="button" class="btn-full-width btn-control-xs rbx-game-server-join game-server-join-btn btn-primary-md btn-min-width">Join</button>
  1994. </span>
  1995. </div>
  1996. <div style="margin-top: 10px; text-align: center;">
  1997. <div class="ping-info">Ping: ${server.ping}ms</div>
  1998. <div class="location-info">${location.city}, ${location.country.name}</div>
  1999. <div class="fps-info">FPS: ${Math.round(server.fps)}</div>
  2000. </div>
  2001. `;
  2002.  
  2003. const joinButton = cardItem.querySelector(".rbx-game-server-join");
  2004. joinButton.addEventListener("click", () => {
  2005. window.open(`https://oqarshi.github.io/Invite/?placeid=${gameId}&serverid=${server.id}`, "_blank");
  2006. });
  2007.  
  2008. const container = adjustJoinButtonContainer(joinButton);
  2009. const inviteButton = createInviteButton(gameId, server.id);
  2010. container.appendChild(inviteButton);
  2011.  
  2012. serverCard.appendChild(cardItem);
  2013. serverListContainer.appendChild(serverCard);
  2014. });
  2015. };
  2016.  
  2017. const countryFilter = document.getElementById('countryFilter');
  2018. const cityFilter = document.getElementById('cityFilter');
  2019.  
  2020. countryFilter.addEventListener('change', () => {
  2021. displayFilteredServers(countryFilter.value, cityFilter.value);
  2022. });
  2023.  
  2024. cityFilter.addEventListener('change', () => {
  2025. displayFilteredServers(countryFilter.value, cityFilter.value);
  2026. });
  2027.  
  2028. displayFilteredServers("", "");
  2029.  
  2030. setTimeout(() => {
  2031. hideMessage();
  2032. }, 3000);
  2033. } catch (error) {
  2034. console.error("Error rebuilding server list:", error);
  2035. messageElement.textContent = "An error occurred while filtering servers. Please try again.";
  2036. } finally {
  2037. fetchButton.disabled = false;
  2038. }
  2039. }
  2040.  
  2041. function createInviteButton(placeId, serverId) {
  2042. const inviteButton = document.createElement('button');
  2043. inviteButton.textContent = 'Invite';
  2044. inviteButton.className = 'btn-control-xs btn-primary-md btn-min-width btn-full-width';
  2045. inviteButton.style.width = '25%';
  2046. inviteButton.style.marginLeft = '5px';
  2047.  
  2048. inviteButton.style.padding = '4px 8px';
  2049. inviteButton.style.fontSize = '12px';
  2050. inviteButton.style.borderRadius = '8px';
  2051. inviteButton.style.backgroundColor = '#393b3d';
  2052. inviteButton.style.borderColor = '#bdbebe';
  2053. inviteButton.style.color = '#bdbebe';
  2054. inviteButton.style.cursor = 'pointer';
  2055. inviteButton.style.fontWeight = '500';
  2056. inviteButton.style.textAlign = 'center';
  2057. inviteButton.style.whiteSpace = 'nowrap';
  2058. inviteButton.style.verticalAlign = 'middle';
  2059. inviteButton.style.lineHeight = '100%';
  2060. inviteButton.style.fontFamily = 'Builder Sans, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif';
  2061. inviteButton.style.textRendering = 'auto';
  2062. inviteButton.style.webkitFontSmoothing = 'antialiased';
  2063. inviteButton.style.mozOsxFontSmoothing = 'grayscale';
  2064.  
  2065. inviteButton.addEventListener('mouseenter', () => {
  2066. inviteButton.style.color = '#ffffff';
  2067. inviteButton.style.borderColor = '#ffffff';
  2068. });
  2069. inviteButton.addEventListener('mouseleave', () => {
  2070. inviteButton.style.color = '#bdbebe';
  2071. inviteButton.style.borderColor = '#bdbebe';
  2072. });
  2073.  
  2074. inviteButton.addEventListener('click', () => {
  2075. const inviteLink = `https://oqarshi.github.io/Invite/?placeid=${placeId}&serverid=${serverId}`;
  2076. navigator.clipboard.writeText(inviteLink).then(() => {
  2077. console.log(`Invite link copied to clipboard: ${inviteLink}`);
  2078. const popup = showPopup();
  2079. popup.textContent = 'Invite link copied to clipboard!';
  2080. setTimeout(() => {
  2081. hidePopup();
  2082. }, 1000);
  2083. }).catch(() => {
  2084. console.error('Failed to copy invite link.');
  2085. const popup = showPopup();
  2086. popup.textContent = 'Failed to copy invite link. Please try again.';
  2087. setTimeout(() => {
  2088. hidePopup();
  2089. }, 1000);
  2090. });
  2091. });
  2092.  
  2093. return inviteButton;
  2094. }
  2095.  
  2096. function adjustJoinButtonContainer(joinButton) {
  2097. const container = document.createElement('div');
  2098. container.style.display = 'flex';
  2099. container.style.width = '100%';
  2100.  
  2101. joinButton.style.width = '75%';
  2102.  
  2103. joinButton.parentNode.insertBefore(container, joinButton);
  2104. container.appendChild(joinButton);
  2105.  
  2106. return container;
  2107. }
  2108.  
  2109. function addFetchServersButton(gameId) {
  2110. const serverListOptions = document.querySelector(".server-list-options");
  2111. if (!serverListOptions) {
  2112. console.error("Server list options container not found!");
  2113. return;
  2114. }
  2115.  
  2116. const fetchButton = document.createElement("button");
  2117. fetchButton.type = "button";
  2118. fetchButton.textContent = "Filter Server Region";
  2119. fetchButton.className = "fetch-button";
  2120. fetchButton.addEventListener("click", () => {
  2121. createServerCountPopup((totalLimit) => {
  2122. rebuildServerList(gameId, fetchButton, totalLimit);
  2123. });
  2124. });
  2125.  
  2126. fetchButton.style.padding = '5px 10px';
  2127. fetchButton.style.cursor = 'pointer';
  2128. fetchButton.style.backgroundColor = '#444';
  2129. fetchButton.style.color = '#fff';
  2130. fetchButton.style.border = '1px solid #bdbebe';
  2131. fetchButton.style.borderRadius = '4px';
  2132. fetchButton.style.marginLeft = '10px';
  2133.  
  2134. serverListOptions.appendChild(fetchButton);
  2135. }
  2136.  
  2137. function isAutoRunEnabled() {
  2138. return localStorage.getItem('autoRunScript') === 'true';
  2139. }
  2140.  
  2141. function toggleAutoRun() {
  2142. const autoRunEnabled = isAutoRunEnabled();
  2143. localStorage.setItem('autoRunScript', !autoRunEnabled);
  2144. }
  2145.  
  2146. function addAutoButton() {
  2147. const serverListOptions = document.querySelector(".server-list-options");
  2148. if (!serverListOptions) {
  2149. console.error("Server list options container not found!");
  2150. return;
  2151. }
  2152.  
  2153. const autoButtonContainer = document.createElement("div");
  2154. autoButtonContainer.style.display = "flex";
  2155. autoButtonContainer.style.alignItems = "center";
  2156. autoButtonContainer.style.gap = "10px";
  2157.  
  2158. const autoButtonLabel = document.createElement("label");
  2159. autoButtonLabel.textContent = "Auto Filter Servers";
  2160. autoButtonLabel.style.color = "#fff";
  2161. autoButtonLabel.style.cursor = "pointer";
  2162. autoButtonLabel.style.marginLeft = "15px";
  2163.  
  2164. const autoButton = document.createElement("input");
  2165. autoButton.type = "checkbox";
  2166. autoButton.checked = isAutoRunEnabled();
  2167. autoButton.style.cursor = "pointer";
  2168. autoButton.title = "Automatically filter servers when the page loads.";
  2169. autoButton.addEventListener("change", toggleAutoRun);
  2170.  
  2171. autoButton.style.width = "16px";
  2172. autoButton.style.height = "16px";
  2173. autoButton.style.accentColor = "#393b3d";
  2174. autoButton.style.border = "1px solid #bdbebe";
  2175. autoButton.style.borderRadius = "4px";
  2176.  
  2177. autoButtonContainer.appendChild(autoButtonLabel);
  2178. autoButtonContainer.appendChild(autoButton);
  2179. serverListOptions.appendChild(autoButtonContainer);
  2180. }
  2181.  
  2182. function addCogWheel() {
  2183. const serverListOptions = document.querySelector(".server-list-options");
  2184. if (!serverListOptions) {
  2185. console.error("Server list options container not found!");
  2186. return;
  2187. }
  2188.  
  2189. const cogWheel = document.createElement("span");
  2190. cogWheel.innerHTML = "⚙️";
  2191. cogWheel.style.cursor = "pointer";
  2192. cogWheel.style.marginLeft = "10px";
  2193. cogWheel.style.fontSize = "16px";
  2194. cogWheel.title = "Click to set the default server search value for autorun.";
  2195.  
  2196. cogWheel.addEventListener("click", () => {
  2197. const defaultServerCount = prompt("Enter the default number of servers to search in autorun (1-100):");
  2198. if (defaultServerCount !== null) {
  2199. const count = parseInt(defaultServerCount);
  2200. if (!isNaN(count) && count >= 1 && count <= 100) {
  2201. localStorage.setItem('defaultServerCount', count);
  2202. alert(`Default server search value set to ${count}.`);
  2203. } else {
  2204. alert("Invalid input. Please enter a number between 1 and 100.");
  2205. }
  2206. }
  2207. });
  2208.  
  2209. serverListOptions.appendChild(cogWheel);
  2210. }
  2211.  
  2212. function getDefaultServerCount() {
  2213. const defaultServerCount = localStorage.getItem('defaultServerCount');
  2214. return defaultServerCount ? parseInt(defaultServerCount) : 100;
  2215. }
  2216.  
  2217. function autoClickFilterButton(gameId) {
  2218. const fetchButton = document.querySelector(".fetch-button");
  2219. if (fetchButton && !fetchButton.disabled) {
  2220. const defaultServerCount = getDefaultServerCount();
  2221. rebuildServerList(gameId, fetchButton, defaultServerCount);
  2222. console.log(`Auto-clicked the Filter Server Region button with ${defaultServerCount} servers preselected.`);
  2223. } else {
  2224. console.error("Filter Server Region button not found or is disabled.");
  2225. }
  2226. }
  2227.  
  2228. function main() {
  2229. const gameIdMatch = window.location.pathname.match(/\/games\/(\d+)\//);
  2230. if (!gameIdMatch) {
  2231. console.error("Game ID not found in URL!");
  2232. return;
  2233. }
  2234.  
  2235. const gameId = gameIdMatch[1];
  2236.  
  2237. const observer = new MutationObserver((mutations, obs) => {
  2238. const serverListOptions = document.querySelector(".server-list-options");
  2239. if (serverListOptions) {
  2240. addFetchServersButton(gameId);
  2241. addAutoButton();
  2242. addCogWheel();
  2243. obs.disconnect();
  2244.  
  2245. if (isAutoRunEnabled()) {
  2246. setTimeout(() => {
  2247. autoClickFilterButton(gameId);
  2248. }, 1000);
  2249. }
  2250. }
  2251. });
  2252.  
  2253. observer.observe(document.body, {
  2254. childList: true,
  2255. subtree: true
  2256. });
  2257. }
  2258.  
  2259. main();
  2260. })();
  2261.  
Add Comment
Please, Sign In to add comment