Results 1 to 7 of 7

Thread: Need help implementing "dismiss random"

  1. #1
    Join Date
    Feb 2019
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Need help implementing "dismiss random"

    Hi all.

    I have taken a script that my father created (a stall thieving script) and im trying to implement and create variables and a function which recognises an NPC and talks to them when they pop up ( sort of like a random event )
    Please pm me if you have the time to help me out, thanks.

  2. #2
    Join Date
    Jun 2015
    Posts
    36
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Why not just use SRL.DismissRandom()? https://github.com/SRL/SRL/blob/mast...ban.simba#L212

  3. #3
    Join Date
    Mar 2013
    Location
    Argentina
    Posts
    758
    Mentioned
    27 Post(s)
    Quoted
    365 Post(s)

    Default

    Does it have kind of unique colors? you could just make a function to search for the colors it has and every x amount of time check if he's around
    Formerly known as Undorak7

  4. #4
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    If you aren't using the SRL include, you could use a similar method that the SRL.DismissRandom() function uses.

    The function searches for the overhead text that includes your display name, then uses the minimap to get the main screen point of the NPC. Instead of using the minimap (because that method is exclusive to SRL), you could use the overhead text to identify if a random is after you, then have a bank of NPC objects to search through (colours to identify them uniquely). The benefit of this is you aren't having to search every colour for every potential random event multiple times a minute, but rather relying on the common denominator: your screen name.

  5. #5
    Join Date
    Feb 2019
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Dan the man View Post
    If you aren't using the SRL include, you could use a similar method that the SRL.DismissRandom() function uses.

    The function searches for the overhead text that includes your display name, then uses the minimap to get the main screen point of the NPC. Instead of using the minimap (because that method is exclusive to SRL), you could use the overhead text to identify if a random is after you, then have a bank of NPC objects to search through (colours to identify them uniquely). The benefit of this is you aren't having to search every colour for every potential random event multiple times a minute, but rather relying on the common denominator: your screen name.


    Hi dan, that's a great way of explaining it. thank you! Would you have any time spare to help me write it please? I could pay you!

  6. #6
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    I don't have too much time unfortunately. That link to the SRL.DismissRandom that Dailey posted is a good guide to use. It shows you how to detect the overhead text, and colour finding should be simple enough for the randoms themselves.

    You are welcome to post your script here or on Discord if you are having issues. Discord is a lot more active and a lot of people on there are very helpful.

  7. #7
    Join Date
    Jun 2015
    Posts
    36
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Also, the dismissRandom function I linked to previously detects the center point of the main-screen chat that has your name in it (line 223). If you move the mouse to a point about 20px below this, and the the upText says "Talk-to" then your mouse is most likely over the NPC. This way you could avoid trying to detect all the possible colors of the NPCs that might pop up. I have used this method reliably in crowded places like the Karamja fishing docks, because the yellow NPC dot does not always show up on top of the white player dots, which affects the reliability of the Minimap-to-Mainscreen method used in SRL's version of dismissRandom.

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •