Last active
October 20, 2019 00:26
-
-
Save scorpion3013/92141beba446dda3c5cf05bee7d3a22f to your computer and use it in GitHub Desktop.
Direct download: https://workupload.com/file/mN6sRLt2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var scriptName = "cape_mover"; | |
var scriptAuthor = "scorpion"; | |
var scriptVersion = 1.0; | |
HttpPatch = Java.type("org.apache.http.client.methods.HttpPatch") | |
HttpClients = Java.type("org.apache.http.impl.client.HttpClients") | |
StringEntity = Java.type("org.apache.http.entity.StringEntity") | |
var Thread = Java.type("java.lang.Thread"); | |
var Runnable = Java.type("java.lang.Runnable"); | |
auth_key = "" | |
function CapeMover() { | |
this.getName = function() { | |
return "Cape_mover"; | |
} | |
this.getDescription = function() { | |
return "Moves your donator cape to your current alt."; | |
} | |
this.getCategory = function() { | |
return "Misc"; | |
} | |
var uuid = "" | |
this.onUpdate = function() { | |
if (uuid != String(mc.thePlayer.getGameProfile().id).replace(/-/g,"")){ | |
uuid = String(mc.thePlayer.getGameProfile().id).replace(/-/g,"") | |
new Thread(new Patcher()).start() | |
} | |
} | |
var Patcher = Java.extend(Runnable, { | |
run: function () { | |
httpClient = HttpClients.createDefault() | |
request = new HttpPatch("http://capes.liquidbounce.net/api/v1/cape/self") | |
request.setHeader("Content-Type", "application/json") | |
request.setHeader("Authorization", auth_key) | |
body = new StringEntity(JSON.stringify({"uuid": uuid})) | |
request.setEntity(body) | |
response = httpClient.execute(request) | |
} | |
}); | |
} | |
var capeMover = new CapeMover(); | |
var capeMoverClient; | |
function onEnable() { | |
capeMoverClient = moduleManager.registerModule(capeMover); | |
} | |
function onDisable() { | |
moduleManager.unregisterModule(capeMoverClient); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment