1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question Skulled Player OSRS

Discussion in 'Developer Support' started by Shumbo, Nov 21, 2015.

  1. Shumbo

    Joined:
    Oct 10, 2015
    Messages:
    43
    Likes Received:
    1
    Does the API have a command to detect nearby skulled players?
     
  2. Derk

    Derk 12 year old normie

    Joined:
    Jan 8, 2015
    Messages:
    2,766
    Likes Received:
    1,339
    You can detect overhead visuals so I assume you can detect skulls too.
     
  3. Shumbo

    Joined:
    Oct 10, 2015
    Messages:
    43
    Likes Received:
    1
    Alright thanks,

    I am trying to ask RM to condition my bot that it should not fish if there are near by skulled players. Any help will be appreciated as I am still new to this.

    Code (Text):
    1.  
    2. public class Fish extends Task {
    3.  
    4.  
    5.  
    6.     @Override
    7.     public boolean validate() {
    8.         return Players.getLocal().getAnimationId() == -1 && !Inventory.isFull() && !Npcs.getLoaded("Fishing spot").isEmpty() && Health.getCurrentPercent() > 98 ;
    9.     }
    10.  
    11.     @Override
    12.     public void execute() {
    13.  
    14.  
    15.         Npc Fspot = Npcs.getLoaded("Fishing spot").nearest();
    16.         if (Fspot != null) {
    17.             if (!Fspot.isVisible()){
    18.                 Camera.turnTo(Fspot);
    19.                 if(!Fspot.isVisible()){
    20.                     Path p = BresenhamPath.buildTo(Fspot);
    21.                     if(p != null)
    22.                         p.step();
    23.                 }
    24.             } else if(Fspot.interact("Cage")){
    25.                 Execution.delayUntil(()->Players.getLocal().getAnimationId() != -1, 10000);
    26.             }
    27.  
    28.         }
    29.     }
    30. }
     
  4. imnotarobot

    Joined:
    Nov 27, 2015
    Messages:
    3
    Likes Received:
    2
    Possibly. Try Actor.getOverheadIcons()
    I'd check it myself but I'm still having trouble properly setting up runemate atm.
     
  5. Shumbo

    Joined:
    Oct 10, 2015
    Messages:
    43
    Likes Received:
    1
    Still seem to be stuck. At

    Code (Text):
    1.         LocatableEntityQueryResults<Player> OtherPlayers =Players.getLoaded();
    2.         if  (OtherPlayers.furthest().getOverheadIcons())
    Not sure what to do after this. I am assuming I am wanting to make sure no1 has an overhead icon.
     
  6. Aidden

    Aidden Author of MaxiBots

    Joined:
    Dec 3, 2013
    Messages:
    6,600
    Likes Received:
    990
    Loop over the icons and check for one with the id of the skull. To work out the skull one either go near someone with a skull or get a skull yourself and get the id of the icon
     
  7. Shumbo

    Joined:
    Oct 10, 2015
    Messages:
    43
    Likes Received:
    1
    Thanks Aidden,

    What command would I do to scan for that. If am using a Validate Task based bot
     

Share This Page

Loading...