Skip to content

Commit

Permalink
Update 1.6
Browse files Browse the repository at this point in the history
Add AdminDetector
Fix Render Bug(GL_BLEND)
Fly Add AutoVerus
Killaura Add KeepAutoblock
  • Loading branch information
RMCQAZ committed Oct 17, 2021
1 parent 35d00f9 commit bc997b1
Show file tree
Hide file tree
Showing 12 changed files with 300 additions and 15 deletions.
5 changes: 4 additions & 1 deletion src/minecraft/kevin/command/CommandManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package kevin.command

import kevin.command.commands.*
import kevin.main.KevinClient
import kevin.module.modules.misc.AdminDetector
import kevin.module.modules.misc.AutoDisable
import kevin.script.ScriptManager
import kevin.utils.ChatUtils
Expand Down Expand Up @@ -36,9 +37,11 @@ class CommandManager {

commands[arrayOf("hide")] = HideCommand()

commands[arrayOf("AutoDisable")] = AutoDisable
commands[arrayOf("AutoDisableSet")] = AutoDisable

commands[arrayOf("ReloadScripts","ReloadScript")] = ScriptManager

commands[arrayOf("Admin")] = AdminDetector
}

fun execCommand(message: String): Boolean{
Expand Down
3 changes: 2 additions & 1 deletion src/minecraft/kevin/command/commands/HelpCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ class HelpCommand : ICommand {
ChatUtils.message("§a.config <save/load> <Name> §9Load/Save config.")
ChatUtils.message("§a.skin <Set/Clear/List/Reload/Mode> <Value> §9Change your skin.")
ChatUtils.message("§a.hide <ModuleName> §9Hide a module.")
ChatUtils.message("§a.AutoDisable <ModuleName> <add/remove> <World/SetBack/All> §9Add/Remove a module to AutoDisable List.")
ChatUtils.message("§a.AutoDisableSet <ModuleName> <add/remove> <World/SetBack/All> §9Add/Remove a module to AutoDisable List.")
ChatUtils.message("§a.reloadScripts §9Reload Scripts.")
ChatUtils.message("§a.reloadScript §9Reload Scripts.")
ChatUtils.message("§a.Admin <Add/Remove> <Name> Add admin name to detect list.")
}
}
1 change: 1 addition & 0 deletions src/minecraft/kevin/file/FileManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class FileManager extends MinecraftInstance {
public final FileConfig modulesConfig = new ModulesConfig(new File(dir, "modules.json"));
public final FileConfig hudConfig = new HudConfig(new File(dir, "hud.json"));
public final File altsFile = new File(dir,"accounts.json");
public final File adminNamesFile = new File(dir,"AdminNames.txt");

public void load(){
if (!dir.exists()) dir.mkdir();
Expand Down
1 change: 1 addition & 0 deletions src/minecraft/kevin/hud/HUD.kt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ open class HUD : MinecraftInstance() {
println("Something went wrong while drawing ${it.name} element in HUD. $ex")
}

GL11.glEnable(GL11.GL_BLEND)
GL11.glColor4f(1F,1F,1F,1F)
GL11.glPopMatrix()
}
Expand Down
2 changes: 1 addition & 1 deletion src/minecraft/kevin/main/KevinClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.lwjgl.opengl.Display

object KevinClient {
var name = "Kevin"
var version = "b1.5"
var version = "b1.6"

lateinit var moduleManager: ModuleManager
lateinit var fileManager: FileManager
Expand Down
1 change: 1 addition & 0 deletions src/minecraft/kevin/module/ModuleManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class ModuleManager : Listenable {
VehicleOneHit()
)
miscList = arrayListOf(
AdminDetector,
AntiBot(),
AutoCommand(),
AutoDisable,
Expand Down
10 changes: 7 additions & 3 deletions src/minecraft/kevin/module/modules/combat/KillAura.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.",
private val keepSprintValue = BooleanValue("KeepSprint", true)

// AutoBlock
private val autoBlockValue = ListValue("AutoBlock", arrayOf("Off", "Packet", "AfterTick"), "Packet")
private val autoBlockValue = ListValue("AutoBlock", arrayOf("Off", "Packet", "AfterTick", "Keep"), "Packet")
private val interactAutoBlockValue = BooleanValue("InteractAutoBlock", true)
private val blockRate = IntegerValue("BlockRate", 100, 1, 100)

Expand Down Expand Up @@ -157,6 +157,10 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.",
updateTarget()
}

//Keep AutoBlock
private val keepAutoBlock: Boolean
get() = autoBlockValue equal "Keep"

/**
* Disable kill aura module
*/
Expand Down Expand Up @@ -515,7 +519,7 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.",
// Stop blocking
val thePlayer = mc.thePlayer!!

if (thePlayer.isBlocking || blockingStatus)
if ((thePlayer.isBlocking || blockingStatus)&&!keepAutoBlock)
stopBlocking()

// Call attack event
Expand Down Expand Up @@ -554,7 +558,7 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.",
}

// Start blocking after attack
if (autoBlockValue.get().equals("Packet", true) && (thePlayer.isBlocking || canBlock))
if ((autoBlockValue.get().equals("Packet", true)||keepAutoBlock) && (thePlayer.isBlocking || canBlock))
startBlocking(entity, interactAutoBlockValue.get())
}

