Results 1 to 5 of 5

Thread: What's wrong with this?

  1. #1
    Join Date
    Aug 2006
    Posts
    408
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default What's wrong with this?

    I'm trying to get scar to pick up the jug and grapes in the cooking guild and it's not working. What's the best way to get scar to pick up an object, pick up the other, wait for them to respawn, and repeat until it's done that 14 times?

    SCAR Code:
    Procedure PickJug;
    begin
    z := z+1
    repeat
    If(findobj3(xx, yy,'Jug', 8158598, 2))then
    begin
    wait(5000+random(2000))
    Mouse(xx, yy, 0, 0, false)
    ChooseOption(x, y, 'Take')
    end;
    until(InvCount = z)
    end;

    Procedure PickGrapes;
    begin
    z := z+1
    repeat
    begin
    If(findobj3(xx, yy,'Grapes', 8328362, 3))then
    wait(5000+random(2000))
    Mouse(xx, yy, 0, 0, false)
    ChooseOption(x, y, 'Take')
    end;
    until(InvCount = z)
    end;

    Procedure PickupStuff;
    begin
    repeat
    PickJug;
    PickGrapes;
    i := i+1
    until(i = 14)
    end;

  2. #2
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Why do you use Until (InvCount = z)?
    That always means that it will only stop if your invcount will return 1. And if you repeat that action your inventury will grow so the function wont work.

    Use something like

    SCAR Code:
    z := InvCount;
    repeat
      blabla
    until(InvCount > z)
    Hup Holland Hup!

  3. #3
    Join Date
    Mar 2007
    Location
    Under a rock
    Posts
    813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    1.) Does the script use SRL?
    2.) Whats findobj3? I use FindObjArea
    3.) Maybe the script should be like this?

    SCAR Code:
    var
    JugsTaken, GrapesTaken : Integer;

    Procedure PickJug;
    begin
    z := z+1
    repeat
    If(findobj3(xx, yy,'Jug', 8158598, 2))then
    begin
    wait(5000+random(2000))
    Mouse(xx, yy, 0, 0, false)
    ChooseOption(x, y, 'Take')
    JugsTaken := JugsTaken+1
    end;
    until(InvCount = z)
    end;
     
    Procedure PickGrapes;
    begin
    z := z+1
    repeat
    begin
    If(findobj3(xx, yy,'Grapes', 8328362, 3))then
    wait(5000+random(2000))
    Mouse(xx, yy, 0, 0, false)
    ChooseOption(x, y, 'Take')
    GrapesTaken := GrapesTaken+1
    end;
    until(InvCount = z)
    end;
     
    Procedure PickupStuff;
    begin
    repeat
    PickJug;
    PickGrapes;
    until(GrapesTaken >= 14)and(JugsTaken >= 14)
    end;

  4. #4
    Join Date
    Aug 2006
    Posts
    408
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is an SRL script, but I'm not as much looking for corrections as I'm looking for a better way to pick up items that might not always be there, while getting 14 of each item.

  5. #5
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    if(IsUpText('rapes')) then
    Mouse(x,y,2,2,true)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. what am i doing wrong ?:P
    By sjlou in forum OSR Help
    Replies: 2
    Last Post: 10-01-2007, 01:52 PM
  2. What am i doing wrong?
    By One Leeter in forum OSR Help
    Replies: 7
    Last Post: 06-15-2007, 10:33 PM
  3. Replies: 8
    Last Post: 03-23-2007, 04:20 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
  •