Results 1 to 8 of 8

Thread: Any one Want to Help Push me in right Direction?

  1. #1
    Join Date
    Sep 2010
    Location
    Azeroth
    Posts
    395
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default Any one Want to Help Push me in right Direction?

    Hello can some one revise this with a little of their expertise? show me some techniques for learning and also help me understand things a bit more better...

    i guess nobdys perfect here is what im on

    Simba Code:
    program wheat_picker;
    {$I SRL\SRL.SIMBA }


    function find_wheat: tpoint;

    var
    cts,x,y,z,w,h,i:integer;
    point_:tpoint;
    wheat_tpa:tpointarray;
    wheat_2dtpa:t2dpointarray;

    begin
    GetClientDimensions ( W , H ) ;
      CTS := GetColorToleranceSpeed ;
        ColorToleranceSpeed ( 2 ) ;
          SetColorspeed2Modifiers ( 0.21 , 0.80 ) ;
            FindColorsSpiralTolerance ( x , y , wheat_TPA , 5804686 , 0 , 0 , 515 , 336  , 7 ) ;
              SetColorspeed2Modifiers( 0.2 , 0.2 ) ;
                ColorToleranceSpeed ( CTS ) ;
                  if length(wheat_tpa)<1 then
                    exit else
                      begin
                        TPAtoATPAExWrap(wheat_TPA,3,6,wheat_2dtpa);
                          for i:=0 to high(wheat_2dtpa) do
                            begin
                              MiddleTPAEx(wheat_2dtpa[i],point_.x,point_.y);
                                end;
                                  result:= point_;
                                    end;
                                     end;



    function my_funk: boolean;
    var
    x,y,c,t,t2:integer;
    begin
      if not IsUpTextMultiCustom(['ick','hea']) then
        exit else
          begin
            ClickMouse2(1);
              C := InvCount;
                MarkTime(T);
                  repeat
                    //kjshflkajh
                      until(invcount>C) or (TimeFromMark(T)>8000+Random(450));
                        result:=true;
                        end;
                          end;

    procedure pick_wheat;
    var
    x,y,z:integer;
    begin
      MMouse(find_wheat.x,find_wheat.y,5,5);
        if IsUpTextMultiCustom(['ick','hea']) then
          my_funk
            else
              pick_wheat;
                end;






    begin
      SetupSRL;
        repeat
          pick_wheat;
            until false;
              end.

  2. #2
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    umm quick comment: in your function find_wheat x,y is never used. so change them to mscx, mscy. then it will always find the closest wheat for your character.

    also, its hard to read cus u dont follow standards

  3. #3
    Join Date
    Dec 2011
    Location
    Berlin
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by wantonman View Post
    Hello can some one revise this with a little of their expertise? show me some techniques for learning and also help me understand things a bit more better...

    i guess nobdys perfect here is what im on

    Simba Code:
    program wheat_picker;
    {$I SRL\SRL.SIMBA }


    function find_wheat: tpoint;

    var
    cts,x,y,z,w,h,i:integer;
    point_:tpoint;
    wheat_tpa:tpointarray;
    wheat_2dtpa:t2dpointarray;

    begin
    GetClientDimensions ( W , H ) ;
      CTS := GetColorToleranceSpeed ;
        ColorToleranceSpeed ( 2 ) ;
          SetColorspeed2Modifiers ( 0.21 , 0.80 ) ;
            FindColorsSpiralTolerance ( x , y , wheat_TPA , 5804686 , 0 , 0 , 515 , 336  , 7 ) ;
              SetColorspeed2Modifiers( 0.2 , 0.2 ) ;
                ColorToleranceSpeed ( CTS ) ;
                  if length(wheat_tpa)<1 then
                    exit else
                      begin
                        TPAtoATPAExWrap(wheat_TPA,3,6,wheat_2dtpa);
                          for i:=0 to high(wheat_2dtpa) do
                            begin
                              MiddleTPAEx(wheat_2dtpa[i],point_.x,point_.y);
                                end;
                                  result:= point_;
                                    end;
                                     end;



    function my_funk: boolean;
    var
    x,y,c,t,t2:integer;
    begin
      if not IsUpTextMultiCustom(['ick','hea']) then
        exit else
          begin
            ClickMouse2(1);
              C := InvCount;
                MarkTime(T);
                  repeat
                    //kjshflkajh
                      until(invcount>C) or (TimeFromMark(T)>8000+Random(450));
                        result:=true;
                        end;
                          end;

    procedure pick_wheat;
    var
    x,y,z:integer;
    begin
      MMouse(find_wheat.x,find_wheat.y,5,5);
        if IsUpTextMultiCustom(['ick','hea']) then
          my_funk
            else
              pick_wheat;
                end;






    begin
      SetupSRL;
        repeat
          pick_wheat;
            until false;
              end.

    You should not write it like an arrow. Look into other scripts and see how to change it. Looks really strange

    I will try to answer all Runescape related questions!

  4. #4
    Join Date
    Sep 2010
    Location
    Azeroth
    Posts
    395
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default

    okay will do... yeah standards are cool to do properly...

    and i think i do use wheat funk... but uh yeah mscx mscy is good ill adjust it... was not using smart thats why...

  5. #5
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    Quote Originally Posted by wantonman View Post
    and i think i do use wheat funk... but uh yeah mscx mscy is good ill adjust it... was not using smart thats why...
    any coordinate constants (msx1,mmy1, etc) are not reliant upon smart. now i said to get rid of the x,y in that function because u never initialize them. they will always be the coordinates 0,0. so it will always start the search at the top left corner, and not the center. this will mean that your ATPA[0] will be in the top left.

  6. #6
    Join Date
    Feb 2012
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You also use FindColorsSpiralTolerance, but only use one color.

  7. #7
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    Quote Originally Posted by Imagine View Post
    You also use FindColorsSpiralTolerance, but only use one color.
    findColorsSpiralTolerance returns a array of tpoint (he called it wheat_TPA). its not find color 000, and 111, and 222. its find all the positions of a color.
    findColorSpiralTolerance will only return 1 tpoint.

  8. #8
    Join Date
    Feb 2012
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ^Really? Let me check my scripts, I might be using one or the other subconsciously :O




    Yeah, you're right :P I don't think about what I write most of the time...

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
  •