Results 1 to 5 of 5

Thread: Fix me

  1. #1
    Join Date
    Feb 2007
    Posts
    849
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Fix me

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



    const
    aorb=('');// a is iron, b is coal
    IronColour= 2701145;
    CoalColour= 8999999;



    Function FindIron: Boolean;
    begin
      if(aorb=('a'))then
      x:=256;y:=174;
    if(FindColorspiralTolerance(x, y, IronColour, 0, 0, 515, 337, 2))then
      begin
        Result := True;
        Writeln('Fount Some Iron');
        wait(1000+random(500));
      end else
        Writeln('Were Is That Iron?');
        wait(1000+random(500));
    end;

    Function FindCoal: Boolean;
    begin
      if(aorb=('b'))then
      x:=256;y:=174;
    if(FindColorspiralTolerance(x, y, CoalColour, 0, 0, 515, 337, 2))then
      begin
        Result := True;
        Writeln('Fount Some Coal');
        wait(1000+random(500));
      end else
        Writeln('Were Is That Coal?');
        wait(1000+random(500));
    end;


    Function MoveMouseToIron: Boolean;
    begin

      Repeat
        if aorb=('a')
        if (FindRock) Then
        begin
          Result := True;
          MMouse(x, y, 2, 2);
          Wait(10+random(20));
          Exit;
        end;
      until (False)
    end;

    Function MoveMouseToCoal: Boolean;
    begin

      Repeat
        if aorb=('b')
        if (FindRock) then
        begin
          Result := True;
          MMouse(x, y, 2, 2);
          Wait(10+random(20));
          Exit;
        end;
      until (False)
    end;

    procedure ClickIron;
    begin

      if (MoveMouseToIron = true) then
      begin
        aorb=('a');
        Mouse(x, y, 2, 2, True)
        Wait(3500+random(100));
      end;
    end;

    procedure ClickCoal;
    begin

      if (MoveMouseToCoal = true) then
      begin
        aorb=('b');
        Mouse(x, y, 2, 2, True)
        Wait(3500+random(100));
      end;
    end

    Procedure Dropores;
    begin
      if(InvFull)then
        DropTo(3,28);
    end;







    begin
    repeat
    setupsrl;
    if(aorb=('a'))then
    FindIron;
    MoveMouseToIron;
    ClickIron;
    Dropores;
    until(false)

    repeat
    if(aorb=('b'))then
    FindCoal;
    MoveMouseToCoal;
    ClickCoal;
    Dropores;
    until(false)
    end.


    a + b base miner
    can sombody fix it please or make it shorter

    coal isnt the right code, just a number
    ________________________________________
    14:19 < cycrosism> I wonder what she would have done without it
    14:19 < cycrosism> without me*
    Cycrosism is now an it.
    Quote Originally Posted by Dervish View Post
    /Facedesk.

  2. #2
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

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



    const
    aorb=('');// a is iron, b is coal
    IronColour= 2701145;
    CoalColour= 8999999;



    Function FindIron: Boolean;
    begin
      if(aorb=('a'))then
      x:=256;y:=174;
    if(FindColorspiralTolerance(x, y, IronColour, 0, 0, 515, 337, 2))then
      begin
        Result := True;
        Writeln('Fount Some Iron');
        wait(1000+random(500));
      end else
        Writeln('Were Is That Iron?');
        wait(1000+random(500));
    end;

    Function FindCoal: Boolean;
    begin
      if(aorb=('b'))then
      x:=256;y:=174;
    if(FindColorspiralTolerance(x, y, CoalColour, 0, 0, 515, 337, 2))then
      begin
        Result := True;
        Writeln('Fount Some Coal');
        wait(1000+random(500));
      end else
        Writeln('Were Is That Coal?');
        wait(1000+random(500));
    end;


    Function MoveMouseToIron: Boolean;
    begin
      Repeat
        if aorb=('a')then
        if (FindIron) Then
        begin
          Result := True;
          MMouse(x, y, 2, 2);
          Wait(10+random(20));
          Exit;
        end;
      until (False)
    end;

    Function MoveMouseToCoal: Boolean;
    begin

      Repeat
        if aorb=('b')then
        if (FindCoal) then
        begin
          Result := True;
          MMouse(x, y, 2, 2);
          Wait(10+random(20));
          Exit;
        end;
      until (False)
    end;

    procedure ClickIron;
    begin

      if (MoveMouseToIron = true) then
      begin
        if(aorb=('a'))then
        begin
        Mouse(x, y, 2, 2, True)
        Wait(3500+random(100));
      end;
    end;
    end;

    procedure ClickCoal;
    begin

      if (MoveMouseToCoal = true) then
      begin
        if(aorb=('b'))then
        Mouse(x, y, 2, 2, True)
        Wait(3500+random(100));
      end;
    end;

    Procedure Dropores;
    begin
      if(InvFull)then
        DropTo(3,28);
    end;







    begin
    cleardebug;
    ActivateClient;
    setupsrl;
    repeat
    if(aorb=('a'))then
    FindIron;
    MoveMouseToIron;
    ClickIron;
    Dropores;
    until(false)
    repeat
    if(aorb=('b'))then
    FindCoal;
    MoveMouseToCoal;
    ClickCoal;
    Dropores;
    until(false)
    end.

    I think that will work..

  3. #3
    Join Date
    Feb 2007
    Posts
    849
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    cheers, its just the base code, gonna add antirandoms and maybe multyplayer

    add me on msn haz43@hotmail.co.uk
    ________________________________________
    14:19 < cycrosism> I wonder what she would have done without it
    14:19 < cycrosism> without me*
    Cycrosism is now an it.
    Quote Originally Posted by Dervish View Post
    /Facedesk.

  4. #4
    Join Date
    Feb 2007
    Posts
    849
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    its very slow
    ________________________________________
    14:19 < cycrosism> I wonder what she would have done without it
    14:19 < cycrosism> without me*
    Cycrosism is now an it.
    Quote Originally Posted by Dervish View Post
    /Facedesk.

  5. #5
    Join Date
    Feb 2007
    Posts
    19
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lines:19 - 24 and 33 - 38
    Result := True;
    Writeln('Fount Some Iron');
    wait(1000+random(500));
    end else
    Writeln('Were Is That Iron?');
    wait(1000+random(500));
    You got the lines: wait(1000+random(500)); In there...
    It's waiting atleast 1 second, before it does anything.... i'd make that MUCH lower, maybe 50? or 10 MilliSeconds.

    The same thing is in the 'FindCoal' procedure.
    Just drop those wait times to something small.


    There might be a problem for a 'Slow Script.'


    One more thing I found wrong,

    You have:

    Lines: 110 - 117

    setupsrl;
    repeat
    if(aorb=('a'))then
    FindIron;
    MoveMouseToIron;
    ClickIron;
    Dropores;
    until(false)

    This is causing an Infinite loop. Your telling it to repeat the 'If' command, infenetly. It you try to mine coal, it just freezes the screen.

    This just a typing error i'm sure. Just move the 'Repeat' command down 1 line.

    setupsrl;
    if(aorb=('a'))then
    repeat
    FindIron;
    MoveMouseToIron;
    ClickIron;
    Dropores;
    until(false)

    That should be it.

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
  •