Results 1 to 11 of 11

Thread: Function - SuperTradeScreen

  1. #1
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default Function - SuperTradeScreen

    hi, i made this function for my auto p to p merchant, it'll check if your in trade screen by looking for the green from accept, for the red from decline (both with tol) and for the lack of game tabs. if you set extraSure to true it'll move to the accept button and look for the uptext. have fun and please rate

    UPDATE: ok so i re-did a little bit of this and added in some stuff.
    now you can use it for both the first trade screen SuperTradeScreen(1) and for the second SuperTradeScreen(2). there no longer is the extra sure option, i thought it was just too much.
    Thank you everybody for your contributions and comments, and althought these colors don't change or move around i still preffered to use findcolortol to be sure that this function will resist any minor runescape changes
    SCAR Code:
    {*******************************************************************************
    function SuperTradeScreen(screen: integer): Boolean;
    By: Rasta Magician
    Description: Returns true if you're in trade screen. 1 for first screen, 2
                 for 2nd screen
    eg: SuperTradeScreen(2) will return true if you're in the second trade screen
    *******************************************************************************}


    function SuperTradeScreen(screen: integer): Boolean;
    var
     foundGreen, foundRed, foundBlue :boolean;
     a, b:integer;

    begin

      if screen = 1 then
      begin
        if (TabExists(2))and(TabExists(3))and(TabExists(8)) then
        begin
          writeln('tabs still there, we are not in trade')
          Result := False;
        end else
        begin
          writeln('no tabs');
          foundGreen := FindColorTolerance(a, b, 49152, 218, 168, 297, 212, 5);
          foundRed := FindColorTolerance(a, b, 192, 222, 248, 294, 286, 5);
          if (foundGreen)and(foundRed) then
          begin
            Result:= True;
            writeln('we are in trade screen 1');
          end else
            Result := False;
        end;
      end;

      if screen = 2 then
      begin
        foundGreen := FindColorTolerance(a, b, 49152, 195, 305, 250, 320, 5);
        foundRed := FindColorTolerance(a, b, 192, 268, 305, 321, 320, 5);
        foundBlue := FindColorTolerance(a, b, 16776960, 369, 285, 458, 315, 5);
        if (foundGreen)and(foundRed)and(foundBlue) then
        begin
          Result:= True;
          writeln('we are in trade screen 2');
        end else
          Result := False;
      end;

    end;

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  2. #2
    Join Date
    Sep 2007
    Location
    newcastle australia
    Posts
    240
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    pretty good! simple, yet effective.

    its a good thing you didnt use bitmaps... there are enough of them around to crash any <1.6ghz computer already when you load up SRL.

  3. #3
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Ooo, I'm making a merchanter too. A little competition couldn't hurt I guess.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  4. #4
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by SantaClause View Post
    Ooo, I'm making a merchanter too. A little competition couldn't hurt I guess.
    if you use my function i get extra points towards the win

    thank you elf, glad to hear you liked it

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  5. #5
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    I dont like shortening functions, but sorry, it exists in amount.scar
    and you could do just "result := FindText(x, y, 'Trading with', UpChars, MSX1, MSY1, MSX2, MSY2);"

  6. #6
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    At the moment, I don't trust all the SRL Functions much because I don't know if they've been updated or not.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  7. #7
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Agred ^^

  8. #8
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Nice, but you don't need the tolerance, the colors are stable.
    Like this:

    SCAR Code:
    Function wTradeScreen(First: Boolean): Boolean;

    Begin
      If First Then
      Begin
        if (GetColor(249, 194) = 49152) then
          Result := True;
      End
      Else
      if (GetColor(214, 313) = 49152) And (GetColor(306, 36) = 16776960) then
        Result := True;
      If Result Then WriteLn('wTradeScreen ' + BoolToStr(First) + ' gave True');
    End;



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  9. #9
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    wow, thanks for all the feedback people

    n3ss3s: i know there is TradeScreen n TradeScreen2 in amount.scar, but it only checks for one colour and i thought the colours weren't stable. i'll try out your 'trading with' idea tho, it looks good.

    wizzup?: thank you for the info on the colour, and the re-writtign of the script

    what did you guys think about the tab n the "extrasure" part? a little too much? would anyone actually use this function?

    ~RMagician

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  10. #10
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice combenate it with my trader and all those noobs never beleve we're bots

    good job

  11. #11
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    ok so i re-did a little bit of this and added in some stuff.
    now you can use it for both the first trade screen SuperTradeScreen(1) and for the second SuperTradeScreen(2). there no longer is the extra sure option, i thought it was just too much.
    Thank you everybody for your contributions and comments, and although these colors don't change or move around i still preferred to use findcolortol to be sure that this function will resist any minor runescape changes

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need help with a function.
    By Floor66 in forum OSR Help
    Replies: 15
    Last Post: 04-15-2008, 02:03 PM
  2. Replies: 2
    Last Post: 02-27-2008, 05:20 PM
  3. Replies: 2
    Last Post: 02-26-2008, 08:26 PM
  4. [FUNCTION] FindDoorColour: integer; By ZephyrsFury [FUNCTION]
    By ZephyrsFury in forum Research & Development Lounge
    Replies: 10
    Last Post: 07-27-2007, 08:45 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
  •