Expand Down
2 changes: 1 addition & 1 deletion src/minecraft/kevin/module/modules/exploit/Disabler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import kotlin.math.roundToInt
import kotlin.math.sqrt

object Disabler : Module("Disabler","Disable some anti-cheat check.",category = ModuleCategory.EXPLOIT) {
private val modeValue= ListValue("Mode",arrayOf("MineplexCombat","OldHypixel","OldVerusCombat","OldVerusCombat2","OldVerusMove","Flying","Spectate","SpectateSpoof","SpectateSpoof2","VulcanGeyser","C13+InfiniteC0C","NoGroundTouch","NoGroundTouch2","MemetrixScaffold","FakeLag","RidingSpoof","Kauri","Basic"),"MinePlexCombat")
val modeValue = ListValue("Mode",arrayOf("MineplexCombat","OldHypixel","OldVerusCombat","OldVerusCombat2","OldVerusMove","Flying","Spectate","SpectateSpoof","SpectateSpoof2","VulcanGeyser","C13+InfiniteC0C","NoGroundTouch","NoGroundTouch2","MemetrixScaffold","FakeLag","RidingSpoof","Kauri","Basic"),"MinePlexCombat")
private val debug = BooleanValue("Debug", false)
private val memeAACValue = BooleanValue("MemetrixWithAAC5", false)
private val fakeLagPosValue = BooleanValue("FakeLagPosition", true)
Expand Down
110 changes: 110 additions & 0 deletions src/minecraft/kevin/module/modules/misc/AdminDetector.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
package kevin.module.modules.misc

import joptsimple.internal.Strings
import kevin.command.ICommand
import kevin.event.EventTarget
import kevin.event.PacketEvent
import kevin.event.UpdateEvent
import kevin.hud.element.elements.Notification
import kevin.main.KevinClient
import kevin.module.*
import kevin.utils.ChatUtils
import kevin.utils.TickTimer
import net.minecraft.network.play.client.C14PacketTabComplete
import net.minecraft.network.play.server.S3APacketTabComplete
import java.io.File

object AdminDetector : Module("AdminDetector","Detect server admins."),ICommand {
private val adminNamesFile:File by lazy {
if (!KevinClient.fileManager.adminNamesFile.exists()) KevinClient.fileManager.adminNamesFile.createNewFile()
KevinClient.fileManager.adminNamesFile
}
override fun run(args: Array<out String>?) {
if (args.isNullOrEmpty()||args.size<2){
usageMessage()
return
}
val name = args[1]
val names = adminNamesFile.readLines()
when{
args[0].equals("Add",true) -> {
if (name in names) {
ChatUtils.messageWithStart("§cName is already in the list!")
return
}
adminNamesFile.appendText("$name\n")
ChatUtils.messageWithStart("§aName successfully added to the list!")
}
args[0].equals("Remove",true) -> {
if (name !in names){
ChatUtils.messageWithStart("§cName is not in the list!")
return
}
adminNamesFile.writeText("")
names.forEach {
if (it!=name&&it.isNotEmpty()){
adminNamesFile.appendText("$it\n")
}
}
ChatUtils.messageWithStart("§aName successfully removed from the list!")
}
else -> usageMessage()
}
}
private fun usageMessage() = ChatUtils.messageWithStart("§cUsage: .Admin <Add/Remove> <Name>")

private val modeValue = ListValue("Mode", arrayOf("Tab"),"Tab")
private val tabCommand = TextValue("TabCommand","/tell")
private val waitTicks = IntegerValue("WaitTick",100,0,200)
private val notificationMode = ListValue("NotificationMode", arrayOf("Chat","Notification"),"Chat")
private val noNotFindNotification = BooleanValue("NoNotFindNotification",true)

private val timer = TickTimer()
private var waiting = false

@EventTarget fun onUpdate(event: UpdateEvent){
timer.update()
if (!timer.hasTimePassed(waitTicks.get()+1)) return
when(modeValue.get()){
"Tab" -> {
mc.netHandler.addToSendQueue(C14PacketTabComplete("${tabCommand.get()} "))
waiting = true
timer.reset()
}
}
}
@EventTarget fun onPacket(event: PacketEvent){
val packet = event.packet
when(modeValue.get()){
"Tab" -> {
if (!waiting) return
if (packet is S3APacketTabComplete){
val players = packet.func_149630_c()
val admins = adminNamesFile.readLines().toMutableList()
admins.removeAll { it.isEmpty() }
val findAdmins = arrayListOf<String>()
players.forEach {
if (it in admins) findAdmins.add(it)
}
n(findAdmins)
waiting = false
event.cancelEvent()
}
}
}
}

private fun n(findAdmins:ArrayList<String>){
if (findAdmins.isEmpty()) {
if (!noNotFindNotification.get()) when(notificationMode.get()){
"Chat" -> ChatUtils.messageWithStart("[AdminDetector] No admin find.")
"Notification" -> KevinClient.hud.addNotification(Notification("No admin find."),"Admin Detector")
}
return
}
when(notificationMode.get()){
"Chat" -> ChatUtils.messageWithStart("[AdminDetector] Warning: find ${findAdmins.size} admin(s)![§c${Strings.join(findAdmins.toArray(arrayOfNulls<String>(0)), "§7, §c")}]")
"Notification" -> KevinClient.hud.addNotification(Notification("Warning: find ${findAdmins.size} admin(s)![§c${Strings.join(findAdmins.toArray(arrayOfNulls<String>(0)), "§7, §c")}]"),"Admin Detector")
}
}
}
36 changes: 29 additions & 7 deletions src/minecraft/kevin/module/modules/misc/AutoCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,24 @@ package kevin.module.modules.misc
import kevin.event.EventTarget
import kevin.event.PacketEvent
import kevin.event.UpdateEvent
import kevin.hud.element.elements.Notification
import kevin.main.KevinClient

//import kevin.event.UpdateState

import kevin.module.*
import kevin.utils.ChatUtils
import kevin.utils.MSTimer
import net.minecraft.network.play.server.S02PacketChat

class AutoCommand : Module("AutoCommand","Send commands automatically.",category = ModuleCategory.MISC) {
private val autoLoginValue = BooleanValue("AutoLogin",true)
private val autoRegisterValue = BooleanValue("AutoRegister",true)
private val autoJoin = BooleanValue("AutoJoin",true)
private val autoJoinDetectMessage = TextValue("AutoJoinDetectMessage","top")
private val autoJoinDelay = IntegerValue("AutoJoinDelay",5000,50,10000)
private val autoJoinMessage = TextValue("AutoJoinMessage","/join")
private val autoJoinNotificationMode = ListValue("AutoJoinNotificationMode", arrayOf("Notification","Chat","None"),"Notification")
private val registerAndLoginPassword = TextValue("RegisterAndLoginPassword","Password")
private val autoLoginAndRegisterDelay = IntegerValue("AutoLoginAndRegisterDelay",2500,100,5000)
private val autoLoginMode = ListValue("AutoLoginMode", arrayOf("/l","/login","Custom"),"/login")
Expand All @@ -22,22 +30,19 @@ class AutoCommand : Module("AutoCommand","Send commands automatically.",category
private val autoRegisterDetectMessage = TextValue("AutoRegisterDetectMessage","register")

private val timer = MSTimer()
private val autoJoinTimer = MSTimer()
private var register = false
private var login = false
private var join = false

override fun onDisable() {
register = false
login = false
super.onDisable()
}

override val tag: String?
get() = when{
autoLoginValue.get()&&autoRegisterValue.get() ->"Auto Login Register"
autoRegisterValue.get() -> "Auto Register"
autoLoginValue.get() -> "Auto Login"
else -> null
}
override val tag: String
get() = "Auto ${if(autoJoin.get()) "Join" else ""} ${if(autoLoginValue.get()) "Login" else ""} ${if(autoRegisterValue.get()) "Register" else ""}"

@EventTarget
fun onPacket(event: PacketEvent){
Expand All @@ -46,13 +51,30 @@ class AutoCommand : Module("AutoCommand","Send commands automatically.",category
val text = packet.chatComponent.formattedText
if (text.contains(autoRegisterDetectMessage.get(),true)&&autoRegisterValue.get()) {register=true;timer.reset();return}
if (text.contains(autoLoginDetectMessage.get(),true)&&autoLoginValue.get()) {login=true;timer.reset()}
if (text.contains(autoJoinDetectMessage.get(),true)&&autoJoin.get()) {
join=true
autoJoinTimer.reset()
when(autoJoinNotificationMode.get()){
"Notification" -> KevinClient.hud.addNotification(Notification("Send command after ${autoJoinDelay.get()} MS."),"AutoJoin")
"Chat" -> ChatUtils.messageWithStart("[AutoJoin] Send command after ${autoJoinDelay.get()} MS.")
}
}
}

@EventTarget
fun onUpdate(event: UpdateEvent){

//if (event.eventState == UpdateState.OnUpdate) return

if (autoJoinTimer.hasTimePassed(autoJoinDelay.get().toLong())&&join) {
mc.thePlayer.sendChatMessage(autoJoinMessage.get())
join = false
when(autoJoinNotificationMode.get()){
"Notification" -> KevinClient.hud.addNotification(Notification("Auto Join..."),"AutoJoin")
"Chat" -> ChatUtils.messageWithStart("[AutoJoin] Auto Join...")
}
}

if (!timer.hasTimePassed(autoLoginAndRegisterDelay.get().toLong())) return
if (register){
mc.thePlayer.sendChatMessage("${autoRegisterCommand.get()} ${registerAndLoginPassword.get()} ${registerAndLoginPassword.get()}")
Expand Down
Loading

0 comments on commit bc997b1

Please sign in to comment.