Results 1 to 4 of 4

Thread: Failsafes

  1. #1
    Join Date
    Aug 2008
    Location
    Auckland
    Posts
    132
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Failsafes

    Hey guys, its the noob once again im having trouble with failsafes, ive read some tuts, but dont fully understand. I want to ouse a boolean failsafe btw.
    So heres the code.
    SCAR Code:
    Procedure MineCopper;
    var
    copper : boolean;
    tin : boolean;
    begin
     if not loggedin then exit;
      repeat
        If (FindColorSpiralTolerance(x, y, CopperColour, MSX1, MSY1,MSX2, MSY2, 3)) or
        (FindColorSpiralTolerance(x, y, CopperColour1, MSX1, MSY1,MSX2, MSY2, 3)) Then copper : =true;
         if copper : =false; then
         terminatescript;
         begin
         TerminateScript;
         mmouse(x,y,5,5);
         if isuptext('ine')then
          begin
           wait(3000);
           Mouse(x,y,2,2,true);
           wait(3000);
           Writeln('Found Copper');
           Randoms;
         end;
        end;
      until(invfull)
    end;

    as you can see I have tried and miserably failed.

    Edit:: with the help of the srl channel i made it like this.
    SCAR Code:
    procedure MineCopper;
    var
      Copper: Boolean;
      Tin: Boolean;
    begin
      if(not(LoggedIn) then
        Exit;
      repeat
        if(FindColorSpiralTolerance(x, y, CopperColour, MSX1, MSY1,MSX2, MSY2, 3)) or
        (FindColorSpiralTolerance(x, y, CopperColour1, MSX1, MSY1,MSX2, MSY2, 3)) then
          Copper:= True;
        if(Copper = False) then
          TerminateScript;
        else
        begin
          MMouse(x, y, 5, 5);
          if(IsUpText('ine')) then
          begin
            Wait(3000);
            Mouse(x, y, 2, 2, True);
            Wait(3000);
            Writeln('Found Copper');
            Randoms;
          end;
        end;
      until(invfull);
    end;
    looks sex to me havnt tested it thow :P
    ~Tom~

  2. #2
    Join Date
    Jul 2007
    Location
    's-Gravenpolder, Holland
    Posts
    204
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Edit this in your last script:

    SCAR Code:
    if(Copper = False) then
          begin
          TerminateScript;
          end
        else

    Should fix your integer expected error

  3. #3
    Join Date
    Jun 2007
    Location
    #SRL
    Posts
    200
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    or just put it as

    SCAR Code:
    if(not(Copper)) then
          TerminateScript
        else

    (sorry i didn't put that on the IRC, i was in a rush to walk out the door)

    EDIT: here, i just pwned myself, this is that procedure with like 5 lines:

    SCAR Code:
    procedure MineCopper;
    var
      X, Y: Integer; //Need to store the varibles in X, Y; If you want to have them used elsewhere, just declare them globaly
    begin
      while not(InvFull) do //While our inventory isn't full
        if(FindObjCustom(X, Y, ['ine'], [CopperColor, CopperColor1], 5)) then //search for the copper; Includes moving the mouse and looking at the uptext
          Mouse(X, Y, 1, 1, True) //If the copper is found, then click on it
        else //otherwise,
          Exit; //leave the procedure
    end;
    Quote Originally Posted by IRC
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 43
    <Wizzup> shit
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 3
    <Wizzup> 1
    <Wizzup> offblast

  4. #4
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    A nice thing to note about booleans is:
    SCAR Code:
    if Copper = true then
    //is equivalent to
    if Copper then
    //and
    if Copper = false then
    // is equivalent to
    if not Copper then

    // the same is true for any place you would use a boolean... such as
    repeat
    until not Copper
    ~ Metagen

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Failsafes
    By Iron Man in forum OSR Intermediate Scripting Tutorials
    Replies: 11
    Last Post: 01-17-2009, 12:46 PM
  2. Failsafes
    By Raskolnikov in forum OSR Intermediate Scripting Tutorials
    Replies: 2
    Last Post: 11-07-2008, 09:21 PM
  3. How are my failsafes?
    By Jethr0x in forum OSR Help
    Replies: 11
    Last Post: 04-30-2008, 06:37 AM
  4. Failsafes
    By sirlaughsalot in forum OSR Help
    Replies: 5
    Last Post: 04-05-2008, 10:01 AM
  5. Failsafes?
    By A G E N T in forum OSR Help
    Replies: 9
    Last Post: 03-31-2007, 12:57 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
  •