Results 1 to 12 of 12

Thread: Finding NPCs

  1. #1
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default Finding NPCs

    SCAR Code:
    {----------------------------------------------------------------------------}
    {----------------------------Arrow Buyer V1!---------------------------------}
    {----------------------------By:3Garrett3!-----------------------------------}
    {----------------------------------------------------------------------------}
    {Instructions!!!- Setup Lines 15 and 16. Have Lowe's shop open (only tested this
    one) and have it on low detail}

    {Credits: JAD, Markus, Yohojo8 (DTM), Jason2gs, and RScheater13 for letting me
    use his Feather buyer to start this}

    program Arrowbuyer;
    {.include SRL/SRL.scar}

    var BrArrow : Integer;
    Bought : Integer;
    IrArrow : Integer;

    const
    ArrowType=('Bronze'); //Type of arrow you want to buy (Bronze or Iron)
    Buying= 10; //How many you want to buy
    {--------------Writes a Progress Report------------------------------------}
    procedure Report;
    begin
      Writeln('[]========================================[]');
      Writeln('---------------->Progress Report<-----------');
      Writeln('------Worked For : ' + ScriptTime2(2) + '---')
      Writeln('  Bought ' + IntToStr(Bought) + 'Arrows ' + '');
      Writeln('[]========================================[]');
    end;

    procedure LoadDTMS;
     begin
     Writeln ('Loading DTMs')
     BrArrow:= DTMFromString('78DA631467606090634001D922BC0CFF81342' +
           '310FF07024605204392010D302291405A1048881250C309241409' +
           'A801C9F3105003728B327E350096CF06C0');
     IrArrow:= DTMFromString('78DA630C616060B06640013161610C3A8C0C0' +
           'C40C4F01F0818BD818C000634C0C820C9005103E6B9020927026A' +
           'A281843901357E40C28C801A4720E143404D1090F0C2AF0600EE3' +
           'D09CC');
     Writeln ('Done loading DTMs')
    end;

    Procedure BuyBrnz;
    begin

     if(Not(ArrowType = 'Bronze'))then
      Begin
       Exit;
      End
     else

     if (ArrowType = 'Bronze')then
      begin
       Writeln ('Bronze Arrows Being Bought')
       FindDTM(BrArrow,x,y,1, 1, 200, 200)
       Mouse(x, y, 2, 2, False);
       ChooseOption(x, y, '10');
       Wait(1000+random(300));
       Bought:= Bought + 10
      end;
     end;
    Procedure BuyIrn;
    begin

     if(Not(ArrowType = 'Iron'))then
      Begin
       Exit;
      End
     else

     if (ArrowType = 'Iron')then
      begin
       Writeln ('Iron arrows being bought')
       FindDTM(IrArrow,x,y,1, 1, 200, 200)
       Mouse(x, y, 2, 2, False);
       ChooseOption(x, y, '10');
       Wait(1000+random(300));
       Bought:= Bought + 10
       If not(FindDTM(IrArrow,x,y,1, 1, 200, 200)) Then
       Writeln ('Cannont Find DTM')
      end;
    end;

    Procedure FindLowe;
    begin
     Writeln('Finding Lowe')
     If Findcolor(x, y, 4561089, 1, 1, 648, -112) Then
      Writeln('Found Lowe, Opening Trade Screen');
      Mouse(x, y, 2, 2, False);
      ChooseOption(x, y, 'rade L');
      If not Findcolor(x, y, 4561089, 1, 1, 648, -112) Then
      Writeln('Could not Find Lowe, sorry');
    end;
    {------------Main Loop-----------------------------------------------------}
    begin
    SetupSRL;
    LoadDTMS;
    FindLowe;
     repeat
      begin
      BuyBrnz;
      BuyIrn;
      Report;
      end;
     until(Bought = Buying);
     Writeln ('Finished Buying Arrows, Thank you for using 3Garrett3s Arrow Buyer')
    end
    Can anyone give me a better way to find Lowe than just one color? I am trying to make it so that if it doesnt find him the first way, it will try another way right now, but I dont know how to do this either. I dont know if DTMs will work because he may be covered, but colors wouldnt work then either, anyone have a better way? Thanks in advance.

  2. #2
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    You can use FindObjmulti, it uses the uptext and three colors you can put in.
    Link tot the manual: srl/srl/core/object.scar
    Object.scar has many other usefull functions (16 functions according to the manual) so you can choose the one you like the most.
    I made a new script, check it out!.

  3. #3
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    Ty, but now i have found another problem...
    SCAR Code:
    {----------------------------------------------------------------------------}
    {----------------------------Arrow Buyer V1!---------------------------------}
    {----------------------------By:3Garrett3!-----------------------------------}
    {----------------------------------------------------------------------------}
    {Instructions!!!- Setup Lines 15 and 16. Have Lowe's shop open (only tested this
    one) and have it on low detail}

    {Credits: JAD, Markus, Yohojo8 (DTM), Jason2gs, and RScheater13 for letting me
    use his Feather buyer to start this}

    program Arrowbuyer;
    {.include SRL/SRL.scar}

    var BrArrow : Integer;
    Bought : Integer;
    IrArrow : Integer;
    cx, cy : Integer;
    tolerance: Integer;
    const
    ArrowType=('Bronze'); //Type of arrow you want to buy (Bronze or Iron)
    Buying= 10; //How many you want to buy
    Lowe1= 4627910;
    Lowe2= 3953243;
    Lowe3= 4809580;
    Text= 'owe';
    {--------------Writes a Progress Report------------------------------------}
    procedure Report;
    begin
      Writeln('[]========================================[]');
      Writeln('---------------->Progress Report<-----------');
      Writeln('------Worked For : ' + ScriptTime2(2) + '---')
      Writeln('  Bought ' + IntToStr(Bought) + 'Arrows ' + '');
      Writeln('[]========================================[]');
    end;

    procedure LoadDTMS;
     begin
     Writeln ('Loading DTMs')
     BrArrow:= DTMFromString('78DA631467606090634001D922BC0CFF81342' +
           '310FF07024605204392010D302291405A1048881250C309241409' +
           'A801C9F3105003728B327E350096CF06C0');
     IrArrow:= DTMFromString('78DA630C616060B06640013161610C3A8C0C0' +
           'C40C4F01F0818BD818C000634C0C820C9005103E6B9020927026A' +
           'A281843901357E40C28C801A4720E143404D1090F0C2AF0600EE3' +
           'D09CC');
     Writeln ('Done loading DTMs')
    end;

    Procedure BuyBrnz;
    begin

     if(Not(ArrowType = 'Bronze'))then
      Begin
       Exit;
      End
     else

     if (ArrowType = 'Bronze')then
      begin
       Writeln ('Bronze Arrows Being Bought')
       FindDTM(BrArrow,x,y,1, 1, 200, 200)
       Mouse(x, y, 2, 2, False);
       ChooseOption(x, y, '10');
       Wait(1000+random(300));
       Bought:= Bought + 10
      end;
     end;
    Procedure BuyIrn;
    begin

     if(Not(ArrowType = 'Iron'))then
      Begin
       Exit;
      End
     else

     if (ArrowType = 'Iron')then
      begin
       Writeln ('Iron arrows being bought')
       FindDTM(IrArrow,x,y,1, 1, 200, 200)
       Mouse(x, y, 2, 2, False);
       ChooseOption(x, y, '10');
       Wait(1000+random(300));
       Bought:= Bought + 10
       If not(FindDTM(IrArrow,x,y,1, 1, 200, 200)) Then
       Writeln ('Cannont Find DTM')
      end;
    end;

    Procedure FindLowe;
    begin
     If FindObjMulti(Text, Lowe1, Lowe2, Lowe3, 0) then
     Mouse(x, y, 1, 1, 2, 2, False);
     ChooseOption(x, y, 'rade');
     Writeln('Found Lowe and opened Screen')
     If not FindObjMulti(Text, Lowe1, Lowe2, Lowe3, 0): Boolean then
     Writeln('Did not find Lowe, sorry')
     TerminateScript
    end;

    {------------Main Loop-----------------------------------------------------}
    begin
    SetupSRL;
    LoadDTMS;
    FindLowe;
     repeat
      begin
      BuyBrnz;
      BuyIrn;
      Report;
      end;
     until(Bought = Buying);
     Writeln ('Finished Buying Arrows, Thank you for using 3Garrett3s Arrow Buyer')
    end.

    I get this
    Code:
    Line 91: [Error] (17752:31): Invalid number of parameters in script C:\Program Files\SCAR 2.03\Scripts\DTMS\ArrowBuyerV1.1.scar
    That has something to do with my findlowe thing,,, any help?

  4. #4
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Mouse(x, y, 2, 2, False); would be how its done. x,y are coords, 2,2 are random pixels and false is right click, nothing else there.

  5. #5
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    again, JAD saves me from being the uber noob with his uber smartness all hail JAD!

  6. #6
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hehe, thanks garret I looked at your arrow buyer though, can't seem to find out whats wrong with it

  7. #7
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    it doesnt seem to want to click lowe? it tells me that it finds him but doesnt click him?

  8. #8
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default

    This is my Al-Kharid TanAll function. It searches for Ellis by looping through 4 unique NPC-colors. If it finds a match, it hovers the mouse over the color. If it find a yellow color indicating UpText, it checks if there is a 'l' from e'l'lis. It right clicks and performs ChooseOption Trade. If it fails, it breaks the loop, if it succeeds it waits for the tan screen to appear (it can take upto 15 seconds, both wondering around that darn table)

    There is one surrounding loop that performs a rough click if the four Colors of Ellis arent found within 20 seconds.

    Get it? Hope this helps a bit.

    SCAR Code:
    Procedure EllisColors;
    begin
    Ellis[1]:= 4681158;
      Ellis[2]:= 5472230;
      Ellis[3]:= 3692188;
      Ellis[4]:= 3758498;
    end;
    //----------------------------------------------------------------------------//

    Function TanAll:Boolean;
    var Dmx, Dmy, Ax, Ay, x, STime, ETime,TTime: integer;
    begin
      If FawkiDebug then Status('Finding Ellis');
      MarkTime(STime);
      repeat
        for x:=1 to 4 do
        begin
          if not LoggedIn then Exit;
          MarkTime(ETime);
          if FindColorTolerance(Ax, Ay, Ellis[x], MSX1, MSY1 + 20, MSX2, MSY2, 5) then
          begin
            MMouse(Ax, Ay, 0, 0);
            GetMousePos(Ax, Ay);
            if FindColorTolerance(Dmx, Dmy, 318168, 42, 8, 120, 21, 50) then  // Yellow
            begin
              if FawkiDebug then Status('Found Yellow UpText');
              if IsUpText('l') then
              begin
                if FawkiDebug then Status('Found Ellis');
                Mouse(Ax, Ay, 0, 0, False);
                if not Chooseoption(x,y,'Trade') then break;
                MarkTime(TTime);
                Repeat
                  FlagFTWait;
                  WWait(1000);
                  if TimeFromMark(TTime) > 15000 then
                  begin
                    Break;
                  End;
                Until TanScreen;
                Mouse(75, 90, 20, 30, False);
                Wait((1000)+Random(250));
                ChooseOption(x,y,'All');
                TanHides := TanHides + 27;
                ReportVars[0]:=27;
                Result := True;
                Exit;
              end
            end
          end;
        end;
        Wait(100);
        if ETime-STime > 20000 then
        begin
          Mouse(MSCX,MSCY + 50, 2, 2, True);  // crude callib trying to find Ellis
        end;
        x := 1;
      until(ETime-STime > 55000);
    end;
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

  9. #9
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    It doesnt seem to work for me,, the color part, I havnt even made it past that, i get some semi colon error in these lines,,,
    SCAR Code:
    Procedure LoweColor;
    begin
    Lowe[1]:= 4627910;
      Lowe[2]:= 3953243;
      Lowe[3]:= 4809580;
      Lowe[4]:= 5156829;
    end;
    PS i am aloud to use the same sort of procedure just to state the colors right? I had them in my const but i was getting some colon error, and now i have a semi colon error... here is an update of my script so far

    SCAR Code:
    {----------------------------------------------------------------------------}
    {----------------------------Arrow Buyer V1.1!---------------------------------}
    {----------------------------By:3Garrett3!-----------------------------------}
    {----------------------------------------------------------------------------}
    {Instructions!!!- Setup Lines 15-16. Be in Lowes store and have it on low detail}
    {Credits: JAD, Markus, Yohojo8, Jason2gs, WT-Fakawi, and RScheater13 for
    letting me use his Feather buyer to start this}

    program Arrowbuyer;
    {.include SRL/SRL.scar}

    var BrArrow : Integer;
    Bought : Integer;
    IrArrow : Integer;
    Lowe : Integer;
    const
    ArrowType=('Iron'); //Type of arrow you want to buy (Bronze or Iron)
    Buying= 20; //How many you want to buy
    {--------------Writes a Progress Report------------------------------------}
    procedure Report;
    begin
      Writeln('[]========================================[]');
      Writeln('---------------->Progress Report<-----------');
      Writeln('------Worked For : ' + ScriptTime2(2) + '---')
      Writeln('  Bought ' + IntToStr(Bought) + ' Arrows ' + '');
      Writeln('[]========================================[]');
    end;

    procedure LoadDTMS;
     begin
     Writeln ('Loading DTMs')
     BrArrow:= DTMFromString('78DA631467606090634001D922BC0CFF81342' +
           '310FF07024605204392010D302291405A1048881250C309241409' +
           'A801C9F3105003728B327E350096CF06C0');
     IrArrow:= DTMFromString('78DA630C616060B06640013161610C3A8C0C0' +
           'C40C4F01F0818BD818C000634C0C820C9005103E6B9020927026A' +
           'A281843901357E40C28C801A4720E143404D1090F0C2AF0600EE3' +
           'D09CC');
     Writeln ('Done loading DTMs')
    end;

    Procedure BuyBrnz;
    begin

     if(Not(ArrowType = 'Bronze'))then
      Begin
       Exit;
      End
     else

     if (ArrowType = 'Bronze')then
      begin
       Writeln ('Bronze Arrows Being Bought')
       FindDTM(BrArrow,x,y,1, 1, 200, 200)
       Mouse(x, y, 2, 2, False);
       ChooseOption(x, y, '10');
       Wait(1000+random(300));
       Bought:= Bought + 10
      end;
     end;
    Procedure BuyIrn;
    begin

     if(Not(ArrowType = 'Iron'))then
      Begin
       Exit;
      End
     else

     if (ArrowType = 'Iron')then
      begin
       Writeln ('Iron arrows being bought')
       FindDTM(IrArrow,x,y,1, 1, 200, 200)
       Mouse(x, y, 2, 2, False);
       ChooseOption(x, y, '10');
       Wait(1000+random(300));
       Bought:= Bought + 10
       If not(FindDTM(IrArrow,x,y,1, 1, 200, 200)) Then
       Writeln ('Cannont Find DTM')
      end;
    end;

    Procedure LoweColor;
    begin
    Lowe[1]:= 4627910;
      Lowe[2]:= 3953243;
      Lowe[3]:= 4809580;
      Lowe[4]:= 5156829;
    end;

    Procedure FindLowe;
    var
    a, b, Ax, Ay, MSX1, MSY1, MSX2, MSY2 : Integer
    begin
     If FindColorTolerance(Ax, Ay, Lowe[x], MSX1, MSY1 + 20, MSX2, MSY2, 5) then
     begin
     if IsUpText('l') then
     repeat
     Mouse(Ax, Ay, 0, 0, False);
     ChooseOption(x, y, 'rade');
     until findcolor(a, b, 2070783, 1, 1, 200, 200)
     Writeln('Found Lowe and opened Screen')
    end;

    {------------Main Loop-----------------------------------------------------}
    begin
    SetupSRL;
    LoadDTMS;
    FindLowe;
     repeat
      begin
      BuyBrnz;
      BuyIrn;
      Report;
      end;
     until(Bought = Buying);
     Writeln ('Finished Buying Arrows, Thank you for using 3Garrett3s Arrow Buyer')
    end.
    anyone know why it doesnt wanna work?

  10. #10
    Join Date
    Sep 2006
    Location
    In Finland
    Posts
    124
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, i looked at it and it had several little problems...i had nothing else to do so i tried to fix it and guess what...i got it compile...i dont have time now (anymore) to test it but here it is:

    SCAR Code:
    {----------------------------------------------------------------------------}
    {----------------------------Arrow Buyer V1.1!---------------------------------}
    {----------------------------By:3Garrett3!-----------------------------------}
    {----------------------------------------------------------------------------}
    {Instructions!!!- Setup Lines 15-16. Be in Lowes store and have it on low detail}
    {Credits: JAD, Markus, Yohojo8, Jason2gs, WT-Fakawi, and RScheater13 for
    letting me use his Feather buyer to start this}

    program Arrowbuyer;
    {.include SRL/SRL.scar}

    var BrArrow : Integer;
    Bought : Integer;
    IrArrow : Integer;
    Lowe : Integer;
    const
    ArrowType = 'Iron'; //Type of arrow you want to buy (Bronze or Iron)
    Buying = 20; //How many you want to buy
    {--------------Writes a Progress Report------------------------------------}
    procedure Report;
    begin
      Writeln('[]========================================[]');
      Writeln('---------------->Progress Report<-----------');
      Writeln('------Worked For : ' + ScriptTime2(2) + '---')
      Writeln('  Bought ' + IntToStr(Bought) + ' Arrows ' + '');
      Writeln('[]========================================[]');
    end;

    procedure LoadDTMS;
     begin
     Writeln ('Loading DTMs')
     BrArrow:= DTMFromString('78DA631467606090634001D922BC0CFF81342' +
           '310FF07024605204392010D302291405A1048881250C309241409' +
           'A801C9F3105003728B327E350096CF06C0');
     IrArrow:= DTMFromString('78DA630C616060B06640013161610C3A8C0C0' +
           'C40C4F01F0818BD818C000634C0C820C9005103E6B9020927026A' +
           'A281843901357E40C28C801A4720E143404D1090F0C2AF0600EE3' +
           'D09CC');
     Writeln ('Done loading DTMs')
    end;

    Procedure BuyBrnz;
    begin

     if(Not(ArrowType = 'Bronze'))then
      Begin
       Exit;
      End
     else

     if (ArrowType = 'Bronze')then
      begin
       Writeln ('Bronze Arrows Being Bought')
       FindDTM(BrArrow,x,y,1, 1, 200, 200)
       Mouse(x, y, 2, 2, False);
       ChooseOption(x, y, '10');
       Wait(1000+random(300));
       Bought:= Bought + 10
      end;
     end;
    Procedure BuyIrn;
    begin

     if(Not(ArrowType = 'Iron'))then
      Begin
       Exit;
      End
     else

     if (ArrowType = 'Iron')then
      begin
       Writeln ('Iron arrows being bought')
       FindDTM(IrArrow,x,y,1, 1, 200, 200)
       Mouse(x, y, 2, 2, False);
       ChooseOption(x, y, '10');
       Wait(1000+random(300));
       Bought:= Bought + 10
       If not(FindDTM(IrArrow,x,y,1, 1, 200, 200)) Then
       Writeln ('Cannont Find DTM')
      end;
    end;

    Procedure LoweColor;
    begin
    Lowe := (4627910)or(3953243)or(4809580)or(5156829)
    end;

    Procedure FindLowe;
    begin
     If FindColorTolerance(x, y, Lowe, MSX1, MSY1, MSX2, MSY2, 5) then
     begin
     if IsUpText('l') then
      repeat
     Mouse(x, y, 0, 0, True);
     ChooseOption(x, y, 'rade');
      until(FindColor(x, y, 2070783, 1, 1, 200, 200))
     Writeln('Found Lowe and opened Screen')
     end;
    end;

    {------------Main Loop-----------------------------------------------------}
    begin
    SetupSRL;
    LoadDTMS;
    FindLowe;
     repeat
      begin
      BuyBrnz;
      BuyIrn;
      Report;
      end;
     until(Bought = Buying);
     Writeln ('Finished Buying Arrows, Thank you for using 3Garrett3s Arrow Buyer')
    end.

  11. #11
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    Thx for the help but it still doesnt work,,, it thinks it finds him, but never does, and now i dont think the arrow buying thing is working at all?
    Thanks everyone, but i might not have enough mad skills for this to work.. Might have to quit it because even Fakawi couldnt give me the knowledge i needed ( not saying that he doesnt have it, just i didnt understand i guess). Maybe a simpler script is needed for me,

  12. #12
    Join Date
    Sep 2006
    Location
    In Finland
    Posts
    124
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, i might make one of these too...i would need one... was pretty good script but it actually compiles now

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Talking to Npcs
    By 0lumpy in forum OSR Help
    Replies: 4
    Last Post: 01-17-2009, 04:56 AM
  2. Finding NPCs
    By Capricorn in forum OSR Help
    Replies: 7
    Last Post: 12-01-2008, 06:33 AM
  3. Replies: 3
    Last Post: 09-23-2008, 03:37 AM
  4. Finding a net
    By 3Garrett3 in forum OSR Help
    Replies: 2
    Last Post: 03-25-2007, 03:16 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
  •