Page 2 of 2 FirstFirst 12
Results 26 to 46 of 46

Thread: Tutorial - How to find Moving NPC/Monster

  1. #26
    Join Date
    Jun 2007
    Location
    south park
    Posts
    1,160
    Mentioned
    0 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    yeah as integer;
    Simba Code:
    Function TalkingToNpc: Boolean;

    Var
       TPAA: T2DPointArray; // The Variables of the Functions
       TPA: TPointArray;
       CTS, I, Retry: Integer;
        x, y.
    Begin




    like
    x, y.
    or x, y:?
    http://www.youtube.com/user/YoHoJoSRL
    Good scripting guides on youtube
    Formerly known as (djcheater)

  2. #27
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by randy marsh View Post
    Simba Code:
    Function TalkingToNpc: Boolean;

    Var
       TPAA: T2DPointArray; // The Variables of the Functions
       TPA: TPointArray;
       CTS, I, Retry: Integer;
        x, y.
    Begin




    like
    x, y.
    or x, y:?
    Read this tutorial before u start scripting http://villavu.com/forum/showthread.php?t=58935

    Explains the basic of pascal very well! (and what ya need to know to script)

    Creds to DannyRS for this wonderful sig!

  3. #28
    Join Date
    Jun 2007
    Location
    south park
    Posts
    1,160
    Mentioned
    0 Post(s)
    Quoted
    62 Post(s)

    Default

    I have done like twice..
    http://www.youtube.com/user/YoHoJoSRL
    Good scripting guides on youtube
    Formerly known as (djcheater)

  4. #29
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by randy marsh View Post
    I have done like twice..
    Simba Code:
    Function TalkingToNpc: Boolean;

    Var
       TPAA: T2DPointArray; // The Variables of the Functions
       TPA: TPointArray;
       CTS, I, Retry, x, y: Integer;

    Begin

    There you go

  5. #30
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    Simba Code:
    Function TalkingToNpc: Boolean;

    Var
       TPAA: T2DPointArray; // The Variables of the Functions
       TPA: TPointArray;
       CTS, I, Retry, x, y: Integer;

    Begin

    There you go
    U can't always feed the answers to the young'uns
    Let them think!

    Creds to DannyRS for this wonderful sig!

  6. #31
    Join Date
    Jun 2007
    Location
    south park
    Posts
    1,160
    Mentioned
    0 Post(s)
    Quoted
    62 Post(s)

    Default

    Simba Code:
    [Error] C:\Simba\Includes\SRL-OSR/SRL/core/text.simba(805:13): Unknown identifier 'UpChars07' at line 804
    Compiling failed.

    I did that now i get this error grrrrrrr
    http://www.youtube.com/user/YoHoJoSRL
    Good scripting guides on youtube
    Formerly known as (djcheater)

  7. #32
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by randy marsh View Post
    Simba Code:
    [Error] C:\Simba\Includes\SRL-OSR/SRL/core/text.simba(805:13): Unknown identifier 'UpChars07' at line 804
    Compiling failed.

    I did that now i get this error grrrrrrr
    Could u makie a thread, instead of posting this on a tutorial.

    Creds to DannyRS for this wonderful sig!

  8. #33
    Join Date
    Jun 2007
    Location
    south park
    Posts
    1,160
    Mentioned
    0 Post(s)
    Quoted
    62 Post(s)

    Default

    ok sorry my bad
    http://www.youtube.com/user/YoHoJoSRL
    Good scripting guides on youtube
    Formerly known as (djcheater)

  9. #34
    Join Date
    Feb 2013
    Location
    Narnia
    Posts
    615
    Mentioned
    8 Post(s)
    Quoted
    252 Post(s)

    Post

    FindColorsSpiralTolerance(MSCX, MSCY, TPA, YourColorHere, MSX1, MSY1, MSX2, MSY2, Tolerance);

    how "safe" would you say it is clicking on an NPC's head every time? im trying to find a reliable solution to replace my

    Simba Code:
    if FindObjCustom(jx, jy, ['omp', 'tition'], [judgecolor1, judgecolor2, judgecolor3], 5) then
        begin
          MMouse(jx,jy,0,0);
          if IsUpTextMultiCustom(['omp', 'tition']) then
          begin
            ClickMouse2(mouse_left); //talk-to
            judgefindtimer := 0;
            writeln('');
            DrawCustomPaint('Starting Competition', IntToStr(competitionsplayedcount), FloatToStr(expgained), IntToStr(ticketsgained), IntToStr(ctw), TimeRunning, FloatToStr(expperhour));
          end;
        end;

    *jx,jy is MSCX,MSCY*

    so it stops missclicking and attacking the nearby NPC's with the same colors- which i dont get why it does because the uptext doesnt match, only the color

    View my OSR Script Repository!


    Botted to max
    Guides: How to Report Bugs to the Scripter
    ~~~~ Moved to Java. Currently Lurking ~~~~

  10. #35
    Join Date
    Jun 2007
    Location
    south park
    Posts
    1,160
    Mentioned
    0 Post(s)
    Quoted
    62 Post(s)

    Default

    adjust tolerance?
    http://www.youtube.com/user/YoHoJoSRL
    Good scripting guides on youtube
    Formerly known as (djcheater)

  11. #36
    Join Date
    Feb 2013
    Location
    Narnia
    Posts
    615
    Mentioned
    8 Post(s)
    Quoted
    252 Post(s)

    Default

    Quote Originally Posted by randy marsh View Post
    adjust tolerance?
    what do you mean, the judge and guards are all the same color so adjusting tolerance wouldnt do anything?

    View my OSR Script Repository!


    Botted to max
    Guides: How to Report Bugs to the Scripter
    ~~~~ Moved to Java. Currently Lurking ~~~~

  12. #37
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    Is it possible to use more colours?
    Edit: nice tutorial + repped

  13. #38
    Join Date
    Feb 2006
    Location
    Helsinki, Finland
    Posts
    1,395
    Mentioned
    30 Post(s)
    Quoted
    107 Post(s)

    Default

    Nice tutorial, @Nemesis3X!

    However, I noticed that SetToleranceSpeed2Modifiers() was missing from the code's - only ColorToleranceSpeed() (which is SetColorToleranceSpeed() in Simba) was set.
    Looks like Nemesis3X has been inactive for months though, so it might take a while to get this tutorial updated/fixd. :\

  14. #39
    Join Date
    Jul 2012
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Anyone know what my problem is here? When I run the script trying to teleport for rune mysteries, the mouse moves very slow and when it touches the head of Aubury, it just stops the script and doesn't right click.

    program TestTeleport;
    {$DEFINE SMART8}
    {$I SRL/SRL.Simba}
    {$I P07Include.Simba}

    Function FindAuburyAndTele: Boolean;
    Var
    TPAA: T2DPointArray;
    TPA: TPointArray;
    CTS, I, Retry: Integer;
    X, Y: Integer;
    Begin
    CTS := GetColorToleranceSpeed;
    ColorToleranceSpeed(2);
    FindColorsSpiralTolerance(MSCX, MSCY, TPA, 11908799, MSX1, MSY1, MSX2, MSY2, 7);
    ColorToleranceSpeed(CTS);
    TPAA := TPAToATPAEx(TPA, 5, 5);
    SortATPASize(TPAA, True);
    For I := 0 To High(TPAA) Do
    If GetArrayLength(TPAA[i]) > 5 Then
    Begin
    repeat
    inc(Retry);
    MiddleTPAEx(TPAA[i], x, y);
    MMouse(X, Y, 3, 3);
    if (IsUpTextMultiCustom(['ubury'])) then
    Begin
    Result := True;
    GetMousePos(X, Y);
    mouse(x, y, 3, 3, false);
    wait(100 + random(200));
    ChooseOption('elep');
    wait(5000 + random(1000));
    Break;
    End;
    until (Retry = 7);
    Break;
    end;
    end;

    begin

    FindAuburyAndTele

    end.

  15. #40
    Join Date
    Jul 2012
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Also how do I insert a simba code so the text is better?
    FindAuburyAndTeleTest.simba

  16. #41
    Join Date
    Jul 2012
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by randy marsh View Post
    Simba Code:
    [Error] C:\Simba\Includes\SRL-OSR/SRL/core/text.simba(805:13): Unknown identifier 'UpChars07' at line 804
    Compiling failed.

    I did that now i get this error grrrrrrr
    I got this same thing when trying to run a script that wasn't mine but I found a thread that fixes this.
    http://villavu.com/forum/showthread.php?t=99577

  17. #42
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Won View Post
    Anyone know what my problem is here? When I run the script trying to teleport for rune mysteries, the mouse moves very slow and when it touches the head of Aubury, it just stops the script and doesn't right click.

    program TestTeleport;
    {$DEFINE SMART8}
    {$I SRL/SRL.Simba}
    {$I P07Include.Simba}

    Function FindAuburyAndTele: Boolean;
    Var
    TPAA: T2DPointArray;
    TPA: TPointArray;
    CTS, I, Retry: Integer;
    X, Y: Integer;
    Begin
    CTS := GetColorToleranceSpeed;
    ColorToleranceSpeed(2);
    FindColorsSpiralTolerance(MSCX, MSCY, TPA, 11908799, MSX1, MSY1, MSX2, MSY2, 7);
    ColorToleranceSpeed(CTS);
    TPAA := TPAToATPAEx(TPA, 5, 5);
    SortATPASize(TPAA, True);
    For I := 0 To High(TPAA) Do
    If GetArrayLength(TPAA[i]) > 5 Then
    Begin
    repeat
    inc(Retry);
    MiddleTPAEx(TPAA[i], x, y);
    MMouse(X, Y, 3, 3);
    if (IsUpTextMultiCustom(['ubury'])) then
    Begin
    Result := True;
    GetMousePos(X, Y);
    mouse(x, y, 3, 3, false);
    wait(100 + random(200));
    ChooseOption('elep');
    wait(5000 + random(1000));
    Break;
    End;
    until (Retry = 7);
    Break;
    end;
    end;

    begin

    FindAuburyAndTele

    end.
    You have to call setupSRL;

    So your main loop would look like:

    begin

    setupSRL;
    FindAuburyAndTele;

    end.

  18. #43
    Join Date
    Jul 2012
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    You have to call setupSRL;

    So your main loop would look like:

    begin



    setupSRL;
    FindAuburyAndTele;

    end.
    Thanks that was a stupid mistake but the problem is now that it finds the NPC's head and quits. How can I test this without the script always opening a new client when I click "play"?

  19. #44
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Won View Post
    Thanks that was a stupid mistake but the problem is now that it finds the NPC's head and quits. How can I test this without the script always opening a new client when I click "play"?
    You mean ActivateClient;

    Or using SMART?

  20. #45
    Join Date
    Jul 2012
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    You mean ActivateClient;

    Or using SMART?
    Umm... I don't use the "ActivateClient;" but it opens up a new client each time. It's probably from the smart8. Here's what I use:
    FindAuburyAndTeleTest.simba

  21. #46
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Won View Post
    Umm... I don't use the "ActivateClient;" but it opens up a new client each time. It's probably from the smart8. Here's what I use:
    FindAuburyAndTeleTest.simba
    Have you tried updating to SRL osr? And make sure SMART is enabled when you hit run

Page 2 of 2 FirstFirst 12

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
  •