Results 1 to 10 of 10

Thread: loop help

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

    Default loop help

    ok is there a way to make this prodeure run until the inv is empty or only has one thing in it depending on it the person holding or not holding their pick axe

    Code:
    procedure DropTheStuff;
    begin
      MithDTM:= DTMFromString('78DA637461606038C780021C1CE3184480342' +
           '310FF0702C62020E318031A60442281B427903844408D13903848' +
           '408D29A67BB0AAB946845D7708A8F123C21C90DFCFE057030046A' +
           '30EB0');
    
       AddyDTM:= DTMFromString('78DA6374656060D0646440069E315E0C22401' +
           'A24FA1F081803810C05543510591809A40380840101354E40C29C' +
           '801A3320A14E408D03909025A0C693B01A0010E60813');
    
       IronDTM:= DTMFromString('78DA633CC4C4C0F0940105F819AA328800694' +
           '620FE0F048CFB30D540646124903E0854F38A809AA340352F08A8' +
           '01D9F589809A8D4035CF09A8D90D547393809A6340353708A8390' +
           '754F388809A5340356FF0AB0100BA0D1568');
    
       CoalDTM:= DTMFromString('78DA639CC6C4C0F08C01059899A9328800694' +
           '620FE0F048C8B816A6E33A001462412482F02AA794D40CD64A09A' +
           '4F04D4B403D5BC2042CD13026A2601D5DC20A0A61BA8E61E7E350' +
           '0164F1082');
    
       CopperDTM:= DTMFromString('78DA6374656260E060644006B7EA2D1944803' +
           '448F43F10300602D530A2AA81C8C24820ED03542340408D3D508D' +
           '180135C64035DC04D4D801D5FC61C0AFC683B01A008E8109D6')
    
       TinDTM:= DTMFromString('78DA637463606058C58002BA9B1A194480342' +
           '310FF0702C620206301031A60442281740090584F408D3390D846' +
           '408D3990D848408D0590584C408D2390984D408D079098835F0D0' +
           '05B190D13');
      If FindDTM(MithDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
      If FindDTM(AddyDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
      If FindDTM(IronDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
      If FindDTM(CopperDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
      If FindDTM(TinDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
      If FindDTM(CoalDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
      Begin
      Mouse(x,y,0,0,False);
      ChooseOption('Drop');
      end;
    end;
    Last edited by JPHamlett; 03-21-2009 at 06:10 PM. Reason: forgot the code

  2. #2
    Join Date
    Jan 2009
    Location
    Somewhere
    Posts
    240
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    make this prodeure run until the inv is empty
    SCAR Code:
    Until not InvFull

    only has one thing in it depending on it the person holding or not holding their pick axe
    What? Didn't get it

  3. #3
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    SCAR Code:
    function DropTheStuff: boolean;
    var
    i , ii: integer;
    begin
      MithDTM:= DTMFromString('78DA637461606038C780021C1CE3184480342' +
           '310FF0702C62020E318031A60442281B427903844408D13903848' +
           '408D29A67BB0AAB946845D7708A8F123C21C90DFCFE057030046A' +
           '30EB0');

       AddyDTM:= DTMFromString('78DA6374656060D0646440069E315E0C22401' +
           'A24FA1F081803810C05543510591809A40380840101354E40C29C' +
           '801A3320A14E408D03909025A0C693B01A0010E60813');

       IronDTM:= DTMFromString('78DA633CC4C4C0F0940105F819AA328800694' +
           '620FE0F048CFB30D540646124903E0854F38A809AA340352F08A8' +
           '01D9F589809A8D4035CF09A8D90D547393809A6340353708A8390' +
           '754F388809A5340356FF0AB0100BA0D1568');

       CoalDTM:= DTMFromString('78DA639CC6C4C0F08C01059899A9328800694' +
           '620FE0F048C8B816A6E33A001462412482F02AA794D40CD64A09A' +
           '4F04D4B403D5BC2042CD13026A2601D5DC20A0A61BA8E61E7E350' +
           '0164F1082');

       CopperDTM:= DTMFromString('78DA6374656260E060644006B7EA2D1944803' +
           '448F43F10300602D530A2AA81C8C24820ED03542340408D3D508D' +
           '180135C64035DC04D4D801D5FC61C0AFC683B01A008E8109D6')

       TinDTM:= DTMFromString('78DA637463606058C58002BA9B1A194480342' +
           '310FF0702C620206301031A60442281740090584F408D3390D846' +
           '408D3990D848408D0590584C408D2390984D408D079098835F0D0' +
           '05B190D13');
      Repeat
        If FindDTM(MithDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
        If FindDTM(AddyDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
        If FindDTM(IronDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
        If FindDTM(CopperDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
        If FindDTM(TinDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
        If FindDTM(CoalDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
        Begin
          Mouse(x,y,0,0,False);
          ChooseOption('Drop');
        end;
        For i := 0 to 27 do //or 1 to 27 if pick not weilded
        Begin
          If ExistsItem(i) then
          ii := ii + 1;
        end;
      Until ii <= 0;
    end;

    Just repeats until it doesn't find any items. Note: this doesn't have any failsafes yet.

  4. #4
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    You should use a TIntegerArray for the DTMs, then a for loop looking for the DTMs Would look better than the great big amount of if..then Statements.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

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

    Default

    Quote Originally Posted by Nava2 View Post
    You should use a TIntegerArray for the DTMs, then a for loop looking for the DTMs Would look better than the great big amount of if..then Statements.
    i odnt get what your saying

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

    Default

    Like
    DTM[0] := BitmapFromString()//MithDTM
    And so on so DTM[1] := //Iron DTM

    Then Do

    SCAR Code:
    For I := 0 To High(DTM) Do
      If FindDTM(DTM[I]) Then
      DoStuff

    But that was very crudely done, read up on For To Do statements

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

    Default

    is there a tut for tht cause i rele dont understand what your saying

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

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

    Default

    TIntegerArray is an array of integers, , Btw, as a failsafe you could use DropAll;

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

    Default

    Quote Originally Posted by Smarter Child View Post
    TIntegerArray is an array of integers, , Btw, as a failsafe you could use DropAll;
    drop all as my dropingwith dtms or just dropall alone

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
  •