Results 1 to 10 of 10

Thread: Not Repeating...

  1. #1
    Join Date
    Apr 2007
    Posts
    379
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Not Repeating...

    Ok I am making a Lumbridge Oak cutter and I am not using the generic ways of doing things, I instead tried this and it won't repeat...

    SCAR Code:
    program LumbChopeSell;

    {.include srl/SRL.scar}

    const
     Oak1 = 5216908; Oak2 = 2976862; Oak3 = 4023663; Tree = 'ak';

    var FoundTree, OakText, tx, ty, OakLog, OakLog1: Integer;

    procedure DeclareBMP;
     begin
      OakText := BitmapFromString2(False, 'aA548678DA958E590A0431' +
           '0844AF641663F2A959EE7FA4B132D07413A6610C3CA4CAD210114' +
           'D71900647E6E8E43CC1A1505A455F8BB3340C1686126B86CE1D5C' +
           'DB4594382DF4826D120C4AC3643186B2901583927B42403AE98CC' +
           '3288C362AA9BFAD5FF5EEFE5B3AD36D9B1DB7EE6E3FDCFCE2DA76' +
           '4FFE2A7B6C338AFBBA7EFFF0019E0');
      OakLog1 := BitmapFromString2(False, 'aC19A778DA1DCCC11100210' +
           '803C096108D704F3DA5FF92247C7632218388C8D1447C2503CC18' +
           '979E6AD4D3D9AA5F547D30E3A73179AD07E8C16C2DB5B6D908378' +
           '6EA8F71D451DE2F5CB11F4F9');
      OakLog := DTMFromString('78DA639CC6C4C0F0940105E4871A836946289' +
           'F710A50CD1D0634C088AAA61BA8E6310135BD40356F09A8990954' +
           'F38E809A254035AF08A85944847BE601D5DCC4AF06006AC30D03');

    end;

    procedure ChopOaks;
     Begin
      FoundTree := 0;
       Status('Attempting to Chop Oaks!');
        repeat
         If(FindObjMulti(Tree, Oak1, Oak2, Oak3, 3)) then
         begin
          repeat
          getmousepos(tx, ty);
          Mouse(tx, ty, 1, 1, True);
          FoundTree := 1;
          wait(500 + Random(1000));
         until Not(FindBitmapin(OakText, tx, ty, 120, 30, 117, 25));
        end;
       until Not FoundTree = 0;
      end;

    Begin
      SetupSRL;
      ClearDebug;
      ActivateClient;
      DeclareBMP;
      Repeat
       ChopOaks;
      Until(FindBitMapIn(OakLog, tx, ty, 686, 435, 726, 460));
    end.

    Ok so here is my problem... It will click the oak once, and just wait... forever. I would like to know how to make it repeat looking for the tree until it finds it. and then continue doing the clicking until it finds the OakLog Bitmap in the last inventory spot.

    Anyone know why it has this error?

  2. #2
    Join Date
    Apr 2007
    Location
    Texas
    Posts
    1,668
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    repeat
         If(FindObjMulti(Tree, Oak1, Oak2, Oak3, 3)) then
         begin
          repeat
          getmousepos(tx, ty);
          Mouse(tx, ty, 1, 1, True);
          FoundTree := 1;
          wait(500 + Random(1000));
         until Not(FindBitmapin(OakText, tx, ty, 120, 30, 117, 25));
        end;
       until Not FoundTree = 0;
    well, based on my logic, it looks like if it click on the oak tree... then found tree = 1, and it found the oak text too (your two untill statments) so it exits the loop as you coded it...

    SCAR Code:
    Until(FindBitMapIn(OakLog, tx, ty, 686, 435, 726, 460));
    im not exactly sure what these cordinats are, but i supose it doesnt repat the chop oaks part, because it already found a log in your inventory...

    if you still are confused, i always add debug commnets in like
    SCAR Code:
    writeln('we are in the inner if loop');
    to help me see where it gets stuck, and what path it takes.

    hope this helps
    [IMG]http://farm3.static.flickr.com/2120/2052732965_348f3629d0_o.jpg[/IMG]

  3. #3
    Join Date
    Apr 2007
    Posts
    379
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    Until(FindBitMapIn(OakLog, tx, ty, 686, 435, 726, 460));
    That is a Bitmap of part of the oak in the last invintory spot.

  4. #4
    Join Date
    Apr 2007
    Location
    Texas
    Posts
    1,668
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Tails111 View Post
    SCAR Code:
    Until(FindBitMapIn(OakLog, tx, ty, 686, 435, 726, 460));
    That is a Bitmap of part of the oak in the last invintory spot.
    ok, then as far as my eyes can see.. it should work. Add in debug messages to see what is messing up. Mabey you have a bad bitmap.
    [IMG]http://farm3.static.flickr.com/2120/2052732965_348f3629d0_o.jpg[/IMG]

  5. #5
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Begin
    SetupSRL;
    ClearDebug;
    ActivateClient;
    DeclareBMP;
    Repeat
    ChopOaks;
    Until(FindBitMapIn(OakLog, tx, ty, 686, 435, 726, 460));
    end.

    Don't you mean Until InvFull; ?


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  6. #6
    Join Date
    Apr 2007
    Posts
    379
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hy yes I mean InvFull but it uses the invintory game tab which until SRL updates or I get the patch isn't working. So I use that instead.

    I did some debugging and I fixed one problem but I have found another. If I were to start the script it would open up the runescape window(activateclient) but then not click until I click in the scar screen and then into the RS screen... here is what I use.

    SCAR Code:
    procedure ChopOaks;
     Begin
      FoundTree := 0;
       WriteLn('Starting Loop');
        repeat
           if FindBitMapIn(OakLog, tx, ty, 686, 435, 726, 460) then
        break;
         If(FindObjMulti(Tree, Oak1, Oak2, Oak3, 10)) then
         begin
          getmousepos(tx, ty);
          Mouse(tx, ty, 1, 1, True);
          WriteLn('Found Tree = 1');
          FoundTree := 1;
          wait(4000);
         Repeat
          WriteLn('Waiting');
          wait(500 + Random(500));
          WriteLn('EndWait');
         until Not (FindBitmapin(OakText, tx, ty, 120, 30, 117, 25)) or FindBitMapIn(OakLog, tx, ty, 686, 435, 726, 460);
        end;
       until FoundTree = 1;
           WriteLn('Ending Loop');
      end;

    oh and here is a report I did.

    SCAR Code:
    =~=~=~=~=~=~=~=~=~=~=~=
    |Worked For : 00:00:00
    |Chopped : 0 Oaks
    |Made : 0 Gold!!
     =~=~=~=~=~=~=~=~=~=~=~=
    Starting Loop
    Found Tree = 1
    Waiting
    EndWait
    Ending Loop
    Starting Loop
    Successfully executed

    Notice how it ended on Starting Loop, that is where it doesn't click. I waited until my character logged out before I killed the script.

  7. #7
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Well wait until SRL 4/bug fix is released, then use InvFull; it will work great..


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  8. #8
    Join Date
    Apr 2007
    Posts
    379
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thats not the problem... I fixed it up but it doesn't click when it starts that, even in the whole script when it goes to chop the mouse sits there, but when I click outside of runescape and then back in it starts up. It happens everytime the loop starts.

  9. #9
    Join Date
    Nov 2006
    Location
    In an Amish Paradise
    Posts
    729
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Drag the cross hairs across the Rs screen and bring the scar window up and press the green triangle (play). Don't press Alt+R...

    It is hard do tell what is wrong when we can't see main loop... Check your main loop for repeats...

    Hope this helps kinda,
    ~Stupedspam

    Edit: @lordgreggreg why do you have the same Avatar as YoHoJo?

  10. #10
    Join Date
    Apr 2007
    Posts
    379
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I know, I have tried both ways with all combonations possible, the problem is even in the rest of the main loop, getting back from store to cut more logs it won't click either.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Repeating script
    By Lt Mays in forum OSR Help
    Replies: 4
    Last Post: 11-18-2007, 07:46 PM
  2. repeating a certain number of times?
    By takeout in forum OSR Help
    Replies: 7
    Last Post: 09-28-2007, 07:33 PM
  3. Problem with repeating ? (ASAP pls)
    By mage of begu in forum OSR Help
    Replies: 0
    Last Post: 01-24-2007, 05:49 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
  •