Results 1 to 6 of 6

Thread: FailSafe for Betty...

  1. #1
    Join Date
    Oct 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default FailSafe for Betty...

    Ok, I am trying to get a failsafe for Betty in Falador incase FindObj misses. This is my script:
    SCAR Code:
    program NewtGrabber;
      {.include SRL/SRL.scar}


    procedure BuyItems;
      begin
        Mouse(94, 131, 1, 1, False);
        PopUp('Buy 10');
      end;

     function tradescreen:boolean;
    begin
    if (getcolor(377, 90)=1878496) then result:=true;
    end;

    function PopUpDuo(Option1,Option2: string): Boolean;
    var
      Top, Bottom: TPoint;
      dtmTop, dtmBottom, x, y: Integer;
    begin
      dtmTop := DTMFromString('78DA63146464606801622C0026CA28006435A' +
        '3AA890D7147552345841A90393D04D4880259DD04D4880359ED04' +
        'D4280059AD04FC2504644DC4AF06000DC909E0');
      dtmBottom := DTMFromString('78DA635CCCC8C070198891406C883B9886893' +
        '22E02B22EA1AA8101B89A8540D64522CCB948843984EC02B9F910' +
        '01BBA610E1AF6944D80572F311026AE6005967F0DB05007BD4134' +
        '5');
        if (FindDTM(dtmTop, Top.x, Top.y, 10, 10, 764, 502) and FindDTM(dtmBottom,
        Bottom.x, Bottom.y, Top.x, Top.y, 764, 502)) then
        if (FindText(x, y, Option1, upchars, 0, 0, Bottom.x, Bottom.y)) and (FindText(x, y, Option2, upchars, 0, 0, Bottom.x, Bottom.y)) then
        begin
          Result := True;
          Mouse(x + (Length(Option1)+Length(Option2)) * 3, y + 2, 4, 3, True);
          Wait(150 + Random(200));
        end else
         if (FindText(x, y, 'Cancel', upchars, Top.x, Top.y, Bottom.x, Bottom.y))
            then
            Mouse(x + 3, y + 2, 4, 3, True);
      FreeDTM(dtmTop);
      FreeDTM(dtmBottom);
    end;



    Procedure BettyClick;  var mybool:boolean; var tries:integer;
    begin
    repeat
    tries:=tries+1;
        if(FindObj(x,y, 'alk', 5441875, 10)) then
        begin
        mybool:=true;
        Mouse(x,y,1,1,false);
        popupduo('rade','etty');
       end;
       if not(mybool) then wait(500+random(500));
       until((mybool) or (tries>5));
       if not(mybool) then logout;
       end;
     
    procedure SetupScript;
      begin
        SetupSRL;
        activateclient;
      end;

    begin
      SetupScript;
      BettyClick;
       if (tradescreen) then
      BuyItems;
      else
     
    end.


    If it misses, it ends the script, if it trades, it ends the script, any ideas?

  2. #2
    Join Date
    Oct 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I really need help...

    If anyone else has a new method, I will be glad to consider.

  3. #3
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default

    Try using:
    Repeat...Until
    While...Do
    For ...=... to ... do


    You only need another loop surrounding your script.

    Repeat
    BettyClick;
    if (tradescreen) then
    BuyItems;
    else
    until False;
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

  4. #4
    Join Date
    Oct 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program NewtGrabber;
      {.include SRL/SRL.scar}

    var tries:integer;

    procedure BuyItems;
     begin
        Mouse(94, 131, 1, 1, False);
       PopUp('Buy 10');
      end;

    function tradescreen:boolean;
    begin
    if (getcolor(377, 90)=1878496) then result:=true;
    end;

    function PopUpDuo(Option1,Option2: string): Boolean;
    var
      Top, Bottom: TPoint;
      dtmTop, dtmBottom, x, y: Integer;
    begin
      dtmTop := DTMFromString('78DA63146464606801622C0026CA28006435A' +
        '3AA890D7147552345841A90393D04D4880259DD04D4880359ED04' +
        'D4280059AD04FC2504644DC4AF06000DC909E0');
      dtmBottom := DTMFromString('78DA635CCCC8C070198891406C883B9886893' +
        '22E02B22EA1AA8101B89A8540D64522CCB948843984EC02B9F910' +
        '01BBA610E1AF6944D80572F311026AE6005967F0DB05007BD4134' +
        '5');
        if (FindDTM(dtmTop, Top.x, Top.y, 10, 10, 764, 502) and FindDTM(dtmBottom,
        Bottom.x, Bottom.y, Top.x, Top.y, 764, 502)) then
        if (FindText(x, y, Option1, upchars, 0, 0, Bottom.x, Bottom.y)) and (FindText(x, y, Option2, upchars, 0, 0, Bottom.x, Bottom.y)) then
        begin
          Result := True;
          Mouse(x + (Length(Option1)+Length(Option2)) * 3, y + 2, 4, 3, True);
          Wait(150 + Random(200));
        end else
         if (FindText(x, y, 'Cancel', upchars, Top.x, Top.y, Bottom.x, Bottom.y))
            then
            Mouse(x + 3, y + 2, 4, 3, True);
      FreeDTM(dtmTop);
      FreeDTM(dtmBottom);
    end;



    Procedure BettyClick;  var mybool:boolean; var bettytries:integer;
    begin
    repeat
    tries:=tries+1;
        if(FindObj(x,y, 'alk', 5441875, 10)) then
        begin
        mybool:=true;
        Mouse(x,y,1,1,false);
        popupduo('rade','etty');
       end;
       if not(mybool) then wait(500+random(500));
       until((mybool) or (bettytries>5));
       if not(mybool) then logout;
       end;
     
    procedure SetupScript;
      begin
        SetupSRL;
        activateclient;
      end;

    begin
      SetupScript;
      repeat
      BettyClick;
     if (tradescreen) then
       BuyItems
      else
      if tries>10 then
      logout;
     
    end.

    It says identifier expected, but it doesn't give a line...?

  5. #5
    Join Date
    Sep 2006
    Location
    Scripter's Heaven
    Posts
    455
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    try putting a "}" at the end...

    And check out my pascal interpreter!
    <R0b0t1> No, really, I went to a bar and picked up a transvestite.

  6. #6
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    all repeats need untils, all begins need ends

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. my failsafe idea
    By havoc928 in forum OSR Help
    Replies: 3
    Last Post: 08-22-2007, 03:20 PM
  2. Help with failsafe
    By Venom666 in forum OSR Help
    Replies: 5
    Last Post: 07-01-2007, 05:06 AM
  3. Need some help with failsafe
    By Scarf4ce in forum OSR Help
    Replies: 3
    Last Post: 06-26-2007, 08:05 AM
  4. Failsafe for FindMage-
    By syberium in forum OSR Help
    Replies: 11
    Last Post: 02-05-2007, 04:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •