Results 1 to 18 of 18

Thread: First Thieving.Scar function (Stunned)

  1. #1
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default First Thieving.Scar function (Stunned)

    Just made it today but it has been working perfectly.

    SCAR Code:
    {*******************************************************************************
    function Stunned: Boolean;
    By: NCDS
    Description: Return's True if stunned by NPC.
    *******************************************************************************}

    function Stunned: Boolean;
    var P: TPoint; Search: TBox;
    begin
      P.x := MSCx;
      P.y := MSCy;
      Search.x1 := P.x - 30;
      Search.y1 := P.y - 30;
      Search.x2 := P.x + 30;
      Search.y2 := P.y + 30;
      Result := FindColorTolerance(P.x, P.y, 2155764, Search.x1, Search.y1,
                  Search.x2, Search.y2, 5) and
                IsChatBoxTextBetween('stunned', 0, 7, 8);
    end;

    Your thoughts..?

  2. #2
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What if Game is filtered? =X (I'm not sure if it still says you're stunned, but just trying to help )

  3. #3
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by 99_ aka ian. View Post
    What if Game is filtered? =X (I'm not sure if it still says you're stunned, but just trying to help )
    The past few day's I have been writing a new thieving script and everytime I get stunned it say's it so AFIAK this will work just fine. I've actually never gotten "stunned" and had it not say it.

    Anyone else know anything of this?

  4. #4
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Don't trust me, haha it's just that they blocked most of the things

  5. #5
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Alright, well I will look into it

  6. #6
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    erm fitering the chat is a user feature you turn it on and off
    and cant you just use getblackchatmessage('tunned');
    Blank!

  7. #7
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    I like it. What's not to like?

    I think it could also be useful in the sense that you can eat a piece of food while you are stunned. When I used to do thieving in RS, I would always eat a slice of cake or 2 when I was stunned. This could increase script efficiency.

    Nice work, IMO.

  8. #8
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Waddo View Post
    and cant you just use getblackchatmessage('tunned');
    Either one would work the same.

    Quote Originally Posted by Coh3n View Post
    I like it. What's not to like?

    I think it could also be useful in the sense that you can eat a piece of food while you are stunned. When I used to do thieving in RS, I would always eat a slice of cake or 2 when I was stunned. This could increase script efficiency.

    Nice work, IMO.
    Thank you

  9. #9
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What Waddo and I were trying to say is that if you right click 'Game' on the chat part (bottom left of game applet), then choose filter, it won't say if you're stunned. It supposedly blocks almost all NPC/object related chat (like it doesn't say you got a log/pick flaxed/etc.)

  10. #10
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by 99_ aka ian. View Post
    What Waddo and I were trying to say is that if you right click 'Game' on the chat part (bottom left of game applet), then choose filter, it won't say if you're stunned. It supposedly blocks almost all NPC/object related chat (like it doesn't say you got a log/pick flaxed/etc.)
    Simple solution, just don't filter the game.

    Quote Originally Posted by NCDS View Post
    Thank you
    No problem, it will be a nice addition, finally something in Thieving.scar.
    Last edited by Coh3n; 06-30-2009 at 06:41 AM.

  11. #11
    Join Date
    Mar 2007
    Location
    <3
    Posts
    2,683
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice one

    Shorten..
    SCAR Code:
    {*******************************************************************************
    function Stunned: Boolean;
    By: NCDS
    Description: Return's True if stunned by NPC.
    *******************************************************************************}

    function Stunned: Boolean;
    var
      P: TPoint;
      Search: TBox;
    begin
      P := Point(MSCX, MSCY);
      Searth := IntToBox(P.x - 30, P.y - 30, P.x + 30, P.y + 30);
      Result := FindColorTolerance(P.x, P.y, 2155764, Search.x1, Search.y1,
                  Search.x2, Search.y2, 5) and
                IsChatBoxTextBetween('stunned', 0, 7, 8);
    end;

  12. #12
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    No problem, it will be a nice addition, finally something in Thieving.scar.
    Quote Originally Posted by N1ke! View Post
    Nice one
    Thanks guys

  13. #13
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    N1ke, search is spelt wrong

    Why not cut out the middle man?

    SCAR Code:
    {*******************************************************************************
    function Stunned: Boolean;
    By: NCDS
    Description: Return's True if stunned by NPC.
    *******************************************************************************}

    function Stunned: Boolean;
    begin
      Result := FindColorTolerance(mmcx, mmcy, 2155764, mmcx - 30, mmcy - 30,
                  mmcx + 30, mmcx + 30, 5) and
                IsChatBoxTextBetween('stunned', 0, 7, 8);
    end;

  14. #14
    Join Date
    Mar 2007
    Location
    <3
    Posts
    2,683
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Don't complain on my spelling <;]

    O_o How did I miss that..

  15. #15
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    N1ke, search is spelt wrong

    Why not cut out the middle man?

    SCAR Code:
    {*******************************************************************************
    function Stunned: Boolean;
    By: NCDS
    Description: Return's True if stunned by NPC.
    *******************************************************************************}

    function Stunned: Boolean;
    begin
      Result := FindColorTolerance(mmcx, mmcy, 2155764, mmcx - 30, mmcy - 30,
                  mmcx + 30, mmcx + 30, 5) and
                IsChatBoxTextBetween('stunned', 0, 7, 8);
    end;
    That actually doesn't work, throws up a bunch of errors, we're searching on Main Screen not mini map and "mmcx - 30, mmcy - 30, mmcx + 30, mmcx + 30," gives a type mismatch, and it's not only because you put "mmcx + 30, mmcx + 30"

    So, the way N1ke! had it seems to be the shortest error free way.
    Last edited by NCDS; 07-01-2009 at 01:41 AM.

  16. #16
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    Change that to mscx then, it's not that hard?
    SCAR Code:
    program New;
    {.include srl/srl.scar}
    function Stunned: Boolean;
    begin
      Result := FindColorTolerance(mscx, mscy, 2155764, mscx - 30, mscy - 30,
                  mscx + 30, mscx + 30, 5) and
                IsChatBoxTextBetween('stunned', 0, 7, 8);
    end;

    begin
    if stunned then writeln('yes!');
    end.
    Quote Originally Posted by Scar Debug
    Failed when compiling
    Line 5: [Error] (19022:34): Variable Expected in script C:\Documents and Settings\Owner\Desktop\admin\scripts\stunned.scar

  17. #17
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    lulz?

    My mistake forgot a variable, but that easy to fix right?

    SCAR Code:
    program New;
    {.include srl/srl.scar}
    function StunnedAt(x, y : Integer): Boolean;
    begin
      Result := FindColorTolerance(x, y, 2155764, mscx - 30, mscy - 30,
                  mscx + 30, mscx + 30, 5) and IsChatBoxTextBetween('stunned', 0, 7, 8);
    end;

    begin
    if stunned then writeln('yes!');
    end.

  18. #18
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    if I am coming off as an ass, my apologies. That isn't what I'm aiming for at all.

    Doesn't it seem more convenient though to just do:
    SCAR Code:
    program New;
    {.include srl/srl.scar}
    function Stunned: Boolean;
    var P: TPoint;
    begin
      P := Point(mscx, mscy);
      Result := FindColorTolerance(P.x, P.y, 2155764, mscx - 30, mscy - 30,
                     mscx + 30, mscx + 30, 5) and
                   IsChatBoxTextBetween('stunned', 0, 7, 8);
    end;

    begin
    if stunned then writeln('yes!');
    end.
    Just to avoid needing user input for parameter's?

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
  •