Results 1 to 6 of 6

Thread: How do i loop my first script?

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

    Default How do i loop my first script?

    hi, just wondering if someone can tell me how to loop the script? the only thing ti does atm is find the ore and mine it.

    //================================================== ======================//
    // -=My Happy go Gay Powerminer=- //
    //================================================== ======================//
    // By James //
    // Its Pretty much useless //
    // But it looks pretty //
    //================================================== ======================//
    program PowerMiner;
    var
    x,y: Integer;
    //===========================//Colors//===================================//
    const
    OreColor= 4879005;// Set the color of the Iron

    //===========================//Colors//===================================//
    procedure FindOre;
    begin
    Wait(100+random(200));
    if(FindColor(x,y,OreColor,0,0,600,600)) then
    begin
    Writeln('Ore Found');
    end else
    end;

    procedure Mine;
    begin
    if(FindColor(x,y,OreColor,0,0,600,600)) then
    begin
    Wait(100+random(200));
    MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
    Wait(100+random(10));
    ClickMouse(x,y,true);
    Wait(800+random(200));
    end;
    end;

    begin//Loop
    FindOre;
    Mine;
    Mine;
    Mine;
    Mine;
    Mine;
    Mine;
    Mine;
    Mine;
    Mine;
    end.
    Until(False);
    end.

  2. #2
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    edit :im a beegginer so i may be wrong.

    SCAR Code:
    //========================================================================//
    //                    -=My Happy go Gay Powerminer=-                      //
    //========================================================================//
    //                             By James                                   //
    //                      Its Pretty much useless                           //
    //                        But it looks pretty                             //
    //========================================================================//
    program PowerMiner;
    var
    x,y: Integer;
    //===========================//Colors//===================================//
    const
    OreColor= 4879005;// Set the color of the Iron

    //===========================//Colors//===================================//
    procedure FindOre;
    begin
    Wait(100+random(200));
    if(FindColor(x,y,OreColor,0,0,600,600)) then
     begin
      Writeln('Ore Found');
       end   else
       end;
     
    procedure Mine;
    begin
    if(FindColor(x,y,OreColor,0,0,600,600)) then
     begin
     Wait(100+random(200));
      MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);///GET RID OF THIS !!! ITS SO
    //Detectable!!!!
      Wait(100+random(10));
      ClickMouse(x,y,true);//THIS TO REPLACE THESE WITH MOUSE OR MMOUSE
      Wait(800+random(200));
     end;
    end;

    begin//Loop
    FindOre;
     repeat
    Mine;
      until (invfull)
    end.

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

    Default

    I pretty much answered that here:
    http://www.villavu.com/forum/showthr...=12529?t=13905

    Here's your script with a few problems fixed:
    SCAR Code:
    //========================================================================//
    //                    -=My Happy go Gay Powerminer=-                      //
    //========================================================================//
    //                             By James                                   //
    //                      Its Pretty much useless                           //
    //                        But it looks pretty                             //
    //========================================================================//
    program PowerMiner;
    {.include SRL/SRL.scar}
    var
    x, y, i: Integer;
    //===========================//Colors//===================================//
    const
    OreColor= 4879005;// Set the color of the Iron
     
    //===========================//Colors//===================================//
    procedure FindOre;
    begin
    Wait(100+random(200));
    if(FindColorTolerance(x,y,OreColor,0,0,600,600, 10)) then
     begin
      Writeln('Ore Found');
       end   else
       end;
     
    procedure Mine;
    begin
    if(FindColor(x,y,OreColor,0,0,600,600,10)) then
     begin
     Wait(100+random(200));
      Mouse(x, y, 0, 0, true)
      Wait(800+random(200));
     end;
    end;
     

    //////////MAIN LOOP\\\\\\\\\\
    begin
    SetupSRL;
    i = 0
    FindOre;
     repeat
      Mine;
      i = i+1
      until(i>10)
    end.

  4. #4
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    alach11, are you really not a SRL Member??? You always seam to help people out with their scripts like you are an expert You should apply for membership ...


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  5. #5
    Join Date
    Jun 2007
    Location
    NSW, Australia.
    Posts
    541
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It seems like your question has already been answered... but in case you didn't understand it when they 'Standardized' it...

    SCAR Code:
    //Put this in your main loop.
    repeat
    FindOre;    //You really want to find the ore every single time, just incase :rolleyes:
    Mine;
    Until(Not(LoggedIn));   // You don't want to do until false, otherwise if you get logged out, it will still try to do it. This is called a 'failsafe'.

    Pancakes.
    Quote Originally Posted by RAM View Post
    I sam sofa king wee todd did ! ~RAM
    My SRL Army Blog.


  6. #6
    Join Date
    Mar 2007
    Location
    In your computer
    Posts
    244
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I had completely changed the script , so if you ever gonna release it then please do Credit to me . And if you need help with scripting then add me on msn: i_like_pie1995.
    Added Fail Safe(s).
    Added Report.
    Added Stuff just look over it .

    So here it comes! The Script!
    SCAR Code:
    Program PowerMiner;
    {.include SRL/SRL.scar}
    //================================================== ======================//
    // -=My Happy go Gay Powerminer=- //
    //================================================== ======================//
    // By James //
    // Its Pretty much useless //
    // But it looks pretty //
    //================================================== ======================//
    Var
    OresMined: Integer;
    //===========================//Colors//===================================//
    Const
    OreColor = 4879005;// Set the color of the Iron.
    OresToMine = 10;//How many loads you want to do.

    //===========================//Colors//===================================//
    Procedure FindOre;
    Begin
    If FindColor(x,y,OreColor,0,0,400,400)Then
    Begin
    Writeln('Ore Found');
    WriteLn('Ore Color:' +IntToStr(OreColor)+ '');
    End;
    End;


    Procedure Mine;
    Begin
    Repeat
    If FindColor(x,y,OreColor,0,0,400,400)Then
    MMouse(x,y,1,1);
    Wait(500+random(200));
    Until (IsUpText('ine'));
    If (IsUpText('ine'))Then
    Begin
    Mouse(x,y,1,1,True);
    OresMined:=OresMined+1;
    End;
    End;


    Procedure DropIt;
    Begin
    DropTo(2,28);
    End;


    Procedure Report;
    Begin
    WriteLn('Thanks For Using -=My Happy go Gay Powerminer=-');
    WriteLn('Ores Mined And Dropped:' + IntToStr(OresMined) + '');
    End;


    Begin//Loop
    SetupSRL;
    Begin
    Repeat
    FindOre;
    Mine;
    Until(OresMined = OresToMine);
    If(OresMined = OresToMine)Then
    Report;
    Exit;
    TerminateScript;
    end;
    end.

    I tested it worked pretty well until got a random .


    I pretty much answered that here:
    http://www.srl-forums.com/forum/bigg...5.html?t=13905

    Here's your script with a few problems fixed:

    ScarScript: By Drunkenoldma
    //================================================== ======================//
    // -=My Happy go Gay Powerminer=- //
    //================================================== ======================//
    // By James //
    // Its Pretty much useless //
    // But it looks pretty //
    //================================================== ======================//
    program PowerMiner;
    {.include SRL/SRL.scar}
    var
    x, y, i: Integer;
    //===========================//Colors//===================================//
    const
    OreColor= 4879005;// Set the color of the Iron

    //===========================//Colors//===================================//
    procedure FindOre;
    begin
    Wait(100+random(200));
    if(FindColorTolerance(x,y,OreColor,0,0,600,600, 10)) then
    begin
    Writeln('Ore Found');
    end else
    end;

    procedure Mine;
    begin
    if(FindColor(x,y,OreColor,0,0,600,600,10)) then
    begin
    Wait(100+random(200));
    Mouse(x, y, 0, 0, true)
    Wait(800+random(200));
    end;
    end;


    //////////MAIN LOOP\\\\\\\\\\
    begin
    SetupSRL;
    i = 0
    FindOre;
    repeat
    Mine;
    i = i+1
    until(i>10)
    end.
    That wont work it gets an error, go and find it your self .
    Even If You Are On Your Way, You Will Get Run Over If You Just Sit There.
    -ILikePie1995.

    My Best Script I Yet Made, Go Check It Out, Its In The Fighting Section. Look For UndeadKiller!

    GET FREE CASH!!!READ ALL ABOUT IT!!!
    http://www.AdPaid.com/ptr/pages/join...d=ilikepie1995

    JOIN AdPaid.Com NOW!!!ITS OWNAGE!!!
    http://www.AdPaid.com/ptr/pages/conf...d=ilikepie1995

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. DTM/Loop Help
    By Championship in forum OSR Help
    Replies: 11
    Last Post: 12-17-2008, 01:08 AM
  2. Loop Help
    By yvw master in forum OSR Help
    Replies: 11
    Last Post: 10-13-2008, 03:39 AM
  3. For loop
    By rogeruk in forum OSR Help
    Replies: 8
    Last Post: 10-24-2007, 12:07 AM
  4. Replies: 10
    Last Post: 09-13-2007, 09:27 PM
  5. loop
    By macromacro123 in forum OSR Help
    Replies: 4
    Last Post: 03-18-2007, 07:50 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
  •