Results 1 to 25 of 25

Thread: how shoulld i find the bar

  1. #1
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default how shoulld i find the bar

    how should i pick the bar in my smithing script should i make a dtm of the words under them or use colors(tried and doesn't work for some reason)

    Code:
    {.include srl/srl.scar}
    
    var
      x, y, cactuscolor:integer;
    
    procedure DeclarePlayers;//add more if needed
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      Players[0].Name       := '';
      Players[0].Pass       := '';
      Players[0].Nick       := '';
      Players[0].Active     := True;    // Use this account?
      Players[0].strings[0]:= 'rune'; // what bar to smith
      players[0].pin:='';//bank pin
      Players[0].BoxRewards := ['XP', 'ostume', 'mote', 'Gem', 'ithril', 'oal'];
    end;
    
    procedure banker;
    begin
      openbankfast('akb');
      if bankscreen or pinscreen then
      begin
        writeln('opened bank');
      end else
      openbankglass('akb', true, true);
      if bankscreen or pinscreen then
      begin
        writeln('opened bank');
      end else
      Writeln('could not open bank.');
      if pinscreen then inpin(players[0].strings[1]);
    end;
    
    procedure getore;
    var
      mainamount, secamount : integer;
    begin
      case (Lowercase(Players[CurrentPlayer].Strings[0])) of
        'bronze':
        begin
          mainamount := 14;
          secamount:= 14;
        end;
        'iron':
        begin
          mainamount := 28; // Fill the acutal amounts in for the following though.
          secamount:= 0;
        end;
        'steel':
        begin
          mainamount := 9;
          secamount:= 18;
        end;
        'mithril':
        begin
          mainamount := 5;
          secamount:= 20;
        end;
        'addy':
        begin
          mainamount := 4;
          secamount:= 24;
        end;
        'runite':
        begin
          mainamount := 3;
          secamount:= 24;
        end;
        else Writeln('incorrect spelling srry');
      end;
      Withdraw(1, 1, mainamount);
      wait(100 + random(200));
      Withdraw(2, 1, secamount);
    end;
      
      
    {*******************************************************************************
    function Findcactuscolor: integer;
    By: XcanadamanX
    Description: Finds the cactus color for walking.
    *******************************************************************************}
      
      
      
      
    function FindCactusColor: Integer;
    var
      GC, a, l, TestColor: integer;
    var
      P:array of Tpoint;
    Begin
      if CactusColor = 0 then
      Begin
        GC := 3502663;
        Flag;
        FindColorsSpiralTolerance(MMCX,MMCY, P, GC, MMX1,MMY1,MMX2,MMY2, 75);
        l:=GetArrayLength(P);
        for a:= 0 to l-1 do
        begin
          TestColor := GetColor(P[a].x,P[a].y);
          if (GetColor(P[a].x,P[a].y + 1)=TestColor-1708041) then
          begin
            Result := TestColor;
            CactusColor:=Result;
            writeln('Cactus Color = ' + IntToStr(TestColor));
            Exit;
          end;
        end;
      writeln('Could not find Cactus Color!');
      Result := 0;
      end;
    end;
    
    procedure tofurnace;
    begin
      radialwalk(cactuscolor, 0, 140, 100, 1, 1);
      flag;
      if findcolortolerance(x, y, 127739, mmx1, mmy1, mmx2, mmy2,15) then
      begin
        mouse(x, y, 3, 3, true);
        writeln('found funace')
        flag;
      end;
    end;
    
    procedure findfurnace;
    begin
      makecompass('w');
      if findcolortolerance(x, y, 3355447, msx1, msy1, msx2, msy2, 15) then
      begin
        mouse(x,y,3,3,false);
        wait(100 + random (20));
        chooseoption('melt');
      end;
    end;
    
    procedure choosebar;
    var
      barcolor, amount : integer;
    begin
      case (Lowercase(Players[CurrentPlayer].Strings[0])) of
        'bronze':
        begin
          barcolor := 2440527;
          amount:= 14;
        end;
        'iron':
        begin
          barcolor := 5066067;
          amount:= 28;
        end;
        'steel':
        begin
          barcolor := 7368825;
          amount:= 14;
        end;
        'mithril':
        begin
          barcolor := 6176832;
          amount:= 14;
        end;
        'adamant':
        begin
          barcolor := 4346434;
          amount:= 14;
        end;
        'rune':
        begin
          barcolor := 6576708;
          amount:= 14;
        end;
        else Writeln('incorrect spelling srry');
      end;
    if findcolortolerance(x, y, barcolor, msx1, msy1, msx2, msy2, 50) then
        mmouse(x,y,3,3);
        if(isuptext(Lowercase(Players[CurrentPlayer].Strings[0]))) then
        begin
          mouse(x, y, 0, 0, false);
          wait(100 + random(20));
          chooseoption('X');
          wait(100 + random(30));
          typesend(inttostr(amount));
        end;
      end;
      
    
    begin
      setupsrl;
      activateclient;
      graphicsset:=true;
      declareplayers;
      loginplayer;
      //banker;
      //getore;
      //Findcactuscolor;
      //tofurnace;
      findfurnace;
      choosebar;
    end.

  2. #2
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    What are you trying to do?
    Find the bar in the inventory?
    If so use a DTM

    T~M

  3. #3
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Here, take a look at mine:

    SCAR Code:
    function Barz: Integer;
    var
      I : Integer;
      BMP: TDTMPointDef;
      BSP: Array [0..4] of TDTMPointDef;
      BARDTM: TDTM;
    begin
      BMP.x := 513;
      BMP.y := 276;
      BMP.AreaSize := 2;
      BMP.AreaShape := 0;
      BMP.Color := Bars.Col;
      BMP.Tolerance := 20;
      BSP[0].x := 501;
      BSP[0].y := 284;
      BSP[1].x := 506;
      BSP[1].y := 288;
      BSP[2].x := 515;
      BSP[2].y := 291;
      BSP[3].x := 528;
      BSP[3].y := 277;
      BSP[4].x := 521;
      BSP[4].y := 286;
      for I := 0 to 4 do
      begin
        BSP[I].AreaSize := 0;
        BSP[I].AreaShape := 0;
        BSP[I].Color := 65536;
        BSP[I].Tolerance := 5;
      end;
      BARDTM.MainPoint := BMP;
      BARDTM.SubPoints := BSP;
      Result := AddDTM(BARDTM);
    end;

    That is the dtm... I used a large procedure to load all the player variables. It had the bar colors in it.(bars.col)

  4. #4
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    imt ring to select the bar after i click the furnace

    Quote Originally Posted by mormonman View Post
    Here, take a look at mine:

    SCAR Code:
    function Barz: Integer;
    var
      I : Integer;
      BMP: TDTMPointDef;
      BSP: Array [0..4] of TDTMPointDef;
      BARDTM: TDTM;
    begin
      BMP.x := 513;
      BMP.y := 276;
      BMP.AreaSize := 2;
      BMP.AreaShape := 0;
      BMP.Color := Bars.Col;
      BMP.Tolerance := 20;
      BSP[0].x := 501;
      BSP[0].y := 284;
      BSP[1].x := 506;
      BSP[1].y := 288;
      BSP[2].x := 515;
      BSP[2].y := 291;
      BSP[3].x := 528;
      BSP[3].y := 277;
      BSP[4].x := 521;
      BSP[4].y := 286;
      for I := 0 to 4 do
      begin
        BSP[I].AreaSize := 0;
        BSP[I].AreaShape := 0;
        BSP[I].Color := 65536;
        BSP[I].Tolerance := 5;
      end;
      BARDTM.MainPoint := BMP;
      BARDTM.SubPoints := BSP;
      Result := AddDTM(BARDTM);
    end;

    That is the dtm... I used a large procedure to load all the player variables. It had the bar colors in it.(bars.col)
    will that select the bars out of the smelt menu thingy or inventory
    Last edited by ZephyrsFury; 05-28-2009 at 08:56 AM. Reason: Double post.

  5. #5
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Dont double post, especially in the space of 1 minute, Edit button
    Im guessing from the menu thing?
    otherwise an easy DTM would work

    T~M

  6. #6
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Quote Originally Posted by The Man View Post
    Dont double post, especially in the space of 1 minute, Edit button
    Im guessing from the menu thing?
    otherwise an easy DTM would work

    T~M
    plz don't backseat mod... kthnxbai

  7. #7
    Join Date
    Feb 2007
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    plz don't backseat mod... kthnxbai
    don't backbackseat mod

  8. #8
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  9. #9
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Quote Originally Posted by freebullets View Post
    don't backbackseat mod
    it was sideseat ^_^

    For the smelting popup, just use the text...
    FindTextTPA();

  10. #10
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    plz don't backseat mod... kthnxbai
    Umm dude, what the hell? That's not really backseat moderating at all...he's just telling him not to double post...nothing wrong with that. Most people do that with gravedigging and things like that.

  11. #11
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    plz don't backseat mod... kthnxbai
    LOL you really piss me off!
    You say I spam, atleast I say something constructive!
    You are so hypocritical GTFO!

    JP there are some really good DTM tutorials about, I will try and find you one


    T~M

  12. #12
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Another solution: Do a FindText in the Chat box (MCX1, MCY1, MCX2, MCY2) using NPCChars, search for the bar ('bronze', 'rion', etc), right click it and choose the option you want
    @Other guys: Off topic is not nice :<


  13. #13
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Here you go JP:
    http://www.villavu.com/forum/showthr...highlight=DTMs
    that should help.

    T~M

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

    Default

    I would do a simple check to make sure it's at the screen to select the bar, then case the bar to fill in the coords of a TBox, then mousebox in it? No complicated scripting is really necessary. Although today's scripters would probably use a super TPA with a DDTM fail safe changing the color2speedmodifiers, using Hue Saturation Luminence and RGB to the best of their advantage, but I'm old school

    SCAR Code:
    var
      T: TBox;

    if not(AtBarScreen)then
      Exit;
    case Bar of
      'bronze': TBox.x1 := 0; TBox.y1 := 0; TBox.x2 := 100; TBox.y2 := 100;
      ...etc. for more bars.
    end;
    MouseBox(TBox.x1,TBox.y1,TBox.x2,TBox.y2,2);
    ChooseOption('all');

    Or you can use a regular TPoint so you don't need to set 4 coordinates; just 2 for the x and y and use a good amount of randomness on the mouse.

  15. #15
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    if FindNPCChatText('ronze', ClickLeft) then
    result := true;

    etc.

    Edit: Holy crap, 4 posts within a minute .

  16. #16
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by Da 0wner View Post
    if FindNPCChatText('ronze', ClickLeft) then
    result := true;

    etc.

    Edit: Holy crap, 4 posts within a minute .
    after that do i jsut go on ith the normal stuff

  17. #17
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well, the FindNPCChatText will search for that and if found will result true and perform the action. In this case, ClickLeft.

  18. #18
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    just tried it still doens't find it

    it knows what it is it just doesn't find it

    Code:
    function choosebar: Boolean;
    var
      amount, baramount, m : integer;
      name :string;
    begin
      case (Lowercase(Players[CurrentPlayer].Strings[0])) of
        'bronze':
        begin
          amount := 14;
          name:= 'Bronze';
        end;
        'iron':
        begin
          amount := 28; // Fill the acutal amounts in for the following though.
          name:= 'Iron';
        end;
        'steel':
        begin
          amount := 9;
          name:= 'Steel';
        end;
        'mithril':
        begin
          amount := 5;
          name:= 'Mithril';
        end;
        'adamant':
        begin
          amount := 4;
          name:= 'Adamant';
        end;
        'rune':
        begin
          amount := 3;
          name:= 'Rune';
        end;
        else Writeln('incorrect spelling srry');
      end;
      writeln(name);
      if FindNPCChatText(name, ClickLeft) then
      begin
        result := true;
        wait(100 + random(20));
        chooseoption('X');
        wait(100 +(20));
        typesend(inttostr(amount));
        marktime(m);
        repeat
          wait(100 + random(30));
          findnormalrandoms;
          baramount:= invcount
        until (baramount = amount) or (m > 20000);
      end;
    end;
    Last edited by JPHamlett; 05-28-2009 at 10:37 AM.

  19. #19
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    if you're talking about the bar screen thing then a simple coord click with randomness will suffice. no real need to do any TPA or stuff like that. (I originally did a findcolor in my smelter but changed it eventually) and chooseoption after you click works too

    edit: if you need anything else to do with smelting just ask

  20. #20
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by XcanadamanX View Post
    if you're talking about the bar screen thing then a simple coord click with randomness will suffice. no real need to do any TPA or stuff like that. (I originally did a findcolor in my smelter but changed it eventually) and chooseoption after you click works too

    edit: if you need anything else to do with smelting just ask
    arnt coords diffrent on every computer

  21. #21
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    only for your desktop. but when the rs client is activated the coords are the same for everyone.

    when barscreen is open click 55,415 should be bronze,105,415 is blurite(or w/e) 155,415 should be iron etc

  22. #22
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    oh i get what your saying target the client then get coords

    correct?

  23. #23
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    http://www.villavu.com/forum/showthread.php?t=39326
    Just add
    SCAR Code:
    FreeDTM(BTF)
    after the result bit.

    It's really hard to try to be inactive. I've got loads of homework to do now I've started GCSEs, but I don't think I can leave SRL...
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  24. #24
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    ill give that a try r1ch

  25. #25
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Just add the whole function above the first place where it is used, and when you want to use it, do
    SCAR Code:
    if FindBar('bronze') then bla!
    Of course change "bronze" to the bar you are finding.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

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
  •