Results 1 to 15 of 15

Thread: FindObjMulri

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

    Default FindObjMulri

    well I am making a WC script and have decided to use FindObjMulti.
    Here are my consts for it.

    SCAR Code:
    const
    Oak1 = 3627896; Oak2 = 1594952; Oak3 = 3760254; Tree = 'hop down Oak';

    and here is how I use them
    SCAR Code:
    procedure ChopOaks;
     Begin
      If(FindObjMulti(Tree, Oak1, Oak2, Oak3, 10)) then
      Mouse(tx, ty, 10, 10, True);
     end;

    SCAR Code:
    Begin
     SetupSRL;
     DeclareBMP;
     ClearDebug;
     ChopOaks;
     end.

    Obviously I haven't added the enk or what not but anyways here is my problem.

    The script compiles and stops in less then half a second. It just ends. I am wondering how to make this find the Oak behind lumbridge store.

    What I am really asking is for someone to fix the script because I am completely lost now.

  2. #2
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Its because SRL isn't compatible with the new RS interface. Wait until a new SRL version is released.

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

    Default

    I know but arg fine Im turning the computer off.

  4. #4
    Join Date
    Aug 2007
    Posts
    75
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Just to make sure, are you actually near the oak? there is nothing above that will actually locate anything but oak coloured objects(no movement of your char)

    as finishing in under a second this could just be because there are no oaks on your main screen so its run through all instructions, decided there is nothing to do and ended. Hope this helps.

  5. #5
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    The whole main loop occurs so quickly that you don't even get time to try it properly. Firstly, I would put a repeat in the ChopOaks procedure.

    I would put an ActivateClient at the beginning of the script, along with a wait.

    SCAR Code:
    procedure ChopOaks;
     Begin
       repeat  
        If(FindObjMulti(Tree, Oak1, Oak2, Oak3, 10)) then
        Mouse(tx, ty, 10, 10, True);
       until(FindObjMulti(Tree, Oak1, Oak2, Oak3, 10));
     end;

    SCAR Code:
    Begin
      ActivateClient;
      SetupSRL;
      DeclareBMP;
      ClearDebug;
      Wait(3000);
      ChopOaks;
    end.

    Replace your current procedures with the ones I just posted...and report the results
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  6. #6
    Join Date
    Aug 2007
    Posts
    75
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    @zeph, the script should still work because its based on colours which i presume where taken from RS post update....

    I've made a script to bury bones this morning...works fine. I might be wrong but running just a second sounds like he's not near any oaks.

  7. #7
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Dude View Post
    @zeph, the script should still work because its based on colours which i presume where taken from RS post update....

    I've made a script to bury bones this morning...works fine. I might be wrong but running just a second sounds like he's not near any oaks.
    It might not because the coords for checking if you are logged in or not might have changed thus the script thinks you are not logged in and exits the functions. Its like that other update all over again....

  8. #8
    Join Date
    Aug 2007
    Posts
    75
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ah thanks for that zaph as a new user to scar i dont know the ins and outs of all the functions yet. Currently looking for a tut on mouse()...

  9. #9
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Doesnt FOM return coordinates at all? o lo...

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

    Default

    Well it finds and clicks the oak. But now it won't repeat?
    SCAR Code:
    procedure ChopOaks;
      Begin
       repeat
        If FindObjMulti(Tree, Oak1, Oak2, Oak3, 5) Then
         begin
          Status('Getting Pos + Clicking');
          GetMousePos(tx, ty);
          Mouse(tx, ty, 10, 10, True);
          Status('Clicked');
          wait(8000);
          end;
         until(FindObjMulti(Tree, Oak1, Oak2, Oak3, 5));
     end;

    SCAR Code:
    Begin
      ActivateClient;
      SetupSRL;
      DeclareBMP;
      ClearDebug;
     repeat
      ChopOaks;
    until(FindObjEx(tx, ty, 'Oak logs', 683, 432, 730, 460, 3298414, 100, 1, 1, 500, False));
    end.

  11. #11
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    until(FindObjMulti(Tree, Oak1, Oak2, Oak3, 5));

    That's because we told it to stop repeating after it found an oak tree.

    This should work...it'll repeat until you stop the script:

    SCAR Code:
    until(False);
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

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

    Default

    Sorry Santa, I got it working I had done some new stuff to it, I forgot to update my post saying i got it to work. Anyways here is what I will do,

    SCAR Code:
    program LumbChopeSell;

    {.include srl/SRL.scar}

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

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

    procedure DeclareBMP;
     begin
       OakLog := DTMFromString('78DA639CC6C4C0F0940105E4871A836946289' +
           'F710A50CD1D0634C088AAA61BA8E6310135BD40356F09A8990954' +
           'F38E809A254035AF08A85944847BE601D5DCC4AF06006AC30D03');
      OakLog1 := BitmapFromString2(False, 'aC19A778DA1DCCC11100210' +
           '803C096108D704F3DA5FF92247C7632218388C8D1447C2503CC18' +
           '979E6AD4D3D9AA5F547D30E3A73179AD07E8C16C2DB5B6D908378' +
           '6EA8F71D451DE2F5CB11F4F9');
     end;

    procedure ChopOaks;
     Begin
     FoundTree = 0;
      WriteLn('Attempting to Chop Oaks!');
       repeat
        If(FindObjMulti(Tree, Oak1, Oak2, Oak3, 10)) then
         begin
          getmousepos(tx, ty);
          Mouse(tx, ty, 1, 1, True);
          FoundTree = 1;
          wait(2000 + Random(4000));
         end;
        until Not FoundTree = 1;
       end;
    Begin
      SetupSRL;
      ClearDebug;
      ActivateClient;
      DeclareBMP;
      Repeat
      Repeat
       ChopOaks;
      Until(FindDTM(OakLog1, tx, ty, 686, 435, 726, 460));
      Until(False);
    end.

    BTW The end looks werid with those 2 repeats right next to each other because I took this out of my script and I don't know if it is nessissary and I don't have time to test it right now.

  13. #13
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I think this:

    SCAR Code:
    Repeat
      Repeat
       ChopOaks;
      Until(FindDTM(OakLog1, tx, ty, 686, 435, 726, 460));
      Until(False);

    Is pretty much the same as this:

    SCAR Code:
    Repeat
       ChopOaks;
      Until(False);
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

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

    Default

    Well, from what I have read until(false) is an unending loop, which I hear is bad. The FindDTM finds the oak log in the last spot and stops.

    And that is not how it looks in my script because I have all the other things need between the first repeat and the time it gets to chop oaks. I am infact almost done it. As soon as the SRL update comes out so I can test my walking then I will be all set and release this.

  15. #15
    Join Date
    Apr 2007
    Location
    new zealand
    Posts
    87
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lookn good jst wondering if u might wanna make a script with me and partner up or somthn contact me on msn @ dark4mdawn@hotmail.com

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
  •