Thread: Prioritizing the "Walk here" option to be the left click option

Results 1 to 6 of 6
  1. #1 Prioritizing the "Walk here" option to be the left click option 
    Registered Member
    Join Date
    Feb 2009
    Posts
    109
    Thanks given
    1
    Thanks received
    19
    Rep Power
    30
    racoonleftclick.PNG

    I'd like to prioritize "Walk here" as the left click option. How would I go about doing this? I've added the "Interact" option in the client, so that's a custom right-click option on the raccoon. I'll post any code from my client if needed. I'm using pretty much a half non-renamed, half renamed client. This was what I added in EntityDef.java for the right-click option:

    Code:
            if(i == 3286)
            {
    	entityDef.actions = new String[5];
    	entityDef.actions[4] = "Interact";
            }
    Reply With Quote  
     

  2. #2  
    Community Veteran

    Dust R I P's Avatar
    Join Date
    Jan 2008
    Posts
    2,599
    Thanks given
    197
    Thanks received
    221
    Rep Power
    586
    Look at the code that handles the order based on your combat level. Copy it and make a condition that has to be met for that rule to apply.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Feb 2009
    Posts
    109
    Thanks given
    1
    Thanks received
    19
    Rep Power
    30
    Quote Originally Posted by Dust R I P View Post
    Look at the code that handles the order based on your combat level. Copy it and make a condition that has to be met for that rule to apply.
    So this got me a little bit closer! Here's what I was able to do so far

    almostcorrect.jpg

    It seems to be sending the action twice now, and I can't seem to figure out how to make that top action disappear. Here's what I added so far:

    interactcode.PNG

    (Here's the actual pasted code if needed)

    Code:
                if(entityDef.actions != null)
                {
                    for(int i1 = 4; i1 >= 0; i1--)
    
                        if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack") || entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("interact"))
                        {
                            char c = '\0';
                            if((entityDef.combatLevel > myPlayer.combatLevel) || entityDef.name.equalsIgnoreCase("Raccoon"))
                                c = '\u07D0';
                            menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
                            if(i1 == 0)
                                menuActionID[menuActionRow] = 20 + c;
                            if(i1 == 1)
                                menuActionID[menuActionRow] = 412 + c;
                            if(i1 == 2)
                                menuActionID[menuActionRow] = 225 + c;
                            if(i1 == 3)
                                menuActionID[menuActionRow] = 965 + c;
                            if(i1 == 4)
                                menuActionID[menuActionRow] = 478 + c;
                            menuActionCmd1[menuActionRow] = i;
                            menuActionCmd2[menuActionRow] = k;
                            menuActionCmd3[menuActionRow] = j;
                            menuActionRow++;
                        }
    
                }
    Any thoughts?
    Reply With Quote  
     

  4. #4  
    Donator

    Join Date
    Mar 2019
    Posts
    22
    Thanks given
    11
    Thanks received
    3
    Rep Power
    11
    Declare:
    Code:
        public static int npcPetId = -1;
    Code:
                for (int l = 4; l >= 0; l--) {
                    // Is not an attack option.
                    if (npcDefinition.actions[l] != null) {
                        if (npcDefinition.actions[l].equalsIgnoreCase("Pick-up")) {
                            //System.out.println("npcPetId = "+npcPetId+" vs index: "+npcIndex);
                            if (npcPetId != npcIndex) {
                                return;
                            }
                        }
                    }
                }
            }
    underneath the } else{
    Code:
                boolean isPet = false;
                if (npcDefinition.actions != null) {
                    for (int l = 4; l >= 0; l--) {
                        // Is not an attack option.
                        if (npcDefinition.actions[l] != null && !npcDefinition.actions[l].equalsIgnoreCase("attack")) {
                            if (npcDefinition.actions[l].contains("Pick-up")) {
                                isPet = true;
                            }
                            char c = '\0';
                            if (isPet && setting.shift_pet_options) {
                                c = '\u07D0';
                            }
                            menuActionText[menuActionRow] = npcDefinition.actions[l] + " <col=ffff00>" + name;
                            if (l == 0)
                                menuActionTypes[menuActionRow] = 20 + c;
                            if (l == 1)
                                menuActionTypes[menuActionRow] = 412 + c;
                            if (l == 2)
                                menuActionTypes[menuActionRow] = 225 + c;
                            if (l == 3)
                                menuActionTypes[menuActionRow] = 965 + c;
                            if (l == 4)
                                menuActionTypes[menuActionRow] = 478 + c;
                            selectedMenuActions[menuActionRow] = npcIndex;
                            firstMenuAction[menuActionRow] = npcArrayIndex;
                            secondMenuAction[menuActionRow] = j;
                            menuActionRow++;
                        }
                    }
                }
    You'll need a packet to send what is/isn't a pet from your Server, my codes been leaked many of times for my Server, I'm sure you can find it, but I've refactored much of the Server/Client at this point, I'm not comfortable with sharing it, I know I've not refactored this code as of yet, had no need to.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Feb 2009
    Posts
    109
    Thanks given
    1
    Thanks received
    19
    Rep Power
    30
    Quote Originally Posted by Elfin View Post
    Declare:
    Code:
        public static int npcPetId = -1;
    Code:
                for (int l = 4; l >= 0; l--) {
                    // Is not an attack option.
                    if (npcDefinition.actions[l] != null) {
                        if (npcDefinition.actions[l].equalsIgnoreCase("Pick-up")) {
                            //System.out.println("npcPetId = "+npcPetId+" vs index: "+npcIndex);
                            if (npcPetId != npcIndex) {
                                return;
                            }
                        }
                    }
                }
            }
    underneath the } else{
    Code:
                boolean isPet = false;
                if (npcDefinition.actions != null) {
                    for (int l = 4; l >= 0; l--) {
                        // Is not an attack option.
                        if (npcDefinition.actions[l] != null && !npcDefinition.actions[l].equalsIgnoreCase("attack")) {
                            if (npcDefinition.actions[l].contains("Pick-up")) {
                                isPet = true;
                            }
                            char c = '\0';
                            if (isPet && setting.shift_pet_options) {
                                c = '\u07D0';
                            }
                            menuActionText[menuActionRow] = npcDefinition.actions[l] + " <col=ffff00>" + name;
                            if (l == 0)
                                menuActionTypes[menuActionRow] = 20 + c;
                            if (l == 1)
                                menuActionTypes[menuActionRow] = 412 + c;
                            if (l == 2)
                                menuActionTypes[menuActionRow] = 225 + c;
                            if (l == 3)
                                menuActionTypes[menuActionRow] = 965 + c;
                            if (l == 4)
                                menuActionTypes[menuActionRow] = 478 + c;
                            selectedMenuActions[menuActionRow] = npcIndex;
                            firstMenuAction[menuActionRow] = npcArrayIndex;
                            secondMenuAction[menuActionRow] = j;
                            menuActionRow++;
                        }
                    }
                }
    You'll need a packet to send what is/isn't a pet from your Server, my codes been leaked many of times for my Server, I'm sure you can find it, but I've refactored much of the Server/Client at this point, I'm not comfortable with sharing it, I know I've not refactored this code as of yet, had no need to.
    So I added this:

    Code:
                if(entityDef.actions != null)
                {
                    for(int i1 = 4; i1 >= 0; i1--)
    
                        if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("interact"))
                        {
                            char c = '\0';
                            if(entityDef.name.equalsIgnoreCase("Raccoon"))
                                c = '\u07D0';
                            menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
                            if(i1 == 0)
                                menuActionID[menuActionRow] = 20 + c;
                            if(i1 == 1)
                                menuActionID[menuActionRow] = 412 + c;
                            if(i1 == 2)
                                menuActionID[menuActionRow] = 225 + c;
                            if(i1 == 3)
                                menuActionID[menuActionRow] = 965 + c;
                            if(i1 == 4)
                                menuActionID[menuActionRow] = 478 + c;
                            menuActionCmd1[menuActionRow] = i;
                            menuActionCmd2[menuActionRow] = k;
                            menuActionCmd3[menuActionRow] = j;
                            menuActionRow++;
                        }
    
                }
    However it still seems to be sending the interact option twice. I can't seem to remove that top option

    Wait I see you changed your post. Let me try that
    Reply With Quote  
     

  6. #6  
    Donator

    Join Date
    Mar 2019
    Posts
    22
    Thanks given
    11
    Thanks received
    3
    Rep Power
    11
    Try it without the raccoon being the in the code;

    Code:
                if(entityDef.actions != null)
                {
                    for(int i1 = 4; i1 >= 0; i1--)
    
                        if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("Interact"))
                        {// Interact was lowercase "interact" in your snippet
                            char c = '\u07D0'; //we don't want to tie this just to raccoon, because well, how many NPC's in OSRS have "Interact" as an option?
                            menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
                            if(i1 == 0)
                                menuActionID[menuActionRow] = 20 + c;
                            if(i1 == 1)
                                menuActionID[menuActionRow] = 412 + c;
                            if(i1 == 2)
                                menuActionID[menuActionRow] = 225 + c;
                            if(i1 == 3)
                                menuActionID[menuActionRow] = 965 + c;
                            if(i1 == 4)
                                menuActionID[menuActionRow] = 478 + c;
                            menuActionCmd1[menuActionRow] = i;
                            menuActionCmd2[menuActionRow] = k;
                            menuActionCmd3[menuActionRow] = j;
                            menuActionRow++;
                        }
    
                }
    Reply With Quote  
     


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. Galkons Change Walk Here Option?
    By Akeid in forum Help
    Replies: 3
    Last Post: 08-19-2010, 04:45 AM
  2. Replies: 3
    Last Post: 06-23-2010, 05:25 AM
  3. "Walk here" Option
    By thenolifer in forum Help
    Replies: 42
    Last Post: 06-07-2010, 10:05 AM
  4. Replies: 13
    Last Post: 12-06-2009, 09:22 AM
  5. Make walk here option first?
    By Runebay™ in forum Help
    Replies: 1
    Last Post: 11-30-2009, 09:53 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
  •