Results 1 to 17 of 17

Thread: OpenGE procedure?

  1. #1
    Join Date
    May 2009
    Location
    Denmark! YEAH I'M A VIKING!
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default OpenGE procedure?

    Is there an OpenGrandExchange; procedure/function in the SRL base? I've been searching in the SRL/grandexchange.scar, and can't find any thing doing so.

    -Thanks
    I ... Am ... CARTMANN!

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

    Default

    I do not think there is, but making one isn't that hard, play around with TPA's and that kind of stuff

    EDIT: Or use ChArMz' code
    Last edited by Zyt3x; 01-12-2010 at 06:12 PM.

  3. #3
    Join Date
    Mar 2006
    Posts
    403
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    function GEScreen: Boolean;
    var
      TPA: TPointArray;
      B: TBox;
    begin
      Result := False;
    
      FindColors(TPA, 39116, 205, 31, 315, 52);
      if Length(TPA) < 5 then
        Exit;
    
      B := GetTPABounds(TPA);
      with B do
        Result := Pos('Grand', GetTextAtEx(x1 - 1, y1 - 2, 0, UpChars, False, False, 0, 1, 39116, 20, False, tr_AllChars)) > 0;
    end;
    
    function OpenGE: Boolean;
    var
      C: TPointArray;
      B: TBox;
      C2D: T2DPointArray;
      I, T: Integer;
    begin
      if ( not LoggedIn ) then
        Exit;
      Result := False;
    
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.10, 0.19);
    
      FindColorsTolerance(C, 3219751, MSX1, MSY1, MSX2, MSY2, 7);
    
      if Length(C) > 0 then
        C2D := SplitTPA(C, 5)
      else
        Exit;
      SortATPAFromFirstPoint(C2D, Point(MSCX, MSCY));
    
      for I := 0 to High(C2D) do
      begin
        if Length(C2D[I]) < 50 then
          Continue;
    
        B := GetTPABounds(C2D[I]);
        with B do
          MMouse(RandomRange(x1, x2), RandomRange(y1, y2), 2, 2);
    
        //if ( not Pos('clerk', rs_GetUpText) > 0 ) then
          //Continue;
    
        GetMousePos(x, y);
        Mouse(x, y, 0, 0, False);
        Result := FastChooseOption('ange Gra');
    
        if Result then
          Break;
      end;
    
      if Result then
      begin
        T := GetSystemTime;
        while ( GetSystemTime - T < 10000 ) and
              ( not GEScreen ) do
          Wait(50 + Random(100));
      end;
      Result := GEScreen;
    end;

  4. #4
    Join Date
    May 2009
    Location
    Denmark! YEAH I'M A VIKING!
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by _ChArMz View Post
    Code:
    function GEScreen: Boolean;
    var
      TPA: TPointArray;
      B: TBox;
    begin
      Result := False;
    
      FindColors(TPA, 39116, 205, 31, 315, 52);
      if Length(TPA) < 5 then
        Exit;
    
      B := GetTPABounds(TPA);
      with B do
        Result := Pos('Grand', GetTextAtEx(x1 - 1, y1 - 2, 0, UpChars, False, False, 0, 1, 39116, 20, False, tr_AllChars)) > 0;
    end;
    
    function OpenGE: Boolean;
    var
      C: TPointArray;
      B: TBox;
      C2D: T2DPointArray;
      I, T: Integer;
    begin
      if ( not LoggedIn ) then
        Exit;
      Result := False;
    
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.10, 0.19);
    
      FindColorsTolerance(C, 3219751, MSX1, MSY1, MSX2, MSY2, 7);
    
      if Length(C) > 0 then
        C2D := SplitTPA(C, 5)
      else
        Exit;
      SortATPAFromFirstPoint(C2D, Point(MSCX, MSCY));
    
      for I := 0 to High(C2D) do
      begin
        if Length(C2D[I]) < 50 then
          Continue;
    
        B := GetTPABounds(C2D[I]);
        with B do
          MMouse(RandomRange(x1, x2), RandomRange(y1, y2), 2, 2);
    
        //if ( not Pos('clerk', rs_GetUpText) > 0 ) then
          //Continue;
    
        GetMousePos(x, y);
        Mouse(x, y, 0, 0, False);
        Result := FastChooseOption('ange Gra');
    
        if Result then
          Break;
      end;
    
      if Result then
      begin
        T := GetSystemTime;
        while ( GetSystemTime - T < 10000 ) and
              ( not GEScreen ) do
          Wait(50 + Random(100));
      end;
      Result := GEScreen;
    end;
    THANKS! Did you pull that out of the SRL database?
    I ... Am ... CARTMANN!

  5. #5
    Join Date
    May 2009
    Location
    Denmark! YEAH I'M A VIKING!
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Charmz, i can't compile your functions, it says it doesnt exits?:

    Line 90: [Error] (21512:11): Unknown identifier 'FastChooseOption' in script C:\Documents and Settings\.......\WalkLUMBandGE.scar
    I ... Am ... CARTMANN!

  6. #6
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Cartmann View Post
    Charmz, i can't compile your functions, it says it doesnt exits?:

    Line 90: [Error] (21512:11): Unknown identifier 'FastChooseOption' in script C:\Documents and Settings\.......\WalkLUMBandGE.scar
    Replace with Result := ChooseOption('ange Gra'); or w/e

  7. #7
    Join Date
    May 2009
    Location
    Denmark! YEAH I'M A VIKING!
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you IceFire, i have another problem too, but that isn't topic related thouge, hope you can help me anyway :P

    I've used a "symbol" from the SRL database in this line:

    Code:
    If not FindSymbolIn(x, y, water,  MMX1, MMY1, MMX2, MMY2) then
    then my script says this when i compile:

    Line 145: [Error] (21567:27): Unknown identifier 'water' in script C:\Documents and Settings\Alexander\Skrivebord\Scar\scarprerelease\ Scripts\WalkLUMBandGE.scar
    I ... Am ... CARTMANN!

  8. #8
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Cartmann View Post
    Thank you IceFire, i have another problem too, but that isn't topic related thouge, hope you can help me anyway :P

    I've used a "symbol" from the SRL database in this line:

    Code:
    If not FindSymbolIn(x, y, water,  MMX1, MMY1, MMX2, MMY2) then
    then my script says this when i compile:

    Line 145: [Error] (21567:27): Unknown identifier 'water' in script C:\Documents and Settings\Alexander\Skrivebord\Scar\scarprerelease\ Scripts\WalkLUMBandGE.scar
    'water'

  9. #9
    Join Date
    May 2009
    Location
    Denmark! YEAH I'M A VIKING!
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes "water", it's from
    Code:
    {.include SRL/SRL/core/symbol.scar}
    which i've tried to add into my script, but then i got this result:

    It opened another tab, with "symbols" saying:

    Line 17: [Error] (21446:1): Duplicate identifier 'SymbolAccuracy' in script C:\Documents and Settings\Alexander\Skrivebord\Scar\scarprerelease\ includes\SRL\SRL\core\symbol.scar
    I ... Am ... CARTMANN!

  10. #10
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Cartmann View Post
    Yes "water", it's from
    Code:
    {.include SRL/SRL/core/symbol.scar}
    which i've tried to add into my script, but then i got this result:

    It opened another tab, with "symbols" saying:
    SCAR Code:
    If not FindSymbolIn(x, y, 'water',  MMX1, MMY1, MMX2, MMY2) then

    And lol, include files can't be compiled

  11. #11
    Join Date
    May 2009
    Location
    Denmark! YEAH I'M A VIKING!
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yeah lol, that seemed to solve my problem.

    I think my last bug would be this:

    Code:
    procedure UseGE;
    begin
    If not GEScreen=true then
     begin
      writeln('Couldnt open GE')
      exit;
     end else
      if Players[CurrentPlayer].Booleans[0]=true then
       GESell(Players[CurrentPlayer].Strings[0], Players[CurrentPlayer].Strings[1], Players[CurrentPlayer].Integers[0]);
        if GESell=true then
         writenl('Succesfully trying to sell items');
    I'm doing an SRL function GESell, which returns a boolean (i presume it's about the succes of the attempted sell)
    So i ask if the trade went smooth "GESell=true" but i get a compile error in that line of code:

    Line 207: [Error] (21629:10): Invalid number of parameters in script C:\Documents and Settings\Alexander\Skrivebord\Scar\scarprerelease\ Scripts\WalkLUMBandGE.scar
    I ... Am ... CARTMANN!

  12. #12
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Function GESell(Price, Quantity: string; InvSpot: integer): boolean;

    It would help if you looked at the function parameters, you can see there are two strings and 1 integer.

  13. #13
    Join Date
    May 2009
    Location
    Denmark! YEAH I'M A VIKING!
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    GESell(Players[CurrentPlayer].Strings[0], Players[CurrentPlayer].Strings[1], Players[CurrentPlayer].Integers[0])

    yes?
    I ... Am ... CARTMANN!

  14. #14
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Dunno, paste a sufficient piece of the surrounding code or we don't have anything to go on.

  15. #15
    Join Date
    May 2009
    Location
    Denmark! YEAH I'M A VIKING!
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    http://pastebin.com/f4d1faabc

    Line 207 seems to be the problem.
    I ... Am ... CARTMANN!

  16. #16
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    GESell(Players[CurrentPlayer].Strings[0], Players[CurrentPlayer].Strings[1], Players[CurrentPlayer].Integers[0]);
        if GESell=true then

    ->

    SCAR Code:
    if (GESell(Players[CurrentPlayer].Strings[0], Players[CurrentPlayer].Strings[1], Players[CurrentPlayer].Integers[0])) then
         writeln('Succesfully trying to sell items') //no ; here because of else either

    You don't need =true either... and it's WriteLn

  17. #17
    Join Date
    May 2009
    Location
    Denmark! YEAH I'M A VIKING!
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    YES! it succesfully compiled just need to add some colors to the TPA's and this is of for testing

    Btw, some +rep comeing your way IceFire908
    I ... Am ... CARTMANN!

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
  •