Results 1 to 5 of 5

Thread: OpenGrandExchange Procedure

  1. #1
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default OpenGrandExchange Procedure

    I made an OpenGrandExchange procedure because there isn't one for nonmembers (though I now know that the members have a few).

    Edit: Updated it and have failsafes and such.

    Edit: Added a FindGrandExchange procedure if you are near it, it will put your character on the southwest corner.

    SCAR Code:
    procedure FindGrandExchange;
    var
      GrandExchangeDTM, x, y, i : integer;
    begin
      MakeCompass('N');
      SetAngle(True);
      GrandExchangeDTM := DTMFromString('78DA6314606060906140014545590CFF81342' +
           '310FF0702467E20431C22C70C55F3E70F13033F540D0880D50811' +
           '500392E727A0460C48F01150234D845DD244B819242F45408D306' +
           '135004BDA1831');
      i := 0;
      repeat
        i := i + 1;
        if  (DTMRotated(GrandExchangeDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
        begin
          Wait(500+random(150));
          Mouse(x, y, 3, 3, True);
          WriteLn('Found Grand Exchange');
          Flag;
          Break;
        end else
        begin
          MMouse(645, 330, 20, 20);
          if (i >= 5) then
          begin
            Writeln('Cannot Find Grand Exchange');
            Reason := 'Cannot Find Grand Exchange';
            EndScript;
          end;
        end;
      until( i>=5 );
      FreeDTM(GrandExchangeDTM);
    end;

    procedure OpenGrandExchange;
    var
      GrandExchangeBMP, x, y, i : integer;
    begin
      GEClerkColor := 4597812;
      MakeCompass('N');
      SetAngle(True);
      i := 0;
      repeat
        i := i + 1;
        if (FindColorTolerance(x, y, GEClerkColor, MSx1, MSy1, MSx2, MSy2, 5)) then
        begin
          MMouse(x, y, 2, 2);
          if (IsUpTextMultiCustom(['alk', 'rand', 'xcha', 'lerk'])) then
          begin
            Wait(300+random(100));
            Mouse(x, y, 2, 2, False);
            Wait(300+random(100));
            ChooseOption('xcha');
            Writeln('Opening Grand Exchange...');
            i := 0;
            Flag;
            Wait(1000+random(250));
            Break;
          end;
        end else
        begin
          MMouse(645, 330, 20, 20);
          if (i >= 5) then
          begin
            Writeln('Cannot Open Grand Exchange');
          end;
        end;
      until(i >= 5);
      GrandExchangeBMP := BitmapFromString(22, 10, 'beNqzNfKwM8aFP' +
           'B1MiEFka8SlHWLC1mKG52sZnu9l+P//PZBBhgMsDSVaLKEoyFITv3' +
           'Y4G1mKGDfg9zWaG4BcLyfD4uQgIImm3c3WCKsJaG4Am6AJMQHZy0D' +
           'tuEzAdIOLJboJEO2UuAG/CUAt1U4cEDdEWTJgugGu3Q0AAui2kg==' +
           '');
      i := 0;
      repeat
        i := i + 1;
        if (FindBitmap(GrandExchangeBMP, x, y)) then
        begin
          Writeln('Opened Grand Exchange');
          Break;
        end else
        begin
          MMouse(645, 330, 20, 20);
          if (i >= 5) then
          begin
            Writeln('Cannot Open Grand Exchange' +inttostr(1));
            Reason := 'Cannot Open Grand Exchange';
            EndScript;
          end;
        end;
      until(i >= 5);
      FreeBitmap(GrandExchangeBMP);
    end;

  2. #2
    Join Date
    Dec 2007
    Location
    Wizzup?'s boat
    Posts
    1,013
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    EndScript;//shouldn't this be TerminateScript; ?

    Also need these variables declared
    SCAR Code:
    procedure FindGrandExchange;
    var
      GrandExchangeDTM, x, y, i : integer;
      Reason : String;
    SCAR Code:
    procedure OpenGrandExchange;
    var
      i, x, y, GrandExchangeBMP : integer;
      Reason : string;

    Also,
    SCAR Code:
    GEClerkColor := ____;
    Needs to be declared and defined somewhere in the script

    PROGGY
    Found Grand Exchange
    Opening Grand Exchange...
    Opened Grand Exchange

    Attachment is SMART version of the 2 procedures for testing purposes
    Project: Welcome To Rainbow

  3. #3
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by benjaa View Post
    SCAR Code:
    EndScript;//shouldn't this be TerminateScript; ?
    Yeah, sorry I actually made this for a script and I had a procedure called EndScript. I'll fix that

    Quote Originally Posted by benjaa View Post

    Also need these variables declared
    SCAR Code:
    procedure FindGrandExchange;
    var
      GrandExchangeDTM, x, y, i : integer;
      Reason : String;
    SCAR Code:
    procedure OpenGrandExchange;
    var
      i, x, y, GrandExchangeBMP : integer;
      Reason : string;

    Also,
    SCAR Code:
    GEClerkColor := ____;
    Needs to be declared and defined somewhere in the script
    Thanks lol, once again I made this actually for a script so some of the stuff I forgot to include because It was elsewhere. I'll fix it when I get home.

    Quote Originally Posted by benjaa View Post

    Attachment is SMART version of the 2 procedures for testing purposes
    So you just added SMART to them for me? I havn't really done anything with SMART yet so thanks . I'll add that in up top and cred ya lol.

  4. #4
    Join Date
    Dec 2007
    Location
    Wizzup?'s boat
    Posts
    1,013
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah, i thought that was the case with most of it (you made the procedure but didnt include)

    It works pretty well, i tested 4 times, changing the spot where i was to begin with each time (n, s, e, w)
    Project: Welcome To Rainbow

  5. #5
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    There i fixed it up for ya. It should work nicely now that it actually can run lol. Thanks benjaa.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Procedure TypeSendRandom & Procedure AutoResponder!
    By Ultra in forum Research & Development Lounge
    Replies: 12
    Last Post: 01-08-2008, 07:04 PM
  2. Replies: 8
    Last Post: 05-24-2007, 11:57 PM
  3. Procedure that calls random procedure?
    By Secet in forum OSR Help
    Replies: 2
    Last Post: 03-03-2007, 03:56 PM

Posting Permissions

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