Results 1 to 13 of 13

Thread: Making a easy script!

  1. #1
    Join Date
    Jan 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Making a easy script!

    Hi

    I've recently learned the basics commands with Scar Divi. And I've made script which moves, clicks, writes and so on. (The basics)

    But now I need to create a more advanced script.

    The script will do this:
    -Click the certain place on the screen
    -Put in a certain number
    -Click on a button
    -The react if i've won or not. (This picture comes up if I've won)
    -Then increase the number by 3x if I didn't win. And start over again if I've won
    -And hopefully be able to repeat itself forever


    After searching a little bit through the forums I came up with this as my best shot. And of course, it's probably totaly wrong

    But anyway here it is :
    SCAR Code:
    program KMHelp;

    var
    x,y: Integer;

    Begin //This will detect if i've won or not
     if(FindColor(545, 292, 39168, 0, 0, 799, 1279)) then
     begin
      MoveMouseSmooth(592,364);
      Wait(100+random(200));
      ClickMouse(592,364, true);
      SendKeys('100'+chr(13));
        end else //This is suppose to take the amount of 100x3 on the next bet
        MoveMouseSmooth(615,322);
        Wait(100+random(175));
        ClickMouse(615,322,true);
        Writeln('100'+ IntToStr(*3));
        end;
    end.

    I've used FindColor. Cause that's what I've tried before :P

    Now I'll sit down and hope that someone will help me

    Regards Ove

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

    Default

    Its wrong in some places... Fixed up

    Welcome to SRL-Forums BTW, will edit this post with the fixed script .

    SCAR Code:
    program KMHelp;

    var
    x,y: Integer;

    Procedure DetectWin;
    begin
      If FindColor(x,y,39168,0,0,799,1279) then
      begin
        ClickMouseSpline(592,364,5,5,true);
        Wait(100+random(200));
        SendKeys('100'+chr(13));
      end else
      begin
        ClickMouseSpline(615,322,5,5,true);
        Wait(100+random(200));
        SendKeys('300');
      end;
    end;

    Begin
      DetectWin;
    end.

    I believe this is what you want , if not then tell me more in detail .

  3. #3
    Join Date
    Jan 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you I'm starting to get into scripting

    Well, that script du made only clicked the button.
    And as i understood, it would only tripple the amount once. What I'm looking for, is a script were it multiply the amount untill i win. I guess that's maybe hard to make. But I'm sure it possible

    I'll show you a couple of pictures.

    1. This is the main layout on the page I want the script to work on.


    2. This is how it look if I've won.


    Maybe this would help you helping me


    Regards -Ove

  4. #4
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Not exactly. Just use a for to do loop to increase it by three
    SCAR Code:
    For i := 0 to Times Do
      Amount := Amount + 3;


  5. #5
    Join Date
    Jan 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okey.

    But since the noob i am. I have no idea how to do it. Never used that type of loop before.

    Someone wanna place it in for me ? =)

    SCAR Code:
    program KMHelp;

    var
    x,y: Integer;

    For i := 0 to Times Do
    Amount := Amount * 3;

    Procedure DetectWin;
    begin
      If FindColor(x,y,39168,0,0,799,1279) then
      begin
        ClickMouseSpline(592,364,5,5,true);
        Wait(100+random(200));
        SendKeys('100'+chr(13));
      end else
      begin
        ClickMouseSpline(615,322,5,5,true);
        Wait(100+random(200));
        SendKeys('300');
      end;
    end;
     
    Begin
      DetectWin;
    end.

    This is my best shot. Changed it to * Cause that's multiply as i've understood

  6. #6
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program KMHelp;

    var
      x, y, Amount: Integer;

    Procedure DetectWin;
    begin
      If FindColor(x,y,39168,0,0,799,1279) then
      begin
        Amount := 100;
        ClickMouseSpline(592,364,5,5,true);
        Wait(100+random(200));
        SendKeys(inttostr(amount)+chr(13));
      end else
      begin
        ClickMouseSpline(615,322,5,5,true);
        Wait(100+random(200));
        Amount := Amount * 3;
        SendKeys(inttostr(amount));
      end;
    end;

    Begin
      Amount := 100;
      DetectWin;
    end.

    Using a variable to store the amount makes it a lot easier, as you can just change the first one. Not sure if that's what you wanted, but take a look at it .

    ~Sandstorm

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

    Default

    SCAR Code:
    program KMHelp;

    var
      x, y, Amount: Integer;

    Procedure DetectWin;
    begin
    repeat
    begin
      If FindColor(x,y,39168,0,0,863,1151) then
      begin
        Amount := 100;
        ClickMouseSpline(570,372,5,5,true);
        Wait(100+random(200));
        SendKeys(inttostr(amount)+chr(13));
      end else
      begin
        ClickMouseSpline(598,333,5,5,true);
        Wait(100+random(200));
        Amount := Amount * 3;
        SendKeys(inttostr(amount)+chr(13));
      end;
    end;
    until(false)
    end;
    Begin
      Amount := 100;
      DetectWin;

    end.

    This is an updated script.

    And it works!!!
    Thanks alot for all the help!

    Kindest Regards - Ove

  8. #8
    Join Date
    Jan 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I did now notice some other problem.
    My internet laggs sometimes. I think it's my router. Since it happends every 10min or so.

    I'm just wondering if i could make the bot detecting that. So it could stop for 60 seconds and refresh the page

    Any suggestions?
    I use Mozilla FireFox

    Ôvê

  9. #9
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    idk about detecting it but you could make scar click the refresh button at top of page with ClickMouse....

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

    Default

    Well, that won't work.

    You see, my FireFox is trying to load the page, but it looses the connection for about 20-50 sec. So pressing the refresh button won't have any effect.
    And that results that the bot will write a higher and higher number.

    It will go like this : 300900180054000 ect. Just continous multiply the number by 3. That's results in the end to a stop

    The reason that the bot stops then, is that when i finally manage to load the page. It will write a too high number like 133541465735213412 or something And i won't be able to Gamble that much.

  11. #11
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Do something like this:

    SCAR Code:
    program KMHelp;

    var
      x, y, Amount: Integer;

    Procedure DetectWin;
    begin
      repeat
        If GetColor(X coord, Y coord) = Color at coords Then
        begin
          If FindColor(x,y,39168,0,0,863,1151) then
          begin
            Amount := 100;
            ClickMouseSpline(570,372,5,5,true);
            Wait(100+random(200));
            SendKeys(inttostr(amount)+chr(13));
          end else
          begin
            ClickMouseSpline(598,333,5,5,true);
            Wait(100+random(200));
            Amount := Amount * 3;
            SendKeys(inttostr(amount)+chr(13));
          end;
        end else
          wait(1);
      until(false)
    end;

    Begin
      Amount := 100;
      DetectWin;
    end.

    Change the coordinates and the colors with something that is static. It will then only run if it finds that color.

    ~Sandstorm

  12. #12
    Join Date
    Jan 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I got to say i didn't really understand what you meant.

    But here's an example of the only thing that's different when it's searching a page :


    Before and after.
    I could use that color on the "Page picture" before it says loading. So the script won't continue without it.

    Here the cords and color of that "Page picture"
    Color Picked: 14934495 at (19, 126)

    SCAR Code:
    program KMHelp;

    var
      x, y, Amount: Integer;

    Procedure DetectWin;
    begin
      repeat
        If GetColor(19,126) = 14934495 then
        begin
          If FindColor(x,y,39168,0,0,863,1151) then
          begin
            Amount := 100;
            ClickMouseSpline(570,372,5,5,true);
            Wait(100+random(200));
            SendKeys(inttostr(amount)+chr(13));
          end else
          begin
            ClickMouseSpline(598,333,5,5,true);
            Wait(100+random(200));
            Amount := Amount * 3;
            SendKeys(inttostr(amount)+chr(13));
          end;
        end else
          wait(1);
      until(false)
    end;

    Begin
      Amount := 100;
      DetectWin;
    end.

    After a little bit failing and trying, i finally understood what you meant^^
    Haven't gotten to test it yet, but will when i first have the chance! Thanks for the help!

  13. #13
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No problem ^.^.

    ~Sandstorm

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Which is easy for my first script
    By brent8900 in forum News and General
    Replies: 10
    Last Post: 08-04-2008, 04:16 AM
  2. Need a script [Should be easy]
    By Dascooby in forum OSR Help
    Replies: 2
    Last Post: 07-13-2008, 11:50 AM
  3. Very Easy(?) script
    By igotgrapes in forum RS3 Outdated / Broken Scripts
    Replies: 7
    Last Post: 04-08-2008, 04:27 PM
  4. Easy Script
    By marsh in forum RS3 Outdated / Broken Scripts
    Replies: 12
    Last Post: 04-09-2007, 03:26 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
  •