Jump to content

Recommended Posts

Posted

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

Posted
5 hours ago, NqwSqw said:

posing a blokc with normal delay and it break it but i don't press left click

I can't understand what you're saying.

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I am playing a modpack with the web displays mod and I tried it out and when I logged back into my world i decided to get rid of the display i placed to move it and it started playing the video from last session and crashed my game, when i tried to start the game again it said it could not start becasue it could not delete a debug file that has the link in it that is no longer being displayed but is trying to, here is the debug folder.   [0201/091808.660:WARNING:chrome_browser_cloud_management_controller.cc(88)] Could not create policy manager as CBCM is not enabled. [0201/091930.426:INFO:CONSOLE(0)] "Error with Permissions-Policy header: Unrecognized feature: 'ch-ua-form-factors'.", source:  (0) [0201/091932.869:WARNING:browser_info.cc(309)] Returning a speculative frame for 25769803781 [6,5] [0201/091933.290:INFO:CONSOLE(5047)] "LegacyDataMixin will be applied to all legacy elements. Set `_legacyUndefinedCheck: true` on element class to enable.", source:  [0201/091933.529:WARNING:browser_info.cc(309)] Returning a speculative frame for 25769803781 [6,5] [0201/091933.529:WARNING:browser_info.cc(309)] Returning a speculative frame for 25769803781 [6,5] [0201/091933.530:WARNING:browser_info.cc(309)] Returning a speculative frame for 25769803781 [6,5] [0201/091933.530:WARNING:browser_info.cc(309)] Returning a speculative frame for 25769803781 [6,5] [0201/091933.557:INFO:CONSOLE(0)] "Error with Permissions-Policy header: Unrecognized feature: 'ch-ua-form-factors'.", source:  (0) [0201/091934.376:WARNING:obfuscated_file_util.cc(1410)] Failed to get origin+type directory: { uri: filesystem:https://www.youtube.com/temporary/, storage key: { origin: https://www.youtube.com, top-level site: https://youtube.com, nonce: <null>, ancestor chain bit: Same-Site }, bucket id: 1 } error:-4 [0201/091935.216:INFO:CONSOLE(0)] "Error with Permissions-Policy header: Unrecognized feature: 'ch-ua-form-factors'.", source:  (0) [0201/091935.241:INFO:CONSOLE(7990)] "Blocked script execution in 'about:blank' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.", source: https://www.youtube.com/s/desktop/3df27587/jsbin/desktop_polymer.vflset/desktop_polymer.js (7990) [0201/091936.766:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705669 [9,5] [0201/091936.767:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705669 [9,5] [0201/091936.767:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705669 [9,5] [0201/091936.767:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705669 [9,5] [0201/091937.243:INFO:CONSOLE(5047)] "LegacyDataMixin will be applied to all legacy elements. Set `_legacyUndefinedCheck: true` on element class to enable.", source: https://www.youtube.com/s/desktop/3df27587/jsbin/desktop_polymer.vflset/desktop_polymer.js (5047) [0201/091938.283:INFO:CONSOLE(7990)] "Blocked script execution in 'about:blank' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.", source: https://www.youtube.com/s/desktop/3df27587/jsbin/desktop_polymer.vflset/desktop_polymer.js (7990) [0201/091939.496:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705669 [9,5] [0201/091953.165:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705676 [9,12] [0201/091953.165:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705676 [9,12] [0201/091953.166:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705676 [9,12] [0201/091953.166:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705676 [9,12] [0201/091959.119:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/091959.119:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/091959.119:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092014.122:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092014.122:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092014.122:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092019.126:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092019.126:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092019.126:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092024.512:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092024.512:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092024.512:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092029.812:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092029.812:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092029.812:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092036.154:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092036.165:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092036.165:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092041.464:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092041.464:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092041.464:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092051.842:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092051.843:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092051.843:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092055.373:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092055.373:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092055.373:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0)
    • If you are searching for mods, I would not search here, this is more of a support forum for using/creating mods with minecraft Forge. Try https://www.curseforge.com/minecraft if you are looking for mods/modpacks to use.
    • I was trying to find a mod that added something specific, and was unable to find it with what limited memory I had of seeing it. I don't know why there isn't an option to include words in overviews of mods. I could see it being in the sort tab near filters on the app in my opinion. It might help someone trying to find something specific, only based off something from the overview tab, but idk
    • Please read the FAQ and post logs as described there.   Also, do not just add a post onto someone else's thread with your issue, create a new one please.
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.