Thread: [Kronos] How to mics random tele home?

Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 36
  1. #21  
    RuneCasino


    Join Date
    Jul 2007
    Posts
    1,618
    Thanks given
    170
    Thanks received
    228
    Rep Power
    326
    Quote Originally Posted by Patrity View Post
    <?>
    It's final... The variables input there are always the same. When you just throw misc.rand around willy nilly, the values are no longer constant.
    I know what final is, I wasn't thinking about what class I was placing the random code in I was just trying to help the OP from typing a reply (Not being aware where the position line was)
    Reply With Quote  
     

  2. #22  
    Registered Member
    Join Date
    Nov 2020
    Posts
    78
    Thanks given
    41
    Thanks received
    2
    Rep Power
    23
    Quote Originally Posted by Armo View Post
    I see what you're saying now, my mistake. I wasn't thinking about the placement of the random method. There should be no position line, and wherever its being called should handle the random there.

    @OP

    Use this wherever you want it to be called:
    Code:
    Random ran = new Random(); 
    
    player.getMovement().teleport(World.randomHomePos.getX() + ran.nextInt(2),World.randomHomePos.getY() + ran.nextInt(2),World.randomHomePos.getZ());
    [Only registered and activated users can see links. ]

    My dream to receive green colour instead these red colors, uff..
    Reply With Quote  
     

  3. #23  
    RuneCasino


    Join Date
    Jul 2007
    Posts
    1,618
    Thanks given
    170
    Thanks received
    228
    Rep Power
    326
    Read this quote

    Quote Originally Posted by Armo View Post

    Then add this code to wherever you want it to be called (Command, clicking a teleport, teleport interface, etc)

    Code:
    
    Random ran = new Random(); 
    
    player.getMovement().teleport(World.randomHomePos.getX() + ran.nextInt(2),World.randomHomePos.getY() + ran.nextInt(2),World.randomHomePos.getZ());
    Reply With Quote  
     

  4. #24  
    Registered Member
    Join Date
    Nov 2020
    Posts
    78
    Thanks given
    41
    Thanks received
    2
    Rep Power
    23
    Quote Originally Posted by Armo View Post
    Read this quote
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. #25  
    RuneCasino


    Join Date
    Jul 2007
    Posts
    1,618
    Thanks given
    170
    Thanks received
    228
    Rep Power
    326
    Quote Originally Posted by Ilgaz View Post
    [Only registered and activated users can see links. ]

    Hover over the red "Random" in the line Random ran = new Random and then select Import Class, after that select Random (java.util) Here's a pic:



    And for the randomHomePos make sure this line is in World.java under the HOME line

    Code:
    public static final Position randomHomePos = new Position(3085, 3488, 0);
    Reply With Quote  
     

  6. #26  
    Registered Member
    Join Date
    Nov 2020
    Posts
    78
    Thanks given
    41
    Thanks received
    2
    Rep Power
    23
    Quote Originally Posted by Armo View Post
    Hover over the red "Random" in the line Random ran = new Random and then select Import Class, after that select Random (java.util) Here's a pic:



    And for the randomHomePos make sure this line is in World.java under the HOME line

    Code:
    public static final Position randomHomePos = new Position(3085, 3488, 0);

    Thanks for you, and for everyone helped me here. It worked fine, I just wanted it with teleport anim instead of " GetMovment"

    player.getMovement().teleport(World.randomHomePos.getX() + ran.nextInt(2),World.randomHomePos.getY() + ran.nextInt(2),World.randomHomePos.getZ());

    I tried to change it to startTele, etc.. I failed. cos there is no tele methods in Player.java, anyway thanks guys.
    Reply With Quote  
     

  7. #27  
    RuneCasino


    Join Date
    Jul 2007
    Posts
    1,618
    Thanks given
    170
    Thanks received
    228
    Rep Power
    326
    Quote Originally Posted by Ilgaz View Post
    Thanks for you, and for everyone helped me here. It worked fine, I just wanted it with teleport anim instead of " GetMovment"

    player.getMovement().teleport(World.randomHomePos.getX() + ran.nextInt(2),World.randomHomePos.getY() + ran.nextInt(2),World.randomHomePos.getZ());

    I tried to change it to startTele, etc.. I failed. cos there is no tele methods in Player.java, anyway thanks guys.

    Change this line:

    Code:
    player.getMovement().teleport(World.randomHomePos.getX() + ran.nextInt(2),World.randomHomePos.getY() + ran.nextInt(2),World.randomHomePos.getZ());
    Change it to:

    Code:
    teleport(World.randomHomePos.getX() + ran.nextInt(2),World.randomHomePos.getY() + ran.nextInt(2),World.randomHomePos.getZ());
    Reply With Quote  
     

  8. Thankful user:


  9. #28  
    Registered Member
    Join Date
    Nov 2020
    Posts
    78
    Thanks given
    41
    Thanks received
    2
    Rep Power
    23
    Quote Originally Posted by Armo View Post
    Change this line:

    Code:
    player.getMovement().teleport(World.randomHomePos.getX() + ran.nextInt(2),World.randomHomePos.getY() + ran.nextInt(2),World.randomHomePos.getZ());
    Change it to:

    (Sorry hold on)
    That's it! Thanks bro
    Reply With Quote  
     

  10. #29  
    RuneCasino


    Join Date
    Jul 2007
    Posts
    1,618
    Thanks given
    170
    Thanks received
    228
    Rep Power
    326
    Quote Originally Posted by Ilgaz View Post
    That's it! Thanks bro
    I updated my reply, the other one doesn't have the random coord support make sure to use this:

    Code:
    teleport(World.randomHomePos.getX() + ran.nextInt(2),World.randomHomePos.getY() + ran.nextInt(2),World.randomHomePos.getZ());
    Reply With Quote  
     

  11. #30  
    Registered Member
    Join Date
    Nov 2020
    Posts
    78
    Thanks given
    41
    Thanks received
    2
    Rep Power
    23
    Quote Originally Posted by Armo View Post
    I updated my reply, the other one doesn't have the random coord support make sure to use this:

    Code:
    teleport(World.randomHomePos.getX() + ran.nextInt(2),World.randomHomePos.getY() + ran.nextInt(2),World.randomHomePos.getZ());
    My home command:

    case "home": {
    Random ran = new Random();
    teleport(World.randomHomePos.getX() + ran.nextInt(2),World.randomHomePos.getY() + ran.nextInt(2),World.randomHomePos.getZ()); ([Only registered and activated users can see links. ])
    return true;
    }

    And this is what I have in World.java

    public static final Position EDGEHOME = Position.of(3085, 3492, 0);
    public static final Position HOME = new Position(3085, 3488, 0);
    public static final Position randomHomePos = new Position(3085, 3488, 0);
    Reply With Quote  
     

Page 3 of 4 FirstFirst 1234 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. How to Portfoward A Bt-Home-Hub V.2[PICS]
    By A I R Z in forum Tutorials
    Replies: 1
    Last Post: 08-17-2009, 12:23 PM
  2. Replies: 8
    Last Post: 07-17-2009, 05:11 PM
  3. how to make a new home in a 474
    By DSscape™ in forum Tutorials
    Replies: 12
    Last Post: 06-14-2009, 04:55 AM
  4. How to Drop random Item Amounts
    By tucybro in forum Tutorials
    Replies: 7
    Last Post: 06-08-2009, 11:11 PM
  5. Replies: 15
    Last Post: 10-02-2008, 03:27 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •