Results 1 to 25 of 25

Thread: a try at farming.scar :P

  1. #1
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default a try at farming.scar :P

    i noticed that there arent ANY farming scripts, nor farming includes, plus i was bored and needed a refresher from taking a break

    hopefully i could get some people to make farming scripts lol

    Added:
    SCAR Code:
    Function LoadToolDTM(tool: string): integer;
    Function GetToolDTM(tool: string): integer;
    Function FindTool(tool: string; cx1, cy1, cx2, cy2: integer;  click: boolean ): boolean;
    procedure StoreTool(tool: string);
    procedure StoreCompost(Compost: string; Number: integer; All: Boolean);


    so, without further ado

    SCAR Code:
    {*******************************************************************************
    Function LoadToolDTM(tool: string): integer;
    By: akwardsaw
    Description: It loads the tool dtms. Only use is for GetToolDTM
    *******************************************************************************}

    Function LoadToolDTM(tool: string): integer;
    var
      Spadedtm, Diberdtm, Rakedtm, Curedtm, Compostdtm: integer;
      Sackdtm, Secaturesdtm, Basketdtm, Troweldtm: integer;
    begin
      case tool of
        'Spade': Spadedtm := DTMFromString('78DA63B465626078C28006189148206D0954F' +
                          '398801A63A09AB704D45800D57C20A0C61EA8E61901355E403557' +
                          'F1AB0100476C06E8');
        'Dibber': Diberdtm := DTMFromString('78DA634C62626078C68006189148209D03547' +
                           '387809A54A09A1704D4C403D5BC23A0A610A8E6117E3500AADB06' +
                           '97');
        'Rake': Rakedtm := DTMFromString('78DA63EC67626078C5800618914820DD4D849' +
                        'A0EA09A9704D44CA28E1A000742076F');
        'Cure': Curedtm := DTMFromString('78DA63DCCFC4C07099010D30229140FA3050C' +
                        'D43026A8E01D5BC25A0662F50CD07026AB600D5BC24A0662750CD' +
                        '2DFC6A00C07E09E5');
        'Compost': Compostdtm := DTMFromString('78DA634C656260F8C58006189148209D49849' +
                              'A62A01A4E46FC6AB2806A8409A84902AAE125A02697B07B00EBAF' +
                              '05B3');
        'Sack': Sackdtm := DTMFromString('78DA633466626060676440058C482490B606A' +
                        'A1126A0C60FA88685801A6FA09A7F0CF8D57800D57CC7AF060000' +
                        'D5037F');
        'Secatures': Secaturesdtm := DTMFromString('78DA634C64626058CDC8800A189148201D035' +
                     '4B39608359B08A8C902AA394C404D1150CD01026ACA806AF6E257' +
                     '03002E0406DA');
        'Basket': Basketdtm := DTMFromString('78DA639CC2C4C0F08B010D302291407A3A50C' +
                            'D3F026A2602D53033E257338109898743CD0C22CC990A5423C248' +
                            'D8CD3FF0BB190041A40742');
        'Trowel': Troweldtm := DTMFromString('78DA6394656460086640038C4824905626428' +
                            'D2690E54D408D3E90E54E408D2A90154E408D1A90154A408D3490' +
                            '158B5F0D00D0A4035C');
      end;
    result:= 0;
    end;

    {*******************************************************************************
    Function GetToolDTM(tool: string): integer;
    By: akwardsaw
    Description: It's result is the Tool's dtm
    *******************************************************************************}

    Function GetToolDTM(tool: string): integer;
    begin
      case tool of
        'Spade': result:= LoadToolDTM('Spade');
        'Dibber':  result:= LoadToolDTM('Dibber');
        'Rake':  result:= LoadToolDTM('Rake');
        'Cure':  result:= LoadToolDTM('Cure');
        'Compost':  result:= LoadToolDTM('Compost');
        'Sack':  result:= LoadToolDTM('Sack');
        'Secatures':  result:= LoadToolDTM('Secatures');
        'Basket':  result:= LoadToolDTM('Basket');
        'Trowel':  result:= LoadToolDTM('Trowel');
      end;
    end;

    {*******************************************************************************
    Function FindTool(tool: string; cx1, cy1, cx2, cy2: integer;  click: boolean ): boolean;
    By: akwardsaw
    Description: It returns true or false if the tool is found. If so it either clicks
                 left, or right, depending in what you put in for Click. True is Left
                 and im sure as hell theres a way to shorten this procedure :P
    *******************************************************************************}

    Function FindTool(tool: string; cx1, cy1, cx2, cy2: integer;  click: boolean ): boolean;
    var
      x, y, D: integer;
      TSA: TStringArray;
    begin
      TSA := ['Dibber','Rake','Cure','Compost' +
          'Sack','Secatures','Basket','Trowel']
      d := GetToolDTM(Tool);
      if FindDTM(d, x, y, cx1, cy1, cx2, cy2) then
      begin
        mmouse(x, y, 4, 4);
        wait(100+random(100));
        if IsuptextMultiCustom([TSA]) then
        begin
          getmousepos(x, y);
          result := True;
          mouse(x, y, 0, 0, click);
        end;
      end;
      FreeDTM(D);
    end;

    {*******************************************************************************
    procedure StoreTool(tool: string);
    By: akwardsaw
    Description: It stores the tool. Only if You are at the storing screen, and if it
                 is in your inventory. it works with every thing other than Compost
    *******************************************************************************}

    procedure StoreTool(tool: string);
    var x, y: integer;
    begin
      case tool of
        'Spade': if FindColor(x, y, 6608765, 575, 264, 614, 281)then FindTool(tool, mix1, miy1, mix2, miy2, true);
        'Dibber': if FindColor(x, y, 6608765, 669, 216, 710, 232)then FindTool(tool, mix1, miy1, mix2, miy2, true);
        'Rake': if FindColor(x, y, 6608765, 578, 215, 611, 231)then FindTool(tool, mix1, miy1, mix2, miy2, true);
        'Secatures': if FindColor(x, y, 6608765, 659, 265, 720, 279)then FindTool(tool, mix1, miy1, mix2, miy2, true);
        'Trowel': if FindColor(x, y, 6608765, 668, 311, 709, 328)then FindTool(tool, mix1, miy1, mix2, miy2, true);
        'Watering Can': if FindColor(x, y, 6608765, 556, 313, 632, 327)then FindTool(tool, mix1, miy1, mix2, miy2, true);
        'Scarecrow': if FindColor(x, y, 6608765, 565, 361, 624, 376)then FindTool(tool, mix1, miy1, mix2, miy2, true);
      end;
    end;

    {*******************************************************************************
    procedure StoreCompost(Compost: string; Number: integer; All: Boolean);
    By: akwardsaw
    Description: It stores the Compost. Only if You are at the storing screen, and if it
                 is in your inventory
                 im also sure there is a way to shorten this :P
    *******************************************************************************}

    procedure StoreCompost(Compost: string; Number: integer; All: Boolean);
    var x, y: integer;
    begin
     case Compost of
     'Compost':  begin
                 if FindColor(x, y, 6608765, 568, 407, 622, 425)then
                 begin
                   if All then
                   begin
                     FindTool(Compost, mix1, miy1, mix2, miy2, false);
                     Chooseoption('Store All');
                     wait(50 + random(50));
                     exit;
                   end;
                   if Number = 1 then FindTool(Compost, mix1, miy1, mix2, miy2, true);
                   if Number = 5 then
                   begin
                     FindTool(Compost, mix1, miy1, mix2, miy2, false);
                     Chooseoption('Store 5');
                     wait(50 + random(50));
                     exit;
                   end;
                   if all = false then
                   if Number > 1 then
                   if Number <> 5 then
                   begin
                     FindTool(Compost, mix1, miy1, mix2, miy2, false);
                     Chooseoption('Store X');
                     wait(50 + random(50));
                     typesend(inttostr(number));
                     exit;
                   end;
               end;
               end;
      'Supercompost':  begin
                 if FindColor(x, y, 6608765, 649, 409, 731, 422)then
                  begin
                   if All then
                   begin
                     mousebox(678, 431, 694, 451, 2);
                     Chooseoption('Store All');
                     wait(550 + random(500));
                     exit;
                   end;
                   if Number = 1 then mousebox(678, 431, 694, 451, 1);
                   if Number = 5 then
                   begin
                     mousebox(678, 431, 694, 451, 2);
                     Chooseoption('Store 5');
                     wait(550 + random(500));
                     exit;
                   end;
                   if not all then
                   if Number < 1 then
                   if Number <> 5 then
                   begin
                     mousebox(678, 431, 694, 451, 2);
                     Chooseoption('Store X');
                     wait(2500 + random(500));
                     typesend(inttostr(number));
                     exit;
                   end;
               end;
               end;

      'Bucket':  begin
                 if FindColor(x, y, 6608765, 664, 360, 713, 375)then
                  begin
                   if All then
                   begin
                     mousebox(678, 385, 694, 402, 2);
                     Chooseoption('Store All');
                     wait(250 + random(500));
                     exit;
                   end;
                   if Number = 1 then mousebox(678, 385, 694, 402, 1);
                   if Number = 5 then
                   begin
                     mousebox(678, 385, 694, 402, 2);
                     Chooseoption('Store 5');
                     wait(250 + random(500));
                     exit;
                   end;
                   if not all then
                   if Number < 1 then
                   if Number <> 5 then
                   begin
                     mousebox(678, 385, 694, 402, 2);
                     Chooseoption('Store X');
                     wait(250 + random(500));
                     typesend(inttostr(number));
                     exit;
                   end;
               end;
      end;
    end;
    end;

    /me thinks its not half bad for 10 min or so of work
    Last edited by Awkwardsaw; 06-30-2009 at 12:03 PM.
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  2. #2
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    SCAR Code:
    {*******************************************************************************
    Function FindTool(tool: string; cx1, cy1, cx2, cy2: integer;  click: boolean ): boolean;
    By: akwardsaw | noidea XD
    Description: It returns true or false if the tool is found. If so it either clicks
                 left, or right, depending in what you put in for Click. True is Left
    *******************************************************************************}

    Function FindTool(tool: string; cx1, cy1, cx2, cy2: integer;  click: boolean ): boolean;
    var
      x, y, D: integer;
      TSA: TStringArray;
    begin
      TSA := ['asfd', Uptexts...];
      d := GetToolDTM(Tool);
      if FindDTM(d, x, y, cx1...) then
      begin
        mmouse(x, y, 4, 4);
        wait(100+random(100));
        if IsuptextMultilCustom([TSA]) then
        begin
          getmousepos(x, y);
          result := True;
          mouse(x, y, 0, 0, click);
        end;
      end
      FreeDTM(D);
    end;
    Try

    Oh, and you might want to LowerCase() Tools, in every function
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  3. #3
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    thanks, ill work on it a bit i guess:P
    i cant test atm but it looks good
    Last edited by Awkwardsaw; 06-30-2009 at 11:40 AM.
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  4. #4
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    just put all the items uptxts in the []
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  5. #5
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    yeah,
    SCAR Code:
    Function FindTool(tool: string; cx1, cy1, cx2, cy2: integer;  click: boolean ): boolean;
    var
      x, y, D: integer;
      TSA: TStringArray;
    begin
      TSA := ['Dibber','Rake','Cure','Compost' +
          'Sack','Secatures','Basket','Trowel']
      d := GetToolDTM(Tool);
      if FindDTM(d, x, y, cx1, cy1, cx2, cy2) then
      begin
        mmouse(x, y, 4, 4);
        wait(100+random(100));
        if IsuptextMultilCustom([TSA]) then
        begin
          getmousepos(x, y);
          result := True;
          mouse(x, y, 0, 0, click);
        end;
      end
      FreeDTM(D);
    end;



    i think the same thing can be done with storecompost, right?
    Last edited by Awkwardsaw; 06-30-2009 at 11:48 AM.
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  6. #6
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Hmm, I forgot if IsUpTextMultiCustom([]) checks to see if every uptext matches or if only one does.
    If it checks for the second option(^) this shcould work
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  7. #7
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    i think multicustom is all of them, i think i remember using it before :P
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  8. #8
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    IsUpTextMultiCustom checks each with an inclusive OR statement. Meaning if any of the uptexts in the array are found, it'll result as true.

  9. #9
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    mmkay =p

    thanks for clearing it up i guess
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

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

    Default

    SCAR Code:
    {*******************************************************************************
    Function LoadToolDTM(tool: string): integer;
    By: akwardsaw
    Description: It loads the tool dtms. Only use is for GetToolDTM
    *******************************************************************************}

    Function LoadToolDTM(tool: string): integer;
    var
      Spadedtm, Diberdtm, Rakedtm, Curedtm, Compostdtm: integer;
      Sackdtm, Secaturesdtm, Basketdtm, Troweldtm: integer;
    begin
      case tool of
        'Spade': Spadedtm := DTMFromString('78DA63B465626078C28006189148206D0954F' +
                          '398801A63A09AB704D45800D57C20A0C61EA8E61901355E403557' +
                          'F1AB0100476C06E8');
        'Dibber': Diberdtm := DTMFromString('78DA634C62626078C68006189148209D03547' +
                           '387809A54A09A1704D4C403D5BC23A0A610A8E6117E3500AADB06' +
                           '97');
        'Rake': Rakedtm := DTMFromString('78DA63EC67626078C5800618914820DD4D849' +
                        'A0EA09A9704D44CA28E1A000742076F');
        'Cure': Curedtm := DTMFromString('78DA63DCCFC4C07099010D30229140FA3050C' +
                        'D43026A8E01D5BC25A0662F50CD07026AB600D5BC24A0662750CD' +
                        '2DFC6A00C07E09E5');
        'Compost': Compostdtm := DTMFromString('78DA634C656260F8C58006189148209D49849' +
                              'A62A01A4E46FC6AB2806A8409A84902AAE125A02697B07B00EBAF' +
                              '05B3');
        'Sack': Sackdtm := DTMFromString('78DA633466626060676440058C482490B606A' +
                        'A1126A0C60FA88685801A6FA09A7F0CF8D57800D57CC7AF060000' +
                        'D5037F');
        'Secatures': Secaturesdtm := DTMFromString('78DA634C64626058CDC8800A189148201D035' +
                     '4B39608359B08A8C902AA394C404D1150CD01026ACA806AF6E257' +
                     '03002E0406DA');
        'Basket': Basketdtm := DTMFromString('78DA639CC2C4C0F08B010D302291407A3A50C' +
                            'D3F026A2602D53033E257338109898743CD0C22CC990A5423C248' +
                            'D8CD3FF0BB190041A40742');
        'Trowel': Troweldtm := DTMFromString('78DA6394656460086640038C4824905626428' +
                            'D2690E54D408D3E90E54E408D2A90154E408D1A90154A408D3490' +
                            '158B5F0D00D0A4035C');
      end;
    result:= 0;
    end;

    Does that even work?

    You don't set the result to anything other than 0. It should be result := DTMFromString('blahblah');

    Also make sure you get rid of the result := 0 so it does not reset it after it sets the DTM. You should use lowercase too.

  11. #11
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    dude, DTM's lag alot and are slow

    Bitmaps are better at the moment, so use them.
    Hi

  12. #12
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by Tickyy View Post
    dude, DTM's lag alot and are slow

    Bitmaps are better at the moment, so use them.
    Interesting. I didn't know that Bitmaps are faster
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  13. #13
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    me too :P i'll convert these tonight, i have other things to do atm

    also da owner, yes it does work, although you are right that it should be result:= finddtm
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  14. #14
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    replce GetToolDTM with this as LoadToolDTM is only used for GetToolDTM which made no sense
    SCAR Code:
    function GetToolDTM(tool: string): integer;
    begin
      case tool of
        'Spade': result := DTMFromString('78DA63B465626078C28006189148206D0954F' +
                           '398801A63A09AB704D45800D57C20A0C61EA8E61901355E403557' +
                           'F1AB0100476C06E8');
        'Dibber': result := DTMFromString('78DA634C62626078C68006189148209D03547' +
                            '387809A54A09A1704D4C403D5BC23A0A610A8E6117E3500AADB06' +
                            '97');
        'Rake': result := DTMFromString('78DA63EC67626078C5800618914820DD4D849' +
                          'A0EA09A9704D44CA28E1A000742076F');
        'Cure': result := DTMFromString('78DA63DCCFC4C07099010D30229140FA3050C' +
                          'D43026A8E01D5BC25A0662F50CD07026AB600D5BC24A0662750CD' +
                          '2DFC6A00C07E09E5');
        'Compost': result := DTMFromString('78DA634C656260F8C58006189148209D49849' +
                             'A62A01A4E46FC6AB2806A8409A84902AAE125A02697B07B00EBAF' +
                             '05B3');
        'Sack': result := DTMFromString('78DA633466626060676440058C482490B606A' +
                          'A1126A0C60FA88685801A6FA09A7F0CF8D57800D57CC7AF060000' +
                          'D5037F');
        'Secatures': result := DTMFromString('78DA634C64626058CDC8800A189148201D035' +
                               '4B39608359B08A8C902AA394C404D1150CD01026ACA806AF6E257' +
                               '03002E0406DA');
        'Basket': result := DTMFromString('78DA639CC2C4C0F08B010D302291407A3A50C' +
                            'D3F026A2602D53033E257338109898743CD0C22CC990A5423C248' +
                            'D8CD3FF0BB190041A40742');
        'Trowel': result := DTMFromString('78DA6394656460086640038C4824905626428' +
                            'D2690E54D408D3E90E54E408D2A90154E408D1A90154A408D3490' +
                            '158B5F0D00D0A4035C');
      end;
    end;
    then delete LoadToolDTM
    also DTM's are faster than bitmaps!

    ~shut

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

    Default

    Nope, bitmaps are way faster in 3.20.

  16. #16
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  17. #17
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    im staying out of the"which is faster" argument, but i personally like dtms because if theyre ease and effectivity.

    and i honestly dont know why i made the dtms into 2 functions
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  18. #18
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    I tried to add a bit more standard to it, and did other things, cant rremember.

    SCAR Code:
    {*******************************************************************************
    Function LoadToolDTM(tool: string): integer;
    By: akwardsaw
    Description: It loads the tool dtms. Only use is for GetToolDTM
    *******************************************************************************}

    Function LoadToolDTM(tool: string): integer;
    begin
      case LowerCase(tool) of
        'spade': Result := DTMFromString('78DA63B465626078C28006189148206D0954F' +
                          '398801A63A09AB704D45800D57C20A0C61EA8E61901355E403557' +
                          'F1AB0100476C06E8');
        'dibber': Result := DTMFromString('78DA634C62626078C68006189148209D03547' +
                           '387809A54A09A1704D4C403D5BC23A0A610A8E6117E3500AADB06' +
                           '97');
        'rake': Result := DTMFromString('78DA63EC67626078C5800618914820DD4D849' +
                        'A0EA09A9704D44CA28E1A000742076F');
        'cure': Result := DTMFromString('78DA63DCCFC4C07099010D30229140FA3050C' +
                        'D43026A8E01D5BC25A0662F50CD07026AB600D5BC24A0662750CD' +
                        '2DFC6A00C07E09E5');
        'compost': Result := DTMFromString('78DA634C656260F8C58006189148209D49849' +
                              'A62A01A4E46FC6AB2806A8409A84902AAE125A02697B07B00EBAF' +
                              '05B3');
        'sack': Result := DTMFromString('78DA633466626060676440058C482490B606A' +
                        'A1126A0C60FA88685801A6FA09A7F0CF8D57800D57CC7AF060000' +
                        'D5037F');
        'secatures': Result := DTMFromString('78DA634C64626058CDC8800A189148201D035' +
                     '4B39608359B08A8C902AA394C404D1150CD01026ACA806AF6E257' +
                     '03002E0406DA');
        'basket': Result := DTMFromString('78DA639CC2C4C0F08B010D302291407A3A50C' +
                            'D3F026A2602D53033E257338109898743CD0C22CC990A5423C248' +
                            'D8CD3FF0BB190041A40742');
        'trowel': Result := DTMFromString('78DA6394656460086640038C4824905626428' +
                            'D2690E54D408D3E90E54E408D2A90154E408D1A90154A408D3490' +
                            '158B5F0D00D0A4035C');
      end;
    end;

    {*******************************************************************************
    Function GetToolDTM(tool: string): integer;
    By: akwardsaw
    Description: It's result is the Tool's dtm
    *******************************************************************************}

    Function GetToolDTM(tool: string): integer;
    begin
      case lowercase(tool) of
        'spade': result:= LoadToolDTM('Spade');
        'dibber':  result:= LoadToolDTM('Dibber');
        'rake':  result:= LoadToolDTM('Rake');
        'cure':  result:= LoadToolDTM('Cure');
        'compost':  result:= LoadToolDTM('Compost');
        'sack':  result:= LoadToolDTM('Sack');
        'secatures':  result:= LoadToolDTM('Secatures');
        'casket':  result:= LoadToolDTM('Basket');
        'trowel':  result:= LoadToolDTM('Trowel');
      end;
    end;

    {*******************************************************************************
    Function FindTool(tool: string; cx1, cy1, cx2, cy2: integer;  click: boolean ): boolean;
    By: akwardsaw | noidea
    Description: It returns true or false if the tool is found. If so it either clicks
                 left, or right, depending in what you put in for Click. True is Left
                 and im sure as hell theres a way to shorten this procedure :P
    *******************************************************************************}

    Function FindTool(tool: string; cx1, cy1, cx2, cy2: integer;  click: boolean ): boolean;
    var
      x, y, D: integer;
      TSA: TStringArray;
    begin
      TSA := ['ibbe','ake','ure','ompost',
          'ack','ecatures','asket','rowel']
      d := GetToolDTM(Lowercase(Tool));
      if FindDTM(d, x, y, cx1, cy1, cx2, cy2) then
      begin
        mmouse(x, y, 4, 4);
        wait(100+random(100));
        if IsuptextMultiCustom([TSA]) then
        begin
          getmousepos(x, y);
          result := True;
          mouse(x, y, 0, 0, click);
        end;
      end;
      FreeDTM(D);
    end;

    {*******************************************************************************
    procedure StoreTool(tool: string);
    By: akwardsaw
    Description: It stores the tool. Only if You are at the storing screen, and if it
                 is in your inventory. it works with every thing other than Compost
    *******************************************************************************}

    procedure StoreTool(tool: string);
    var x, y: integer;
    begin
      case tool of
        'Spade': if FindColor(x, y, 6608765, 575, 264, 614, 281)then FindTool(tool, mix1, miy1, mix2, miy2, true);
        'Dibber': if FindColor(x, y, 6608765, 669, 216, 710, 232)then FindTool(tool, mix1, miy1, mix2, miy2, true);
        'Rake': if FindColor(x, y, 6608765, 578, 215, 611, 231)then FindTool(tool, mix1, miy1, mix2, miy2, true);
        'Secatures': if FindColor(x, y, 6608765, 659, 265, 720, 279)then FindTool(tool, mix1, miy1, mix2, miy2, true);
        'Trowel': if FindColor(x, y, 6608765, 668, 311, 709, 328)then FindTool(tool, mix1, miy1, mix2, miy2, true);
        'Watering Can': if FindColor(x, y, 6608765, 556, 313, 632, 327)then FindTool(tool, mix1, miy1, mix2, miy2, true);
        'Scarecrow': if FindColor(x, y, 6608765, 565, 361, 624, 376)then FindTool(tool, mix1, miy1, mix2, miy2, true);
      end;
    end;

    {*******************************************************************************
    procedure StoreCompost(Compost: string; Number: integer; All: Boolean);
    By: akwardsaw
    Description: It stores the Compost. Only if You are at the storing screen, and if it
                 is in your inventory
                 im also sure there is a way to shorten this :P
    *******************************************************************************}

    procedure StoreCompost(Compost: string; Number: integer; All: Boolean);
    var x, y: integer;
    begin
     case Lowercase(Compost) of
     'compost':
     begin
       if FindColor(x, y, 6608765, 568, 407, 622, 425)then
       begin
         if All then
         begin
           FindTool(Compost, mix1, miy1, mix2, miy2, false);
           Chooseoption('Store All');
           wait(50 + random(50));
           exit;
         end;
         if Number = 1 then
           FindTool(Compost, mix1, miy1, mix2, miy2, true);
         if Number = 5 then
         begin
           FindTool(Compost, mix1, miy1, mix2, miy2, false);
           Chooseoption('Store 5');
           wait(50 + random(50));
           exit;
         end;
         if not All then
           if Number > 1 then
             if Number <> 5 then
             begin
               FindTool(Compost, mix1, miy1, mix2, miy2, false);
               Chooseoption('Store X');
               wait(50 + random(50));
               typesend(inttostr(number));
               exit;
             end;
         end;
       end;
      'supercompost':
      begin
        if FindColor(x, y, 6608765, 649, 409, 731, 422)then
        begin
          if All then
          begin
            mousebox(678, 431, 694, 451, 2);
            Chooseoption('Store All');
            wait(550 + random(500));
            exit;
          end;
          if Number = 1 then
            mousebox(678, 431, 694, 451, 1);
          if Number = 5 then
          begin
            mousebox(678, 431, 694, 451, 2);
            Chooseoption('Store 5');
            wait(550 + random(500));
            exit;
          end;
          if not all then
            if Number < 1 then
              if Number <> 5 then
              begin
                mousebox(678, 431, 694, 451, 2);
                Chooseoption('Store X');
                wait(2500 + random(500));
                typesend(inttostr(number));
                exit;
              end;
        end;
      end;

      'bucket':
      begin
        if FindColor(x, y, 6608765, 664, 360, 713, 375)then
        begin
          if All then
          begin
            mousebox(678, 385, 694, 402, 2);
            Chooseoption('Store All');
            wait(250 + random(500));
            exit;
          end;
          if Number = 1 then
            mousebox(678, 385, 694, 402, 1);
          if Number = 5 then
          begin
            mousebox(678, 385, 694, 402, 2);
            Chooseoption('Store 5');
            wait(250 + random(500));
            exit;
          end;
          if not all then
            if Number < 1 then
              if Number <> 5 then
              begin
                mousebox(678, 385, 694, 402, 2);
                Chooseoption('Store X');
                wait(250 + random(500));
                typesend(inttostr(number));
                exit;
              end;
          end;
        end;
      end;
    end;
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  19. #19
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    alright, thanks i'ma update/ fix/ add stuff later today
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  20. #20
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    Function GetToolDTM(tool: string): integer;
    Var Arr : TStringArray;
        I : Byte;
    begin
      Arr := ['spade', 'dibber', 'rake', 'cure', 'compost', 'sack', 'secatures', 'basket', 'trowel'];
      For I := 0 to High(Arr) Do
      If LowerCase(Tool) = Arr[I] Then
        Result := LoadToolDTM(Capitalize(Arr[I]);
    end;

    I think you should have a lowercase instead some else enters it wrong.
    Good one!

  21. #21
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    yeah, i need to add lower case to all of my cases :P

    and naum, the reason i did it my way, as in having a case load the dtms separate, was because i think it saves time and memory, although if you think it doesnt really make a difference, i'll put yours in. also i was gonna put loadtooldtm into gettooldtm, since its useless having them like they are now, other than neatness :P
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  22. #22
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Da 0wner, alot of people are still on Scar 3.15.

    You have to remember to be crosscompatible.
    Jus' Lurkin'

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

    Default

    Yes, that is true, I am currently using 3.15.

  24. #24
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is one of my ideas make a boolean for BMPorDTM = True;
    ~Hermen

  25. #25
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    Oo. :P thats a good one. go ahead and make it :P
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

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
  •