
NqwSqw
Members-
Posts
43 -
Joined
-
Last visited
Everything posted by NqwSqw
-
What I can do for it's work ?
-
What is the task ? Sorry I'm french i'm bad at English
-
-
I have error while I compile but I the .jar library to my workspace C:\Users\Franck\Desktop\Vincent\Mod Porting Tools\forge-1.9.4-12.17.0.2051-mdk\build\sources\main\java\xyz\fusked\Login.java:4: error: package com.sun.tools.attach does not exist import com.sun.tools.attach.AttachNotSupportedException; ^ C:\Users\Franck\Desktop\Vincent\Mod Porting Tools\forge-1.9.4-12.17.0.2051-mdk\build\sources\main\java\xyz\fusked\Login.java:135: error: cannot find symbol private /* synthetic */ void jButton2ActionPerformed(ActionEvent evt) throws IOException, URISyntaxException, AttachNotSupportedException { ^ symbol: class AttachNotSupportedException location: class Login C:\Users\Franck\Desktop\Vincent\Mod Porting Tools\forge-1.9.4-12.17.0.2051-mdk\build\sources\main\java\xyz\fusked\Main.java:4: error: package com.sun.tools.attach does not exist import com.sun.tools.attach.AttachNotSupportedException; ^ C:\Users\Franck\Desktop\Vincent\Mod Porting Tools\forge-1.9.4-12.17.0.2051-mdk\build\sources\main\java\xyz\fusked\Main.java:5: error: package com.sun.tools.attach does not exist import com.sun.tools.attach.VirtualMachine; ^ C:\Users\Franck\Desktop\Vincent\Mod Porting Tools\forge-1.9.4-12.17.0.2051-mdk\build\sources\main\java\xyz\fusked\Main.java:6: error: package com.sun.tools.attach does not exist import com.sun.tools.attach.VirtualMachineDescriptor; ^ C:\Users\Franck\Desktop\Vincent\Mod Porting Tools\forge-1.9.4-12.17.0.2051-mdk\build\sources\main\java\xyz\fusked\Main.java:32: error: cannot find symbol public static /* synthetic */ void launchClient() throws IOException, URISyntaxException, AttachNotSupportedException { ^ symbol: class AttachNotSupportedException location: class Main C:\Users\Franck\Desktop\Vincent\Mod Porting Tools\forge-1.9.4-12.17.0.2051-mdk\build\sources\main\java\xyz\fusked\Login.java:108: error: cannot find symbol catch (AttachNotSupportedException e) { ^ symbol: class AttachNotSupportedException C:\Users\Franck\Desktop\Vincent\Mod Porting Tools\forge-1.9.4-12.17.0.2051-mdk\build\sources\main\java\xyz\fusked\Main.java:52: error: cannot find symbol for (VirtualMachineDescriptor descriptor : VirtualMachine.list()) { ^ symbol: variable VirtualMachine location: class Main C:\Users\Franck\Desktop\Vincent\Mod Porting Tools\forge-1.9.4-12.17.0.2051-mdk\build\sources\main\java\xyz\fusked\Main.java:52: error: cannot find symbol for (VirtualMachineDescriptor descriptor : VirtualMachine.list()) { ^ symbol: class VirtualMachineDescriptor location: class Main C:\Users\Franck\Desktop\Vincent\Mod Porting Tools\forge-1.9.4-12.17.0.2051-mdk\build\sources\main\java\xyz\fusked\Main.java:55: error: cannot find symbol VirtualMachine vm = VirtualMachine.attach((VirtualMachineDescriptor)descriptor); ^ symbol: class VirtualMachine location: class Main C:\Users\Franck\Desktop\Vincent\Mod Porting Tools\forge-1.9.4-12.17.0.2051-mdk\build\sources\main\java\xyz\fusked\Main.java:55: error: cannot find symbol VirtualMachine vm = VirtualMachine.attach((VirtualMachineDescriptor)descriptor); ^ symbol: class VirtualMachineDescriptor location: class Main C:\Users\Franck\Desktop\Vincent\Mod Porting Tools\forge-1.9.4-12.17.0.2051-mdk\build\sources\main\java\xyz\fusked\Main.java:55: error: cannot find symbol VirtualMachine vm = VirtualMachine.attach((VirtualMachineDescriptor)descriptor); ^ symbol: variable VirtualMachine location: class Main Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 12 errors :compileJava FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileJava'. > Compilation failed; see the compiler error output for details. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED It works well in IDE :
-
Omg I go die
-
server where I play is only 1.9 and 1.9.4 versions
-
1.9.4
-
Because the server where I play accept only 1.9 and 1.9.4
-
Hi, I have error when i test my module /* */ package xyz.fusked.m0dules.mods.combat; import java.lang.reflect.Method; import java.util.Random; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.KeyBinding; import net.minecraft.item.Item; import net.minecraft.item.ItemAxe; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import xyz.fusked.m0dules.Module; import xyz.fusked.m0dules.Module.Category; import xyz.fusked.m0dules.Module.Modules; import xyz.fusked.utils.MouseUtil; import xyz.fusked.utils.Timer; import xyz.fusked.values.BooleanValue; import xyz.fusked.values.NumberValue; public class AutoclickDroit extends Module { private NumberValue maxcps; private NumberValue mincps; private NumberValue jitterstren; private BooleanValue jitter; private BooleanValue inv; private long nextLeftUp; private long nextLeftDown; private long nextRightUp; private long nextRightDown; private long nextDrop; private long nextExhaust; private Timer timer; private Random random; private double dr0pR4t3; private boolean dr0pp1ng; private Method guiScreenMethod; public AutoclickDroit() { super("AutoClickerDroit", 0, Module.Category.COMBAT); this.maxcps = new NumberValue("MaxCPS", 12.0D, 1.0D, 20.0D); this.mincps = new NumberValue("MinCPS", 6.0D, 1.0D, 20.0D); this.jitterstren = new NumberValue("Jitter Strength", 0.5D, 0.1D, 2.0D); this.jitter = new BooleanValue("Jitter", false); this.inv = new BooleanValue("Inventory fill", false); this.timer = new Timer(); this.random = new Random(); addValue(this.maxcps); addValue(this.mincps); addValue(this.jitterstren); addBoolean(this.jitter); addBoolean(this.inv); try { this.guiScreenMethod = GuiScreen.class.getDeclaredMethod("mouseClicked", new Class[] { Integer.TYPE, Integer.TYPE, Integer.TYPE }); } catch (NoSuchMethodException e) { e.printStackTrace(); } } public boolean check(EntityPlayerSP playerSP) { if ((playerSP.getHeldItemMainhand() != null) && (playerSP.getHeldItemMainhand().getItem() == Item.getItemById(322)) || (playerSP.getHeldItemOffhand().getItem() == Item.getItemById(322))){ return false; } else if ((playerSP.getHeldItemMainhand() != null) && (playerSP.getHeldItemMainhand().getItem() instanceof ItemBlock)){ return true; } else if ((playerSP.getHeldItemOffhand() != null) && (playerSP.getHeldItemOffhand().getItem() instanceof ItemBlock)){ return true; } else if((playerSP.getHeldItemOffhand() != null) && (playerSP.getHeldItemOffhand().getItem() instanceof ItemBlock ) && (playerSP.getHeldItemMainhand().getItem() instanceof ItemFood )){ return false; } else { return false; } } @SubscribeEvent public void onTick(TickEvent.ClientTickEvent ev3nt) throws Exception { if ((this.mc.currentScreen == null) && (check(this.mc.thePlayer))) { Mouse.poll(); if (Mouse.isButtonDown(1)) { if ((this.jitter.getState()) && (this.random.nextDouble() > 0.65D)) { float jitterstrenght = (float)(this.jitterstren.getValue() * 0.5D); if (this.random.nextBoolean()) { this.mc.thePlayer.rotationYaw += this.random.nextFloat() * jitterstrenght; } else { this.mc.thePlayer.rotationYaw -= this.random.nextFloat() * jitterstrenght; } if (this.random.nextBoolean()) { this.mc.thePlayer.rotationPitch += (float)(this.random.nextFloat() * (jitterstrenght * 0.75D)); } else { this.mc.thePlayer.rotationPitch -= (float)(this.random.nextFloat() * (jitterstrenght * 0.75D)); } } if ((this.nextLeftDown > 0L) && (this.nextLeftUp > 0L)) { if (System.currentTimeMillis() > this.nextLeftDown) { KeyBinding.setKeyBindState(this.mc.gameSettings.keyBindUseItem.getKeyCode(), true); KeyBinding.onTick(this.mc.gameSettings.keyBindUseItem.getKeyCode()); MouseUtil.sendClick(0, true); generateLeftDelay(); } else if (System.currentTimeMillis() > this.nextLeftUp) { KeyBinding.setKeyBindState(this.mc.gameSettings.keyBindUseItem.getKeyCode(), false); MouseUtil.sendClick(0, false); } } else { generateLeftDelay(); } if (!Mouse.isButtonDown(0)) { long n = 0L; this.nextRightUp = 0L; this.nextRightDown = 0L; } } else { long n2 = 0L; this.nextRightUp = 0L; this.nextRightDown = 0L; this.nextLeftUp = 0L; this.nextLeftDown = 0L; } } else if ((this.mc.currentScreen instanceof GuiInventory)) { if ((Mouse.isButtonDown(1)) && ((Keyboard.isKeyDown(54)) || (Keyboard.isKeyDown(42)))) { if (!this.inv.getState()) { return; } if ((this.nextLeftUp == 0L) || (this.nextLeftDown == 0L)) { generateLeftDelay(); return; } if (System.currentTimeMillis() > this.nextLeftDown) { generateLeftDelay(); clickInventory(this.mc.currentScreen); } } else { long n3 = 0L; this.nextRightUp = 0L; this.nextRightDown = 0L; this.nextLeftUp = 0L; this.nextLeftDown = 0L; } } } private void generateLeftDelay() { if (this.mincps.getValue() > this.maxcps.getValue()) { return; } long d3l4y = (int)Math.round(900.0D / this.mincps.getValue() + this.random.nextDouble() * (this.maxcps.getValue() - this.mincps.getValue())); if (System.currentTimeMillis() > this.nextDrop) { if ((!this.dr0pp1ng) && (this.random.nextInt(100) >= 85)) { this.dr0pp1ng = true; this.dr0pR4t3 = (1.1D + this.random.nextDouble() * 0.15D); } else { this.dr0pp1ng = false; } this.nextDrop = (System.currentTimeMillis() + 500L + this.random.nextInt(1500)); } if (this.dr0pp1ng) { d3l4y *= this.dr0pR4t3; } if (System.currentTimeMillis() > this.nextExhaust) { if (this.random.nextInt(100) >= 80) { d3l4y += 50L + this.random.nextInt(150); } this.nextExhaust = (System.currentTimeMillis() + 500L + this.random.nextInt(1500)); } this.nextLeftDown = (System.currentTimeMillis() + d3l4y); this.nextLeftUp = (System.currentTimeMillis() + d3l4y / 2L - this.random.nextInt(10)); } private void clickInventory(GuiScreen screen) { int v4r1 = Mouse.getX() * screen.width / this.mc.displayWidth; int v4r2 = screen.height - Mouse.getY() * screen.height / this.mc.displayHeight - 1; int v4r3 = 0; try { this.guiScreenMethod.setAccessible(true); this.guiScreenMethod.invoke(screen, new Object[] { Integer.valueOf(v4r1), Integer.valueOf(v4r2), Integer.valueOf(0) }); this.guiScreenMethod.setAccessible(false); } catch (Exception e) { e.printStackTrace(); } } } Modding version is 1.9.4
-
I try it but it give unexpected method for ItemStack
-
But why this doesn't work package xyz.fusked.m0dules.mods.combat; import java.lang.reflect.Method; import java.util.Random; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.KeyBinding; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import xyz.fusked.m0dules.Module; import xyz.fusked.m0dules.Module.Category; import xyz.fusked.m0dules.Module.Modules; import xyz.fusked.utils.MouseUtil; import xyz.fusked.utils.Timer; import xyz.fusked.values.BooleanValue; import xyz.fusked.values.NumberValue; public class AutoclickDroit extends Module { private NumberValue maxcps; private NumberValue mincps; private BooleanValue blocks; private long nextLeftUp; private long nextLeftDown; private long nextRightUp; private long nextRightDown; private long nextDrop; private long nextExhaust; private Timer timer; private Random random; private double dr0pR4t3; private boolean dr0pp1ng; private Method guiScreenMethod; public AutoclickDroit() { super("AutoClickDroit", 0, Module.Category.COMBAT); this.maxcps = new NumberValue("MaxCPS", 12.7D, 1.0D, 20.0D); this.mincps = new NumberValue("MinCPS", 12.0D, 1.0D, 20.0D); this.blocks = new BooleanValue("Blocks", false); this.timer = new Timer(); this.random = new Random(); addValue(this.maxcps); addValue(this.mincps); addBoolean(this.blocks); try { this.guiScreenMethod = GuiScreen.class.getDeclaredMethod("mouseClicked", new Class[] { Integer.TYPE, Integer.TYPE, Integer.TYPE }); } catch (NoSuchMethodException e) { e.printStackTrace(); } } public boolean check(EntityPlayerSP playerSP) { if ((playerSP.getHeldItemMainhand() != null) && (playerSP.getHeldItemMainhand().getItem() instanceof ItemBlock)){ return true; } else if ((playerSP.getHeldItemOffhand() != null) && (playerSP.getHeldItemOffhand().getItem() instanceof ItemBlock)){ return true; } else if((playerSP.getHeldItemOffhand() != null) && (playerSP.getHeldItemOffhand().getItem() instanceof ItemBlock ) && (playerSP.getHeldItemMainhand().getItem() instanceof ItemFood )){ return false; } else { return false; } } @SubscribeEvent public void onTick(TickEvent.ClientTickEvent ev3nt) throws Exception { if ((this.mc.currentScreen == null) && (check(this.mc.thePlayer))) { Mouse.poll(); if (Mouse.isButtonDown(1)) { if ((this.nextLeftDown > 0L) && (this.nextLeftUp > 0L)) { if (System.currentTimeMillis() > this.nextLeftDown) { KeyBinding.setKeyBindState(this.mc.gameSettings.keyBindUseItem.getKeyCode(), true); KeyBinding.onTick(this.mc.gameSettings.keyBindUseItem.getKeyCode()); MouseUtil.sendClick(0, true); generateLeftDelay(); } else if (System.currentTimeMillis() > this.nextLeftUp) { KeyBinding.setKeyBindState(this.mc.gameSettings.keyBindUseItem.getKeyCode(), false); MouseUtil.sendClick(0, false); } } else { generateLeftDelay(); } if (!Mouse.isButtonDown(0)) { long n = 0L; this.nextRightUp = 0L; this.nextRightDown = 0L; } } else { long n2 = 0L; this.nextRightUp = 0L; this.nextRightDown = 0L; this.nextLeftUp = 0L; this.nextLeftDown = 0L; } } else if ((this.mc.currentScreen instanceof GuiInventory)) { if ((Mouse.isButtonDown(1)) && ((Keyboard.isKeyDown(54)) || (Keyboard.isKeyDown(42)))) { if ((this.nextLeftUp == 0L) || (this.nextLeftDown == 0L)) { generateLeftDelay(); return; } if (System.currentTimeMillis() > this.nextLeftDown) { generateLeftDelay(); clickInventory(this.mc.currentScreen); } } else { long n3 = 0L; this.nextRightUp = 0L; this.nextRightDown = 0L; this.nextLeftUp = 0L; this.nextLeftDown = 0L; } } } private void generateLeftDelay() { if (this.mincps.getValue() > this.maxcps.getValue()) { return; } long d3l4y = (int)Math.round(900.0D / this.mincps.getValue() + this.random.nextDouble() * (this.maxcps.getValue() - this.mincps.getValue())); if (System.currentTimeMillis() > this.nextDrop) { if ((!this.dr0pp1ng) && (this.random.nextInt(100) >= 85)) { this.dr0pp1ng = true; this.dr0pR4t3 = (1.1D + this.random.nextDouble() * 0.15D); } else { this.dr0pp1ng = false; } this.nextDrop = (System.currentTimeMillis() + 500L + this.random.nextInt(1500)); } if (this.dr0pp1ng) { d3l4y *= this.dr0pR4t3; } if (System.currentTimeMillis() > this.nextExhaust) { if (this.random.nextInt(100) >= 80) { d3l4y += 50L + this.random.nextInt(150); } this.nextExhaust = (System.currentTimeMillis() + 500L + this.random.nextInt(1500)); } this.nextLeftDown = (System.currentTimeMillis() + d3l4y); this.nextLeftUp = (System.currentTimeMillis() + d3l4y / 2L - this.random.nextInt(10)); } private void clickInventory(GuiScreen screen) { int v4r1 = Mouse.getX() * screen.width / this.mc.displayWidth; int v4r2 = screen.height - Mouse.getY() * screen.height / this.mc.displayHeight - 1; int v4r3 = 0; try { this.guiScreenMethod.setAccessible(true); this.guiScreenMethod.invoke(screen, new Object[] { Integer.valueOf(v4r1), Integer.valueOf(v4r2), Integer.valueOf(0) }); this.guiScreenMethod.setAccessible(false); } catch (Exception e) { e.printStackTrace(); } } } at public boolean check(EntityPlayerSP playerSP) { if ((playerSP.getHeldItemMainhand() != null) && (playerSP.getHeldItemMainhand().getItem() instanceof ItemBlock)){ return true; } else if ((playerSP.getHeldItemOffhand() != null) && (playerSP.getHeldItemOffhand().getItem() instanceof ItemBlock)){ return true; } else if((playerSP.getHeldItemOffhand() != null) && (playerSP.getHeldItemOffhand().getItem() instanceof ItemBlock ) && (playerSP.getHeldItemMainhand().getItem() instanceof ItemFood )){ return false; } else { return false; } } if I want to when I have blocks in OffHand and item can be eating in MainHand, the autoclick doesn't work and when in offHand there are blocks and MainHand have other things except foods it works ?
-
Hi, I want to when I have blocks in OffHand and item can be eating in MainHand, the autoclick doesn't work and when in offHand there are blocks and MainHand have other things except foods it works package xyz.fusked.m0dules.mods.combat; import java.lang.reflect.Method; import java.util.Random; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.KeyBinding; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import xyz.fusked.m0dules.Module; import xyz.fusked.m0dules.Module.Category; import xyz.fusked.m0dules.Module.Modules; import xyz.fusked.utils.MouseUtil; import xyz.fusked.utils.Timer; import xyz.fusked.values.BooleanValue; import xyz.fusked.values.NumberValue; public class AutoclickDroit extends Module { private NumberValue maxcps; private NumberValue mincps; private BooleanValue blocks; private long nextLeftUp; private long nextLeftDown; private long nextRightUp; private long nextRightDown; private long nextDrop; private long nextExhaust; private Timer timer; private Random random; private double dr0pR4t3; private boolean dr0pp1ng; private Method guiScreenMethod; public AutoclickDroit() { super("AutoClickDroit", 0, Module.Category.COMBAT); this.maxcps = new NumberValue("MaxCPS", 12.0D, 1.0D, 50.0D); this.mincps = new NumberValue("MinCPS", 6.0D, 1.0D, 50.0D); this.blocks = new BooleanValue("Blocks", false); this.timer = new Timer(); this.random = new Random(); addValue(this.maxcps); addValue(this.mincps); addBoolean(this.blocks); try { this.guiScreenMethod = GuiScreen.class.getDeclaredMethod("mouseClicked", new Class[] { Integer.TYPE, Integer.TYPE, Integer.TYPE }); } catch (NoSuchMethodException e) { e.printStackTrace(); } } public boolean check(EntityPlayerSP playerSP) { return (!this.blocks.getState()) || ((playerSP.getHeldItemOffhand() != null) && (playerSP.getHeldItemOffhand().getItem() instanceof ItemBlock)); } @SubscribeEvent public void onTick(TickEvent.ClientTickEvent ev3nt, EntityPlayerSP playerSP) throws Exception { if ((this.mc.currentScreen == null) && (check(this.mc.thePlayer))) { Mouse.poll(); if (Mouse.isButtonDown(1)) { if ((this.nextLeftDown > 0L) && (this.nextLeftUp > 0L)) { if (System.currentTimeMillis() > this.nextLeftDown) { KeyBinding.setKeyBindState(this.mc.gameSettings.keyBindUseItem.getKeyCode(), true); KeyBinding.onTick(this.mc.gameSettings.keyBindUseItem.getKeyCode()); MouseUtil.sendClick(0, true); generateLeftDelay(); } else if (System.currentTimeMillis() > this.nextLeftUp) { KeyBinding.setKeyBindState(this.mc.gameSettings.keyBindUseItem.getKeyCode(), false); MouseUtil.sendClick(0, false); } } else { generateLeftDelay(); } if (!Mouse.isButtonDown(0)) { long n = 0L; this.nextRightUp = 0L; this.nextRightDown = 0L; } } else { long n2 = 0L; this.nextRightUp = 0L; this.nextRightDown = 0L; this.nextLeftUp = 0L; this.nextLeftDown = 0L; } } else if ((this.mc.currentScreen instanceof GuiInventory)) { if ((Mouse.isButtonDown(1)) && ((Keyboard.isKeyDown(54)) || (Keyboard.isKeyDown(42)))) { if ((this.nextLeftUp == 0L) || (this.nextLeftDown == 0L)) { generateLeftDelay(); return; } if (System.currentTimeMillis() > this.nextLeftDown) { generateLeftDelay(); clickInventory(this.mc.currentScreen); } } else { long n3 = 0L; this.nextRightUp = 0L; this.nextRightDown = 0L; this.nextLeftUp = 0L; this.nextLeftDown = 0L; } } } private void generateLeftDelay() { if (this.mincps.getValue() > this.maxcps.getValue()) { return; } long d3l4y = (int)Math.round(900.0D / this.mincps.getValue() + this.random.nextDouble() * (this.maxcps.getValue() - this.mincps.getValue())); if (System.currentTimeMillis() > this.nextDrop) { if ((!this.dr0pp1ng) && (this.random.nextInt(100) >= 85)) { this.dr0pp1ng = true; this.dr0pR4t3 = (1.1D + this.random.nextDouble() * 0.15D); } else { this.dr0pp1ng = false; } this.nextDrop = (System.currentTimeMillis() + 500L + this.random.nextInt(1500)); } if (this.dr0pp1ng) { d3l4y *= this.dr0pR4t3; } if (System.currentTimeMillis() > this.nextExhaust) { if (this.random.nextInt(100) >= 80) { d3l4y += 50L + this.random.nextInt(150); } this.nextExhaust = (System.currentTimeMillis() + 500L + this.random.nextInt(1500)); } this.nextLeftDown = (System.currentTimeMillis() + d3l4y); this.nextLeftUp = (System.currentTimeMillis() + d3l4y / 2L - this.random.nextInt(10)); } private void clickInventory(GuiScreen screen) { int v4r1 = Mouse.getX() * screen.width / this.mc.displayWidth; int v4r2 = screen.height - Mouse.getY() * screen.height / this.mc.displayHeight - 1; int v4r3 = 0; try { this.guiScreenMethod.setAccessible(true); this.guiScreenMethod.invoke(screen, new Object[] { Integer.valueOf(v4r1), Integer.valueOf(v4r2), Integer.valueOf(0) }); this.guiScreenMethod.setAccessible(false); } catch (Exception e) { e.printStackTrace(); } }
-
no i solved the error Thx anyway !
-
Hi, I have a problem that when I press right click it's posing a blokc with normal delay and it break it but i don't press left click package xyz.fusked.m0dules.mods.combat; import java.lang.reflect.Method; import java.util.Random; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.KeyBinding; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import xyz.fusked.m0dules.Module; import xyz.fusked.m0dules.Module.Category; import xyz.fusked.m0dules.Module.Modules; import xyz.fusked.utils.MouseUtil; import xyz.fusked.utils.Timer; import xyz.fusked.values.BooleanValue; import xyz.fusked.values.NumberValue; public class AutoclickDroit extends Module { private NumberValue maxcps; private NumberValue mincps; private NumberValue jitterstren; private BooleanValue jitter; private BooleanValue blocks; private long nextLeftUp; private long nextLeftDown; private long nextRightUp; private long nextRightDown; private long nextDrop; private long nextExhaust; private Timer timer; private Random random; private double dr0pR4t3; private boolean dr0pp1ng; private Method guiScreenMethod; public AutoclickDroit() { super("AutoClickDroit", 0, Module.Category.COMBAT); this.maxcps = new NumberValue("MaxCPS", 12.0D, 1.0D, 20.0D); this.mincps = new NumberValue("MinCPS", 6.0D, 1.0D, 20.0D); this.jitterstren = new NumberValue("Jitter Strength", 0.5D, 0.1D, 2.0D); this.jitter = new BooleanValue("Jitter", false); this.blocks = new BooleanValue("Blocks", false); this.timer = new Timer(); this.random = new Random(); addValue(this.maxcps); addValue(this.mincps); addValue(this.jitterstren); addBoolean(this.jitter); addBoolean(this.blocks); try { this.guiScreenMethod = GuiScreen.class.getDeclaredMethod("mouseClicked", new Class[] { Integer.TYPE, Integer.TYPE, Integer.TYPE }); } catch (NoSuchMethodException e) { e.printStackTrace(); } } public boolean check(EntityPlayerSP playerSP) { return (!this.blocks.getState()) || ((playerSP.getHeldItemMainhand() != null)|| ((playerSP.getHeldItemOffhand() != null) && (((playerSP.getHeldItemMainhand().getItem() instanceof ItemBlock)))|| (playerSP.getHeldItemOffhand().getItem() instanceof ItemBlock))); } @SubscribeEvent public void onTick(TickEvent.ClientTickEvent ev3nt) throws Exception { if ((this.mc.currentScreen == null) && (check(this.mc.thePlayer))) { Mouse.poll(); if (Mouse.isButtonDown(1)) { if ((this.jitter.getState()) && (this.random.nextDouble() > 0.65D)) { float jitterstrenght = (float)(this.jitterstren.getValue() * 0.5D); if (this.random.nextBoolean()) { this.mc.thePlayer.rotationYaw += this.random.nextFloat() * jitterstrenght; } else { this.mc.thePlayer.rotationYaw -= this.random.nextFloat() * jitterstrenght; } if (this.random.nextBoolean()) { this.mc.thePlayer.rotationPitch += (float)(this.random.nextFloat() * (jitterstrenght * 0.75D)); } else { this.mc.thePlayer.rotationPitch -= (float)(this.random.nextFloat() * (jitterstrenght * 0.75D)); } } if ((this.nextLeftDown > 0L) && (this.nextLeftUp > 0L)) { if (System.currentTimeMillis() > this.nextLeftDown) { KeyBinding.setKeyBindState(this.mc.gameSettings.keyBindAttack.getKeyCode(), true); KeyBinding.onTick(this.mc.gameSettings.keyBindAttack.getKeyCode()); MouseUtil.sendClick(0, true); generateLeftDelay(); } else if (System.currentTimeMillis() > this.nextLeftUp) { KeyBinding.setKeyBindState(this.mc.gameSettings.keyBindAttack.getKeyCode(), false); MouseUtil.sendClick(0, false); } } else { generateLeftDelay(); } if (!Mouse.isButtonDown(0)) { long n = 0L; this.nextRightUp = 0L; this.nextRightDown = 0L; } } else { long n2 = 0L; this.nextRightUp = 0L; this.nextRightDown = 0L; this.nextLeftUp = 0L; this.nextLeftDown = 0L; } } else if ((this.mc.currentScreen instanceof GuiInventory)) { if ((Mouse.isButtonDown(1)) && ((Keyboard.isKeyDown(54)) || (Keyboard.isKeyDown(42)))) { if ((this.nextLeftUp == 0L) || (this.nextLeftDown == 0L)) { generateLeftDelay(); return; } if (System.currentTimeMillis() > this.nextLeftDown) { generateLeftDelay(); clickInventory(this.mc.currentScreen); } } else { long n3 = 0L; this.nextRightUp = 0L; this.nextRightDown = 0L; this.nextLeftUp = 0L; this.nextLeftDown = 0L; } } } private void generateLeftDelay() { if (this.mincps.getValue() > this.maxcps.getValue()) { return; } long d3l4y = (int)Math.round(900.0D / this.mincps.getValue() + this.random.nextDouble() * (this.maxcps.getValue() - this.mincps.getValue())); if (System.currentTimeMillis() > this.nextDrop) { if ((!this.dr0pp1ng) && (this.random.nextInt(100) >= 85)) { this.dr0pp1ng = true; this.dr0pR4t3 = (1.1D + this.random.nextDouble() * 0.15D); } else { this.dr0pp1ng = false; } this.nextDrop = (System.currentTimeMillis() + 500L + this.random.nextInt(1500)); } if (this.dr0pp1ng) { d3l4y *= this.dr0pR4t3; } if (System.currentTimeMillis() > this.nextExhaust) { if (this.random.nextInt(100) >= 80) { d3l4y += 50L + this.random.nextInt(150); } this.nextExhaust = (System.currentTimeMillis() + 500L + this.random.nextInt(1500)); } this.nextLeftDown = (System.currentTimeMillis() + d3l4y); this.nextLeftUp = (System.currentTimeMillis() + d3l4y / 2L - this.random.nextInt(10)); } private void clickInventory(GuiScreen screen) { int v4r1 = Mouse.getX() * screen.width / this.mc.displayWidth; int v4r2 = screen.height - Mouse.getY() * screen.height / this.mc.displayHeight - 1; int v4r3 = 0; try { this.guiScreenMethod.setAccessible(true); this.guiScreenMethod.invoke(screen, new Object[] { Integer.valueOf(v4r1), Integer.valueOf(v4r2), Integer.valueOf(0) }); this.guiScreenMethod.setAccessible(false); } catch (Exception e) { e.printStackTrace(); } } } I set the Mouse.isButtonDown at 1 for right click I want when I press right click it posing blocks at delay I set
-
Thanks worked !
-
This it's my problem in playerSP.getHeldItemOffhand() instanceof ItemBlock
-
Hi, I want to check if block is in MainHand or OffHand but i don't know how package xyz.fusked.m0dules.mods.combat; import java.lang.reflect.Method; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.KeyBinding; import net.minecraft.init.Blocks; import net.minecraft.item.ItemAxe; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import xyz.fusked.m0dules.Module; import xyz.fusked.m0dules.Module.Category; import xyz.fusked.m0dules.Module.Modules; import xyz.fusked.utils.MouseUtil; import xyz.fusked.utils.Timer; import xyz.fusked.values.BooleanValue; import xyz.fusked.values.NumberValue; public class AutoclickDroit extends Module { private NumberValue maxcps; private NumberValue mincps; private NumberValue jitterstren; private BooleanValue jitter; private BooleanValue weapon; private BooleanValue inv; private BooleanValue blocks; private long nextLeftUp; private long nextLeftDown; private long nextRightUp; private long nextRightDown; private long nextDrop; private long nextExhaust; private Timer timer; private Random random; private double dr0pR4t3; private boolean dr0pp1ng; private Method guiScreenMethod; public AutoclickDroit() { super("AutoClicker Droit", 0, Module.Category.COMBAT); this.maxcps = new NumberValue("MaxCPS", 12.0D, 1.0D, 20.0D); this.mincps = new NumberValue("MinCPS", 6.0D, 1.0D, 20.0D); this.jitterstren = new NumberValue("Jitter Strength", 0.5D, 0.1D, 2.0D); this.jitter = new BooleanValue("Jitter", false); this.blocks = new BooleanValue("Blocks", false); this.inv = new BooleanValue("Inventory fill", false); this.timer = new Timer(); this.random = new Random(); addValue(this.maxcps); addValue(this.mincps); addValue(this.jitterstren); addBoolean(this.jitter); addBoolean(this.weapon); addBoolean(this.inv); try { this.guiScreenMethod = GuiScreen.class.getDeclaredMethod("mouseClicked", new Class[] { Integer.TYPE, Integer.TYPE, Integer.TYPE }); } catch (NoSuchMethodException e) { e.printStackTrace(); } } public boolean check(EntityPlayerSP playerSP) { return (!this.blocks.getState()) || ((playerSP.getHeldItemOffhand() != null) && (((playerSP.getHeldItemOffhand() instanceof Block)) || ((playerSP.getHeldItemMainhand().getItem() instanceof ItemAxe)))); } @SubscribeEvent public void onTick(TickEvent.ClientTickEvent ev3nt) throws Exception { if ((this.mc.currentScreen == null) && (check(this.mc.thePlayer))) { Mouse.poll(); if (Mouse.isButtonDown(0)) { if ((this.jitter.getState()) && (this.random.nextDouble() > 0.65D)) { float jitterstrenght = (float)(this.jitterstren.getValue() * 0.5D); if (this.random.nextBoolean()) { this.mc.thePlayer.rotationYaw += this.random.nextFloat() * jitterstrenght; } else { this.mc.thePlayer.rotationYaw -= this.random.nextFloat() * jitterstrenght; } if (this.random.nextBoolean()) { this.mc.thePlayer.rotationPitch += (float)(this.random.nextFloat() * (jitterstrenght * 0.75D)); } else { this.mc.thePlayer.rotationPitch -= (float)(this.random.nextFloat() * (jitterstrenght * 0.75D)); } } if ((this.nextLeftDown > 0L) && (this.nextLeftUp > 0L)) { if (System.currentTimeMillis() > this.nextLeftDown) { KeyBinding.setKeyBindState(this.mc.gameSettings.keyBindAttack.getKeyCode(), true); KeyBinding.onTick(this.mc.gameSettings.keyBindAttack.getKeyCode()); MouseUtil.sendClick(0, true); generateLeftDelay(); } else if (System.currentTimeMillis() > this.nextLeftUp) { KeyBinding.setKeyBindState(this.mc.gameSettings.keyBindAttack.getKeyCode(), false); MouseUtil.sendClick(0, false); } } else { generateLeftDelay(); } if (!Mouse.isButtonDown(1)) { long n = 0L; this.nextRightUp = 0L; this.nextRightDown = 0L; } } else { long n2 = 0L; this.nextRightUp = 0L; this.nextRightDown = 0L; this.nextLeftUp = 0L; this.nextLeftDown = 0L; } } else if ((this.mc.currentScreen instanceof GuiInventory)) { if ((Mouse.isButtonDown(0)) && ((Keyboard.isKeyDown(54)) || (Keyboard.isKeyDown(42)))) { if (!this.inv.getState()) { return; } if ((this.nextLeftUp == 0L) || (this.nextLeftDown == 0L)) { generateLeftDelay(); return; } if (System.currentTimeMillis() > this.nextLeftDown) { generateLeftDelay(); clickInventory(this.mc.currentScreen); } } else { long n3 = 0L; this.nextRightUp = 0L; this.nextRightDown = 0L; this.nextLeftUp = 0L; this.nextLeftDown = 0L; } } } private void generateLeftDelay() { if (this.mincps.getValue() > this.maxcps.getValue()) { return; } long d3l4y = (int)Math.round(900.0D / this.mincps.getValue() + this.random.nextDouble() * (this.maxcps.getValue() - this.mincps.getValue())); if (System.currentTimeMillis() > this.nextDrop) { if ((!this.dr0pp1ng) && (this.random.nextInt(100) >= 85)) { this.dr0pp1ng = true; this.dr0pR4t3 = (1.1D + this.random.nextDouble() * 0.15D); } else { this.dr0pp1ng = false; } this.nextDrop = (System.currentTimeMillis() + 500L + this.random.nextInt(1500)); } if (this.dr0pp1ng) { d3l4y *= this.dr0pR4t3; } if (System.currentTimeMillis() > this.nextExhaust) { if (this.random.nextInt(100) >= 80) { d3l4y += 50L + this.random.nextInt(150); } this.nextExhaust = (System.currentTimeMillis() + 500L + this.random.nextInt(1500)); } this.nextLeftDown = (System.currentTimeMillis() + d3l4y); this.nextLeftUp = (System.currentTimeMillis() + d3l4y / 2L - this.random.nextInt(10)); } private void clickInventory(GuiScreen screen) { int v4r1 = Mouse.getX() * screen.width / this.mc.displayWidth; int v4r2 = screen.height - Mouse.getY() * screen.height / this.mc.displayHeight - 1; int v4r3 = 0; try { this.guiScreenMethod.setAccessible(true); this.guiScreenMethod.invoke(screen, new Object[] { Integer.valueOf(v4r1), Integer.valueOf(v4r2), Integer.valueOf(0) }); this.guiScreenMethod.setAccessible(false); } catch (Exception e) { e.printStackTrace(); } } }