Results 1 to 23 of 23

Thread: Money Collector

  1. #1
    Join Date
    Sep 2007
    Location
    Australia, NSW
    Posts
    934
    Mentioned
    6 Post(s)
    Quoted
    145 Post(s)

    Default Money Collector

    This is my first ever script, i just started sripting today-its fun!!

    I know there is heaps of stuff wrong with it.. lyk antibanner and stuff lyk that.its very basic. can ppl see wat i should do to make it better.. THANX

    SCAR Code:
    program MoneyCollector;

    var
    x,y: Integer;

    const
     MoneyColour       =1544883;    //coin colour
     
    procedure FindCoins;
     begin
      if(FindColor(x,y,MoneyColour,0,0,515,335)) then
       begin
         Writeln('Found Coins... Yay!');
         MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
         ClickMouse(x,y,true);
         Wait(5000+random(1000));
       end;
     end;
     
     begin
      repeat
       ClearDebug;
       FindCoins;
      until(false);
     end.

  2. #2
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Suggustion

    Include srl commands as they are not detectable and don't use any of these

    SCAR Code:
    SendKeys
    MoveMouse
    ClickMouse

    And for the mouse put {.include srl/srl.scar} at top and put mouse(x, y, 3, 4, true); for where you want to click. if you need help feel free to post here.

    So a fixed version =

    SCAR Code:
    program MoneyCollector;
    {.include srl/srl.scar}

    var
    x,y: Integer;

    const
     MoneyColour       =1544883;    //coin colour
     
    procedure FindCoins;
     begin
      if(FindColor(x,y,MoneyColour,0,0,515,335)) then
       begin
         Writeln('Found Coins... Yay!');
    mouse(x, y, 3, 3, true);
         Wait(5000+random(1000));
       end;
     end;
     
     begin
       ClearDebug;
       FindCoins;
     end.

  3. #3
    Join Date
    Jun 2007
    Posts
    785
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program MoneyCollector;
    {.include srl/srl.scar}

    var
    x,y: Integer;

    const
     MoneyColour       =1544883;    //coin colour

    procedure FindCoins;
     begin
      if(FindColor(x,y,MoneyColour,0,0,515,335)) then
       begin
         Writeln('Found Coins... Yay!');
         Mmouse(x, y, 2, 2);
         ChooseOption('ic');   // right mouse, picks it up
         Flag; // waits untill they flax on the minimap is gone.
       end;
     end;

     begin
       ClearDebug;
       FindCoins;
     end.


    just to make it a little nicer and faster

    [22:20] <[-jesus-]> freddy, go uninstall yourself

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

    Default

    SCAR Code:
    program MoneyCollector;
    {.include srl/srl.scar}
     
    var
    x,y: Integer;
     
    const
     MoneyColour       =1544883;    //coin colour
     
    procedure FindCoins;
     begin
      if(FindColor(x,y,MoneyColour,0,0,515,335)) then
       begin
         Writeln('Found Coins... Yay!');
         Mmouse(x, y, 2, 2,false); //Needs false indicator for right click?
         ChooseOption('ic');   // right mouse, picks it up
         Flag; // waits untill the flag on the minimap is gone.
         Wait(10000+random(5000));
       end;
     end;
     
     begin
       ClearDebug;
       repeat
       FindCoins;
       Until(false) //Anyone know how to make infinite loop? I know how to do using variables that never change, but, Im sure there is a better way.
     end.

    Now it loops, checking every 15 seconds for more coins to pickup!

  5. #5
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Dumpin - Yours doesn't work as you use MMouse which only moves it, so won't right click making ChooseOption useless.
    Bloodargon - Yours will get an invalid number of variables error as you use MMouse and then put false at the end. You guys should check more carefully
    Anyway, on how to improve it, like others said, you should use SRL functions intsead of MoveMouse/Smooth and ClickMouse.
    MMouse(x, y, RandX, RandY: Integer); - Will move the mouse to position x,y, with each added a random value between -RandX/Y and + RandX/Y. E.g. if you put MMouse(10,10,5,5), then it could move the mouse to any position inbetween 5,5 and 15,15.
    Mouse(x, y, RandX, RandY: Integer; LeftClick: Boolean); - Will move the mosue (using MMouse) then click. It will left click if the LeftClick boolean is True while right click if it's False.
    Also, instead of using FindColor, you may want to use FindColorTolerance, which means it will also find colours slightly different to the colour you specify depending on what you use the tolerance as. 5-15 is normally used, though as it's yellow andnot much else in RS is yellow, you could probably get away with a higher tolerance. To specify the tolerance, just add another integer variable onto the end of FindColor (so after the last variable inside the parenthesis) and change FindColor to FindColorTolerance.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  6. #6
    Join Date
    Sep 2007
    Location
    Australia, NSW
    Posts
    934
    Mentioned
    6 Post(s)
    Quoted
    145 Post(s)

    Default

    THANKYOU GUYS SOO MUCH!!! you helped me heaps!
    ..oh...one more thing...how can i tally up how many time it finds some coins??

  7. #7
    Join Date
    Nov 2007
    Location
    Poland
    Posts
    139
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program MoneyCollector;
    {.include srl/srl.scar}
     
    var
    x,y,coins: Integer;
     
    const
     MoneyColour       =1544883;    //coin colour
     
    procedure FindCoins;
     begin
      if(FindColor(x,y,MoneyColour,0,0,515,335)) then
       begin
         Writeln('Found Coins... Yay!');
         coins := coins + 1;
         Mmouse(x, y, 2, 2,false); //Needs false indicator for right click?
         ChooseOption('ic');   // right mouse, picks it up
         Flag; // waits untill the flag on the minimap is gone.
         Wait(10000+random(5000));
       end;
     end;
     
     begin
       SetUpSRL;
       ClearDebug;
       repeat
         FindCoins;
       Until (false); //Anyone know how to make infinite loop? I know how to do using variables that never change, but, Im sure there is a better way.
      WriteLn('Money taken ' + IntToStr(coins) + ' time[s]');
     end.

  8. #8
    Join Date
    Sep 2007
    Location
    Australia, NSW
    Posts
    934
    Mentioned
    6 Post(s)
    Quoted
    145 Post(s)

    Default

    thanx iroki for that lil update=]

    sry mixster i didnt quite understand how to use the Mouse(x, y, RandX, RandY: Integer; LeftClick: Boolean);
    when i put it in, it came up with an error..if someone could put them in my script for me i would very much appreciate it so i can understand it easier.

    this is now my updated script:
    any more suggestions or mistakes??

    SCAR Code:
    program MoneyCollector;
    {.include srl/srl.scar}

    var
    x,y,coins,CoinFound: Integer;

    const
     MoneyColour       =1479090;    //coin colour
     
    procedure FindCoins;
     begin
      if(FindColorTolerance(x,y,MoneyColour, msx1, msy1, msx2, msy2, 5)) then
       begin
         Writeln('Found Coins... Yay!');
         coins := coins + 1;
         Mouse(x, y, 3, 3, false);
         ChooseOption('ake');
         Flag;
         Wait(5000+random(1000));
         CoinFound:=1;
       end else
         CoinFound:=0;
     end;

  9. #9
    Join Date
    Sep 2007
    Posts
    501
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    Mouse(x, y, 3, 3, false);
         if(ChooseOption('ake'))then
           coins := coins + 1;

  10. #10
    Join Date
    Sep 2007
    Location
    Australia, NSW
    Posts
    934
    Mentioned
    6 Post(s)
    Quoted
    145 Post(s)

    Default

    oh yess!! thanx kokouko
    good idea to add up the coins AFTER it get them =] =]

    now...update 2:

    SCAR Code:
    program MoneyCollector;
    {.include srl/srl.scar}

    var
    x,y,coins,CoinFound: Integer;

    const
     MoneyColour       =1479090;    //coin colour
     InventoryMoney    =1545912;    //colour of coin from inventory
     
    procedure FindCoins;
     begin
      if(FindColorTolerance(x,y,MoneyColour, msx1, msy1, msx2, msy2, 5)) then
       begin
         Mouse(x, y, 3, 3, false);
         if(ChooseOption('ake')) then
          begin
          coins := coins + 1;
          CoinFound:=1;
          end;
         Flag;
         Wait(5000+random(1000));
       end else
         CoinFound:=0;
     end;
     
    procedure StayLoggedIn;
    begin
     if(FindColorTolerance(x,y,MoneyColour,mix1, miy1, mix2, miy2,5)) then
     begin
       Mouse(x,y,3,3, true);
       Mouse(x,y,3,3, true);
     end;
    end;
     
    begin
     SetUpSRL;
     ClearDebug;
     repeat
      FindCoins;
      StayLoggedIn;
      if(CoinFound=1) then
       begin
       Writeln('We took money ' + IntToStr(coins) + ' time[s]!');
       end;
     until(false);
    end.

    TRY IT OUT >> SEE HOW IT GOES =]

  11. #11
    Join Date
    Jan 2008
    Location
    Alberta
    Posts
    727
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Use

    SCAR Code:
    FFlag(0);
    Its the same as Flag; but failsafe, and you can also change 0 to the amount of pixels you want to reach before doing something else.

    To find your exact amount of coins you could do this:
    SCAR Code:
    coins := CoinAmount('inv');

    For your Stay Logged In thing, you could mark time and make it do it every so often with a random amount added like this:
    SCAR Code:
    procedure StayLoggedIn;
    begin
      if(FindColorTolerance(x, y, InventoryMoney, mix1, miy1, mix2, miy2, 5)) then
      if (TimeFromMark(MarkedTime) > 30000 + Random(10000)) then
      begin
        Mouse(x, y, 3, 3, true);
        Mouse(x, y, 3, 3, true);
        MarkTime(MarkedTime);
      end;
    end;

    And making your loop this:
    SCAR Code:
    begin
     SetUpSRL;
     ClearDebug;
     MarkTime(MarkedTime);
     repeat
       FindCoins;
       StayLoggedIn;
       if(CoinFound=1) then
       begin
         Writeln('We took money ' + IntToStr(coins) + ' time[s]!');
       end;
     until(false);
    end.

    And you missed some standards, fixed most of your standards here:
    SCAR Code:
    program MoneyCollector;
    {.include srl/srl.scar}

    var
      x, y, coins, CoinFound, MarkedTime: Integer;

    const
      MoneyColour       = 1479090;    //coin colour
      InventoryMoney    = 1545912;    //colour of coin from inventory

    procedure FindCoins;
    begin
      if(FindColorTolerance(x,y,MoneyColour, msx1, msy1, msx2, msy2, 5)) then
      begin
        Mouse(x, y, 3, 3, false);
        if(ChooseOption('ake')) then
        begin
          coins := coins + 1;
          CoinFound:=1;
        end;
        FFlag(0);
        Wait(5000+random(1000));
      end else
      CoinFound:=0;
     end;

    procedure StayLoggedIn;
    begin
      if(FindColorTolerance(x, y, InventoryMoney, mix1, miy1, mix2, miy2, 5)) then
      if (TimeFromMark(MarkedTime) > 30000 + Random(10000)) then
      begin
        Mouse(x, y, 3, 3, true);
        Mouse(x, y, 3, 3, true);
        MarkTime(MarkedTime);
      end;
    end;

    begin
     SetUpSRL;
     ClearDebug;
     MarkTime(MarkedTime);
     repeat
       FindCoins;
       StayLoggedIn;
       if(CoinFound=1) then
       begin
         Writeln('We took money ' + IntToStr(coins) + ' time[s]!');
       end;
     until(false);
    end.

    For a update maybe you could make it log in? (Using DeclarePlayers and SRL's logging in).

  12. #12
    Join Date
    Sep 2007
    Location
    Australia, NSW
    Posts
    934
    Mentioned
    6 Post(s)
    Quoted
    145 Post(s)

    Default

    I have 2 problems...
    -when i run it, it compiles properly but when i pick up a coin it says PROBLEM: inv interface not open
    We have 0 coin[s]!

    -what does if (TimeFromMark(MarkedTime) > 30000 + Random(10000)) then and MarkTime(MarkedTime); do?? Overall what does the MarkedTime thing do?

  13. #13
    Join Date
    Jan 2008
    Location
    Alberta
    Posts
    727
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    MarkTime starts counting a time. TimeFromMark will see what that time is on the MarkedTime, and if it is greater or > than a certain time for in this instance 30000 milliseconds plus a random 10000 milliseconds. So it will wait until somewhere between 30 and 40 seconds.

    MarkedTime is just a integer, you can change it if you want.

    For your 1st problem, make sure you were on your inventory tab. If you want the script to do that for you do this:
    SCAR Code:
    GameTab(4);

  14. #14
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    add antiban

  15. #15
    Join Date
    Aug 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    your going to have to collect a lot of coins for this to be of much use

  16. #16
    Join Date
    Dec 2007
    Location
    Wizzup?'s boat
    Posts
    1,013
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    t....h....i.....s.........w......o....u....l....d. ..........b.......e...............s......o........ ......s......l....o.....w.......

    but good work on contributing to the site
    make sure you listen to all the suggestions from other users
    Project: Welcome To Rainbow

  17. #17
    Join Date
    Apr 2008
    Posts
    22
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol, poor ppl can use this , other than that good script for ur first, im still trying to learn how to make one myself

  18. #18
    Join Date
    Oct 2007
    Location
    California
    Posts
    153
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)
    add some anti randoms, failsafes, and SMART, and you got yourself a pretty good script!

  19. #19
    Join Date
    May 2008
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yes post up is right mabye add tha

  20. #20
    Join Date
    May 2008
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yes post up is right mabye add tha

  21. #21
    Join Date
    May 2008
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i dont know this theme but is nice !!!

  22. #22
    Join Date
    May 2008
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    make a click in my signature and help em to become a member =)=)

  23. #23
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by gandulfin View Post
    make a click in my signature and help em to become a member =)=)
    Spam, and against rules. Ban?

    On topic; decent script, make some failsafes, and also just test it. Read the srl manual to find useful functions etc.

    Nava2
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help With My Coin Collector!
    By Craig- in forum OSR Help
    Replies: 11
    Last Post: 11-10-2007, 02:15 PM
  2. swamp tar collector
    By Jakkle in forum RS3 Outdated / Broken Scripts
    Replies: 4
    Last Post: 10-04-2007, 09:23 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
  •