Results 1 to 23 of 23

Thread: repeat command

  1. #1
    Join Date
    Oct 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default repeat command

    How can i set scar to repeat the command 50 times?

  2. #2
    Join Date
    Dec 2007
    Location
    Somewhere in Idaho
    Posts
    480
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    what command?

    something like this will work

    SCAR Code:
    procedure repeatStuff();
    var
    i : integer;
    begin
      i := 0;
      repeat
      begin
        command(stuff);
        i := i + 1;
      end
      until i >= 50
    end

  3. #3
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Find a tutorial about loops
    SCAR Code:
    repeat
      Inc(N);
      DoStuff;
    until(N = 50)

    I suggest this:
    for N := 1 to 50 do
      DoStuff;

  4. #4
    Join Date
    Oct 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    How do I enter code in forums?

  5. #5
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by cdr View Post
    How do I enter code in forums?
    Like using code tags?

    Example, put a code tag [code] to open it, and then another closing code tag [\code] to close it. Just make it a forward slash instead of back slash for it to work like this:

    Code:
    hi
    You could also try a [scar] tag.

  6. #6
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    You have to do [ code]stuff here[ /code] without any spaces in the brackets.

    ~Camo

    Edit: Ninja'd by JAD :/
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  7. #7
    Join Date
    Oct 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    program fishy;
    var
    
    i,x,y: Integer;
    
    const
    
    FishColor1 =11765872;
    FishColor2 =11765872;
    FishColor3 =11765872;
    
    begin
    i:= 0;
    repeat
    
     if (FindColorSpiral(x,y,FishColor1,205,219,305,277))
     or (FindColorSpiral(x,y,FishColor2,248,229,275,249))
     or (FindColorSpiral(x,y,FishColor3,248,229,275,249)) then
      begin
        MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
        Wait(123+random(10));
        ClickMouse(x,y,true);
        wait(2000); {how many second you want to wait between each click}
      end;
    until i = 1;
    end.
    procedure move;
    MoveMouseSmooth(457,43)
    end.
    this won't stop clicking..

  8. #8
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by cdr View Post
    Code:
    program fishy;
    {.include SRL/SRL.scar}
    var
    
    i,x,y: Integer;
    
    const
    
    FishColor1 =11765872;
    FishColor2 =11765872;
    FishColor3 =11765872;
    
    begin
    i:= 0;
    repeat
    
     if (FindColorSpiral(x,y,FishColor1,205,219,305,277))
     or (FindColorSpiral(x,y,FishColor2,248,229,275,249))
     or (FindColorSpiral(x,y,FishColor3,248,229,275,249)) then
      begin
        MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
        Wait(123+random(10));
        ClickMouse(x,y,true);
        wait(2000); {how many second you want to wait between each click}
        inc(i);
      end;
    until i = 1; //change 1 to 50 if you want it to click that many times
    end;
    
    procedure move;
    MoveMouseSmooth(457,43);
    end;
    Fixed I think...

    Add SetupSRL; in your main thingy.

    A little while since I coded, I think I got everything right though.

  9. #9
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Something like this?
    SCAR Code:
    program fishy;
    {.include SRL/SRL.scar}

    var
      i,x,y: Integer;

    const
      FishColor1 =11765872;
      FishColor2 =11765872;
      FishColor3 =11765872;

    procedure MoveTheMouse;
    begin
      i:= 0;
      repeat
        if (FindColorSpiral(x,y,FishColor1,205,219,305,277)) or (FindColorSpiral(x,y,FishColor2,248,229,275,249)) or (FindColorSpiral(x,y,FishColor3,248,229,275,249)) then
        begin
          MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
          Wait(123+random(10));
          ClickMouse(x,y,true);
          wait(2000); {how many second you want to wait between each click}
          Inc(i);
        end;
      until i = 1;
      MoveMouseSmooth(457,43);
    end;

    begin
      MoveTheMouse;
    end.

    ~Camo

    Edit: Ninja'd again :/
    Last edited by Kyle Undefined; 10-19-2009 at 05:27 PM. Reason: Forgot a semicolon :/
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  10. #10
    Join Date
    Oct 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay that works when i change the semicolon to dot after end
    Code:
    until i = 2;
    end;
    how to change that cuz id like to go on with my script
    Line 27: [Error] (27:4): period ('.') expected in script

    Also do I need to include the srl stuff? It threw another script here and do I need SRL for
    rsc? Also gave me another error in that script
    Last edited by cdr; 10-19-2009 at 05:15 PM.

  11. #11
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Are you using Dervish's? Try mine, it should work.

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  12. #12
    Join Date
    Oct 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nope. Math.scar starts and this1 says
    Line 47: [Error] (321:11): Unknown identifier 'CreateTPAFromBMP' in script

  13. #13
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Hmm, it compiled just fine for me. Try changing:
    SCAR Code:
    MoveMouseSmooth(457,43)

    to

    SCAR Code:
    MoveMouseSmooth(457,43);

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  14. #14
    Join Date
    Oct 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It worked for you using {srl ... }?????

  15. #15
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Yeah, I just ran it and it ran fine. It didn't click anything since it couldn't find the colors.

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  16. #16
    Join Date
    Oct 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    okay mine started working without the srl thing too so im moving on..
    Code:
    MoveMouseSmooth(457,43);
      wait(10000)
      MoveMouseSmooth(495,142)
      ClickMouse(x,y,true);
    Only moves to the first coordinates, then waits and executes the script.

  17. #17
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    SCAR Code:
    MoveMouseSmooth(457,43);
      wait(10000);
      MoveMouseSmooth(495,142);
      ClickMouse(x,y,true);


    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  18. #18
    Join Date
    Oct 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Unfortunately that doesn't work :/ Is it about the SRL. Is it really that much needed even in rsc?

  19. #19
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by Camo Developer View Post
    Are you using Dervish's? Try mine, it should work.

    ~Camo
    -.-

    Quote Originally Posted by cdr View Post
    Nope. Math.scar starts and this1 says
    Line 47: [Error] (321:11): Unknown identifier 'CreateTPAFromBMP' in script
    Update SRL correctly. Plenty of guides on it.

  20. #20
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Lol, nothing against you Dervish, the fix you posted wasn't right :/ I still <3 you :P

    @cdr. Are you using the {.include SRL/SRL.scar}?

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  21. #21
    Join Date
    Oct 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well i tryed using it now i updated SRL and still get another script tab saying global.script or math.script or whatever.. so I gave up :/
    Line 13: [Error] (40:1): Identifier expected in script C:\Program Files (x86)\SCAR 3.21\includes\SRL\SRL\Core\Globals.scar
    Last edited by cdr; 10-19-2009 at 06:14 PM.

  22. #22
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by cdr View Post
    Well i tryed using it now i updated SRL and still get another script tab saying global.script or math.script or whatever.. so I gave up :/
    Line 13: [Error] (40:1): Identifier expected in script C:\Program Files (x86)\SCAR 3.21\includes\SRL\SRL\Core\Globals.scar
    Update to the latest SRL SVN

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  23. #23
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    And dont forget to move those plugins!
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

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
  •