Results 1 to 11 of 11

Thread: Need help making more accurate procedure

  1. #1
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Need help making more accurate procedure

    [STILL NEED BETTER PROCEDURE]

    Ok well the objective of this function is to find the general store owner/assistant as fast as possible, Anyway i could make this faster/more accurate(the problem is that there are many colors similar to them in the G store so i tried Using almost all hair colors)
    so here it is

    SCAR Code:
    function FindShopKeeper : boolean;
    var SKX, SKY, I, T : integer;
    begin
       SetRun(true);

       result := false;

      ShopKeeper[1] := 2900546;//hair
      ShopKeeper[2] := 7840208;//hair
      ShopKeeper[3] := 8224135;//hair
      ShopKeeper[4] := 7115454;//face
      ShopKeeper[5] := 7763582;//hair
      ShopKeeper[6] := 2570298;// apron
     
      ShopAssistant[1] := 2307381;//hair
        ShopAssistant[2] := 2175024;//hair
        ShopAssistant[3] := 2900546;//shirt
        ShopAssistant[4] := 6250599;//hair
        ShopAssistant[5] := 8026754;//back
        ShopAssistant[6] := 5000275;//arm

      repeat
      For I := 1 to 6 do
      If(FindObj3(SKX,SKY,'Shop keeper',ShopKeeper[1],10))or
        (FindObj3(SKX,SKY,'Shop keeper',ShopKeeper[I],10))or
        (FindObj(SKX,SKY,'Shop keeper',ShopKeeper[I],10))or
        (FindObj3(SKX,SKY,'Shop assistant',ShopAssistant[1],10))or
        (FindObj3(SKX,SKY,'Shop assistant',ShopAssistant[I],10))or
        (FindObj(SKX,SKY,'Shop assistant',ShopAssistant[I],10))then
          begin
            T := T + 1;
            MouseSpeed := 8 + random(3);
            MMouse(SKX,SKY,0,0);
            wait(600);
            Mouse(SKX,SKY,0,0,False);
            Flag;
            Wait(600+random(600));
            ChooseOption(x,y,'Trade');
            If(InGStore)then
              begin
                Result := True;
                break;
              end;
          end;
      Until(T=6)
      If(T=6)then
      begin
        result := false;
      end;
    end;

    Join the fastest growing merchanting clan on the the net!

  2. #2
    Join Date
    Jul 2006
    Location
    NY
    Posts
    371
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This looks shorter and will do the same thing, give this a shot.
    SCAR Code:
    function FindshopKeeper: boolean;
    var
      skx, sky, a, i: integer;
      shopkeeper, shopassistant: array [0..5] of integer;
    begin
    //---------------------------------
      ShopKeeper[0] := 2900546; //hair
      ShopKeeper[1] := 7840208; //hair
      ShopKeeper[2] := 8224135; //hair
      ShopKeeper[3] := 7115454; //face
      ShopKeeper[4] := 7763582; //hair
      ShopKeeper[5] := 2570298; // apron

      ShopAssistant[0] := 2307381; //hair
      ShopAssistant[1] := 2175024; //hair
      ShopAssistant[2] := 2900546; //shirt
      ShopAssistant[3] := 6250599; //hair
      ShopAssistant[4] := 8026754; //back
      ShopAssistant[5] := 5000275; //arm
    //----------------------------------
      a := 0;
      begin
        MouseSpeed := 7 - Random(4);
        SetRun(True);
        for i := 1 to 6 do
        begin
          if (FindObj3(skx, sky, 'hop k', ShopKeeper[a], 10)) or
             (FindObj3(skx, sky, 'hop ass', ShopAssistant[a], 10)) then
             Mouse(skx, sky, 1, 1, False);
          if not (ChooseOption(x, y, 'Trade')) then
          begin
            MouseSpeed := 5 + Random(3);
            ChooseOption(x, y, 'Cancel');
            a := a + 1;
          end else
          begin
            ChooseOption(x, y, 'Trade');
            Flag;
            Result := True;
            Exit;
          end;
        end;
        begin
          WriteLn('Can not find shop keeper or assistant!');
          Result := False;
        end;
      end;
    end;

  3. #3
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    why did you keep the
    SCAR Code:
    for i := 1 to 6 do

    and the other colors if you used a := 0?
    other thatn that i can see where that goes,looks faster

    Join the fastest growing merchanting clan on the the net!

  4. #4
    Join Date
    Jul 2006
    Location
    NY
    Posts
    371
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Its going to repeat that loop 6 times. Everytime it doesnt find the shop keeper or assistant within the six times it will try a different color by adding 1 to a, but if it does find it in the loop it will just exit the function as the result being true. And if it doesnt find it withing the 6 times, it has tried all the colors and will exit the function as false.

  5. #5
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok yeah it didnt work at all it moved the mouse faster and it traded him 1 time and it said "i can't reach that" then it traded a guy in full steel

    Join the fastest growing merchanting clan on the the net!

  6. #6
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    plz any1??

    Join the fastest growing merchanting clan on the the net!

  7. #7
    Join Date
    Oct 2006
    Location
    Texas
    Posts
    1,450
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    Set new colors then. Junior knows what he is talking about. Its your colors that are bad.

  8. #8
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok well like i said its hard to find individual colors that are not in the setting

    Join the fastest growing merchanting clan on the the net!

  9. #9
    Join Date
    Jul 2006
    Location
    NY
    Posts
    371
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Alright, if I have time later on ill find a way to make it 1337. Im doing homework at the moment.

  10. #10
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok thnx alot bro im currently making a new function that can get the job done also

    Join the fastest growing merchanting clan on the the net!

  11. #11
    Join Date
    Jul 2006
    Location
    NY
    Posts
    371
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This worked well for me, Try it out.
    SCAR Code:
    function FindshopKeeper: boolean;
    var
      skx, sky, a, i: integer;
      shopkeeper: array [0..5] of integer;
    begin
    //---------------------------------
      ShopKeeper[0] := 2709367;
      ShopKeeper[1] := 2703167;
      ShopKeeper[2] := 2707059;
      ShopKeeper[3] := 5728641;
    //----------------------------------
      a := 0;
      begin
        MouseSpeed := 7 - Random(4);
        SetRun(True);
        for i := 1 to 4 do
        begin
          if (FindObj(skx, sky, 'hop k', ShopKeeper[a], 2)) or
             (FindObj(skx, sky, 'hop ass', ShopKeeper[a], 2)) then
             Mouse(skx, sky, 1, 1, False);
          if not (ChooseOption(x, y, 'Trade')) then
          begin
            MouseSpeed := 5 + Random(3);
            ChooseOption(x, y, 'Cancel');
            a := a + 1;
          end else
          begin
            ChooseOption(x, y, 'Trade');
            if (InChatMulti('I ca', 'rea', 'ch tha')) then
              FindShopKeeper
            else
            Flag;
            if (ShopScreen) then
            begin
              Result := True;
              Exit;
            end else
             FindShopKeeper;
          end;
        end;
        begin
          WriteLn('Can not find shop keeper or assistant!');
          Result := False;
        end;
      end;
    end;

    EDIT: You will need this include or you will get a unknown identifier.
    SCAR Code:
    {.include srl\srl\misc\amount.scar}
    I think thats it...

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. Whats more accurate? RGB or Colors picked by SCAR?
    By itSchRis917 in forum OSR Help
    Replies: 4
    Last Post: 07-21-2007, 06:13 PM
  3. Replies: 8
    Last Post: 05-24-2007, 11:57 PM
  4. Making a case to set a procedure..?
    By NewToAutoing in forum OSR Help
    Replies: 11
    Last Post: 05-21-2007, 09:41 PM
  5. 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
  •