Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • drubrkletern: be honest with me boss
      December 06, 2019, 01:31:52 AM
    • drubrkletern: now is it really that unique
      December 06, 2019, 01:31:47 AM
    • SuperNativeZ: COME PLAY THE MOST UNIQUE CUSTOM RSPS #1 [link][link][link]
      December 05, 2019, 09:22:55 PM
    • SuperNativeZ: FASTEST GROWING #1 UNIQUE CUSTOM RSPS [link][link][link]
      December 05, 2019, 09:22:42 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 60+ online : [link]
      December 05, 2019, 02:48:39 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      December 05, 2019, 02:48:31 PM
    • Cole1497: you click any of these links? those boner pills theyre selling are wicked
      December 04, 2019, 05:58:03 PM
    • Cole1497: oh shit vain whats crackin
      December 04, 2019, 05:57:49 PM
    • ArtexAdv: FASTEST GROWING #1 UNIQUE CUSTOM RSPS [link]
      December 04, 2019, 06:30:27 AM
    • Vain_: where the boys at
      December 01, 2019, 03:20:36 PM
    • black evil111: They should close this down, mostly the downloads section. The mods dont know how to do their jobs worth shit and its no excuse like "we have real life stuff going on" everyones replacable. Speaking of replacable, fix download links! Before I go to rune-server.
      December 01, 2019, 01:50:26 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      November 28, 2019, 12:41:24 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      November 28, 2019, 12:40:42 PM
    • 1strangler77: how do i post pictures on a post
      November 24, 2019, 05:16:18 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      November 23, 2019, 08:23:51 PM
    • Freja1793: Hi
      November 22, 2019, 07:58:41 PM
    • xdarklordxx: JOIN NOW [link]
      November 22, 2019, 03:19:16 PM
    • xdarklordxx: RUNITY IS BACK AND BETTER THAN EVER VERY NICE STAFF AND TONS OF CUSTOMS!!
      November 22, 2019, 03:18:36 PM
    • xdarklordxx: >!https://dl.dropbox.com/s/9iwtazv703mpqsw/LmfaoScape.jar<!
      November 22, 2019, 03:17:04 PM
    • Shadow Monarch: where do i get a client and source
      November 19, 2019, 11:17:48 PM

    Author Topic: [317refactor] Adding the shift-click focus to your client  (Read 644 times)

    0 Members and 1 Guest are viewing this topic.

    OfflineAmbokile

    • Member
    • ****
    • Posts: 3,009
    • Thanks: +0/-0
      • View Profile
    [317refactor] Adding the shift-click focus to your client
    « on: January 31, 2015, 07:00:15 AM »
    Hi all. A short guide here on adding the shift-click focusing to your 317refactor-based client.

    Head over to the RSApplet class. You want to declare a new boolean called shiftClick with the other global variables.
    Code: Java
    1. boolean shiftClick;

    You now want to head to the mousePressed method and add the following code above the isMetaDown() check.
    Code: Java
    1. if(mouseEvent.isShiftDown()){
    2.         shiftClick =true;
    3. }else{
    4.         shiftClick =false;
    5. }

    This uses the isShiftDown() method from the MouseEvent class to check whether the user is holding shift whilst clicking the mouse and, if so, stores that in the boolean.

    We're done in the RSApplet class, head over to the Client class. At the top of the class, declare a boolean called shiftClickWarning with a default value of false.
    Code: Java
    1. boolean shiftClickWarning =false;

    Search for the following line of code, there is only one occurrence in the class.
    Code: Java
    1. if(WorldController.clickedTileX!=-1){

    Now, replace everything inside that if-statement with the following code:
    Code: Java
    1. if(super.shiftClick){
    2.         if(!shiftClickWarning){
    3.                 pushMessage("Walking disabled due to shift-click.", 0, "");
    4.                 shiftClickWarning =true;
    5.         }
    6. }else{
    7.         int x = WorldController.clickedTileX;
    8.         int y = WorldController.clickedTileY;
    9.         boolean walkable = doWalkTo(0, 0, 0, 0, localPlayer.waypointY[0],
    10.                         0, 0, y, localPlayer.waypointX[0], true, x);
    11.         WorldController.clickedTileX=-1;
    12.         if(walkable){
    13.                 crossX =super.clickX;
    14.                 crossY =super.clickY;
    15.                 crossType =1;
    16.                 crossIndex =0;
    17.         }
    18. }

    As you can see, the code checks whether the player is holding shift. If they're not, click on the tile as usual. If they are, the code then checks whether they've already received the warning message. If they haven't, the code sends the message and records the fact that they've received the message.
    Runescape Gambling

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal