Skip to content

Instantly share code, notes, and snippets.

@C4K3
Last active August 6, 2022 06:35
Show Gist options
  • Save C4K3/2067b3f769d334ecc803 to your computer and use it in GitHub Desktop.
Save C4K3/2067b3f769d334ecc803 to your computer and use it in GitHub Desktop.
Minecraft alts searcher -- Find the alts of a player based on IP by searching through the logs
(use 'clojure.set)
(defn get-map [prev filename]
(let [filename (str "./logs/" filename)
reg (re-seq #"(\S+)\[/(.+):"
(with-open [in (if (nil? (re-matches #"^.*gz$" filename))
(clojure.java.io/input-stream filename)
(java.util.zip.GZIPInputStream.
(clojure.java.io/input-stream filename)))
]
(slurp in)))]
[(reduce
(fn [a b]
(let [username (get b 1)
ip (get b 2)]
(update a ip
clojure.set/union #{username}
)))
(first prev)
reg)
(reduce
(fn [a b]
(let [username (get b 1)
ip (get b 2)]
(update a username
clojure.set/union #{ip}
)))
(second prev)
reg)
]))
(let [[ips players]
(doall (reduce
get-map
[{} {}]
(.list (clojure.java.io/file "./logs/"))))]
(println
(map (fn [x]
(reduce
(fn [a b]
(clojure.set/union a (get ips b)))
#{}
(get players x)
))
*command-line-args*
)))
@Sunil5656
Copy link

Minecraft free java acunt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment