Results 1 to 4 of 4

Thread: Will this work?

  1. #1
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Lightbulb Will this work?

    Hey i say the man's problem, so i decided i'd write this up quickly and just ask people where it can be improved.
    Will this work lolz?
    SCAR Code:
    Function Loc(Where: String): boolean;
    Var
       symbols: Tstringarray;
    begin
      case(Where)of
    'Bank': begin
              if FindSymbol(x, y, 'bank') and FindColor(x, y, FindVarrockRoadColor, MMX1, MMX2, MMY1, MMY2)then
              begin
                Writeln('Location: Bank');
                Result := true;
              end;
            end;
    'Mine': begin
              if FindSymbol(x, y, 'mining spot') and FindColor(x, y, FindVarrockRoadColor, MMX1, MMX2, MMY1, MMY2)then
              begin
                Writeln('Location: Mine');
                Result := True;
              end;
            end;
    'Lost': begin
              Symbols := ['bank', 'mining spot'];
              for i := 0 to 1 do
              begin
                if(not(FindSymbol(x, y, Symbols[i])) and (not(FindColor(x, y, FindVarrockRoadColor, MMX1, MMX1, MMY1, MMY2)))then
              //nextplaya[false]
              end else
               if TileOnMM(3286, 3365) or FindSymbol(x, y, 'mining spot')then
               case Random(1) of
               0: WalkToTile(Point(3286, 3365), 2, 0);
               1: WalkToTile(Point(3284, 3369), 0, 0);
               2: Mouse(x, y, 2, 2, true);
                  Flag;
               end;
               if TileOnMM(3254, 3421) or FindSymbol(x, y, 'bank') then
               case Random(2) of
               0: WalkToTile(Point(3254, 3421), 3, 0);
               1: WalkToTile(Point(3251, 3421), 2, 0);
               2: Mouse(x, y, 3, 3, true);
                  Flag;
               end;
            Writeln('BAK N Track');
            Result := False;
            Exit;
         end;
       end;
    end;

    Ignore the somewhat crappy standards, will this work, in terms of runescape?
    Anyways I can improve it?

    Then i'd be able to somewhat like this

    Code:
    if Loc('Mine')then
    minerock;
    end else
    if loc('bank')then
    walktomine;
    wait;
    minerock;
    Last edited by Smarter Child; 07-27-2009 at 02:38 AM.

  2. #2
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    SCAR Code:
    case Random(1) of
               0: WalkToTile(Point(3286, 3365), 2, 0);
               1: WalkToTile(Point(3284, 3369), 0, 0);
               2: MouseFlag(x, y, 2, 2, 0);  // fixed this to MouseFlag
               end;
               if TileOnMM(3254, 3421) or FindSymbol(x, y, 'bank') then
               case Random(2) of
               0: WalkToTile(Point(3254, 3421), 3, 0);
               1: WalkToTile(Point(3251, 3421), 2, 0);
               2: MouseFlag(x, y, 3, 3, 0); // fixed this to MouseFlag
               end;

    these should be random(3) both.
    Random(1) = 0
    Random(2) = 0, 1
    Random(3) = 0, 1, 2

    I believe there is some function called FindSymbolsMulti or something?
    Also, i suggest you make a separate function for relocation, in case of you're lost.
    SCAR Code:
    if Loc('lost') then
      FixLocation;

    Btw, you never set result := true in Loc('Lost')

  3. #3
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well if it Loc 'lost' becomes true, after the location was 'fixed' then you aren't lost.
    Fixed: Yes, ill use FindSymbolsMulti.
    Btw, should i result it as true?, im not sure thats why.

    SCAR Code:
    Function Loc(Where: String): boolean;
    Var
       symbols: Tstringarray;
    begin
      case(Where)of
    'Bank': begin
              if FindSymbol(x, y, 'bank') and FindColor(x, y, FindVarrockRoadColor, MMX1, MMX2, MMY1, MMY2)then
              begin
                Writeln('Location: Bank');
                Result := true;
              end;
            end;
    'Mine': begin
              if FindSymbol(x, y, 'mining spot') and FindColor(x, y, FindVarrockRoadColor, MMX1, MMX2, MMY1, MMY2)then
              begin
                Writeln('Location: Mine');
                Result := True;
              end;
            end;
    'Lost': begin
              if(not(FindSymbolsMulti(TPA, ['bank','mining spot']))) and (not(FindColor(x, y, FindVarrockRoadColor, MMX1, MMX1, MMY1, MMY2)))then
              //nextplaya[false]
              end else
               if TileOnMM(3286, 3365) or FindSymbol(x, y, 'mining spot')then
               case Random(3) of
               0: WalkToTile(Point(3286, 3365), 2, 0);
               1: WalkToTile(Point(3284, 3369), 0, 0);
               2: Mouse(x, y, 2, 2, true);
                  Flag;
               end;
               if TileOnMM(3254, 3421) or FindSymbol(x, y, 'bank') then
               case Random(3) of
               0: WalkToTile(Point(3254, 3421), 3, 0);
               1: WalkToTile(Point(3251, 3421), 2, 0);
               2: Mouse(x, y, 3, 3, true);
                  Flag;
               end;
            Writeln('BAK N Track');
            Result := False;
            Exit;
         end;
       end;
    end;
    Last edited by Smarter Child; 07-27-2009 at 03:04 AM.

  4. #4
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Quote Originally Posted by Smarter Child View Post
    Well if it Loc 'lost' becomes true, after the location was 'fixed' then you aren't lost.
    Fixed: Yes, ill use FindSymbolsMulti.
    Btw, should i result it as true?, im not sure thats why.

    SCAR Code:
    Function Loc(Where: String): boolean;
    Var
       symbols: Tstringarray;
    begin
      case(Where)of
    'Bank': begin
              if FindSymbol(x, y, 'bank') and FindColor(x, y, FindVarrockRoadColor, MMX1, MMX2, MMY1, MMY2)then
              begin
                Writeln('Location: Bank');
                Result := true;
              end;
            end;
    'Mine': begin
              if FindSymbol(x, y, 'mining spot') and FindColor(x, y, FindVarrockRoadColor, MMX1, MMX2, MMY1, MMY2)then
              begin
                Writeln('Location: Mine');
                Result := True;
              end;
            end;
    'Lost': begin
              if(not(FindSymbolsMulti(TPA, ['bank','mining spot']))) and (not(FindColor(x, y, FindVarrockRoadColor, MMX1, MMX1, MMY1, MMY2)))then
              //nextplaya[false]
              end else
               if TileOnMM(3286, 3365) or FindSymbol(x, y, 'mining spot')then
               case Random(3) of
               0: WalkToTile(Point(3286, 3365), 2, 0);
               1: WalkToTile(Point(3284, 3369), 0, 0);
               2: Mouse(x, y, 2, 2, true);
                  Flag;
               end;
               if TileOnMM(3254, 3421) or FindSymbol(x, y, 'bank') then
               case Random(3) of
               0: WalkToTile(Point(3254, 3421), 3, 0);
               1: WalkToTile(Point(3251, 3421), 2, 0);
               2: Mouse(x, y, 3, 3, true);
                  Flag;
               end;
            Writeln('BAK N Track');
            Result := False;
            Exit;
         end;
       end;
    end;

    Well this is not exactly any help but just a suggestion (: Whu to use FindSymbols when you use Reflection, you could just use something like TileOnMS Or TileOnMM Or something (:

    ~Home

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
  •