Results 1 to 6 of 6

Thread: Base Jump Script

  1. #1
    Join Date
    Nov 2007
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Base Jump Script

    Hey everyone I am new to SRL forums but I am not here just to leech, I wanna learn some scripting and need some help with a started script I have been challanged to make!

    The game this is used on is http://www.thorgaming.com/flasharcade/play-1104.html and what I need is for the space bar key to be pressed as soon as the words come up "Go", however the get ready and start words that come up before it are very similar so I have tried color tolerance but I can't seem to get it to hit space bar only when it says "Go". Please play the game quickly to get an idea what I mean! It works using sendkeys(' ') to press spacebar so it is the other aspects I need help with. Also once it hits space bar the first time I need it to stop as that is the same button used to deploy your parachute which must be done at exactly the right time and which I will do manually (unless you want to code that in too but it isn't needed).

    Please help me out with this as I really want to get making scripts to give back to the community!

    EDIT:

    Here is my code so far, no need to tell me its not good!

    SCAR Code:
    program BaseJump;
    var x,y: integer;
    begin

    repeat
    if FindColorTolerance(x,y,10719614,120,230,160,270,1)  then
    wait(100);
    sendkeys(' ');
    until (x = - 1)
    writeln('escaped');
    end.

    It just looks for the color and then once it finds it it just keeps hitting space bar! Lol please don't refer me to tuts as I just want to get this script going first before I go back to tutorials!

  2. #2
    Join Date
    Sep 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    The Solution

    I think I might be able to help ya...

    So, your script is like this:

    SCAR Code:
    program BaseJump;
      var x,y: integer;
    begin
      repeat
        if FindColorTolerance(x,y,10719614,120,230,160,270,1)  then
        wait(100);
        sendkeys(' ');
      until (x = - 1)
      writeln('escaped');
    end.

    Now, I would first set this thing up differently:

    SCAR Code:
    Prgramm BaseJump;
    var
      x,y: integer;
    const
      GoColor = 10719614  {named the color, easier to use}
    begin
      repeat
        wait(100)
      Until FindColorTolerance(x,y,10719614,120,230,160,270,1)
      {So the programm will wait until it finds the color}
      {Now, the Color was found, now it will press the space bar and write}
      SendKeys(' ')
      writeln('escaped')
    end.

    Now, do you see what I did here? I gave the color a name, so we don't have to put in all the numbers every time we use the color, even if it's only once (makes it look neater). Once it has found the color, it will immeadantly send the spacebar key, and write in the debug box "escaped".

    Alright, now, the Sendkeys(' ') is not a very good way to press the spacebar key, so let's use a proper srl function, but for that you will need to include: {.include srl/srl.scar}
    It will look like this:
    SCAR Code:
    Prgramm BaseJump;
    {.include srl/srl.scar} // This is very important, otherise you'll get some errors
    var
      x,y: integer;
    const
      GoColor = 10719614  
    begin
      repeat
        wait(100)
      Until FindColorTolerance(x,y,10719614,120,230,160,270,1)
      KeyDown(32);  // The better and more "proper" function
      writeln('escaped')
    end.

    Now you can also add on to that with the "wait" function or another loop like the one I created with finding color.

    Good Luck with your future Scripting,
    ToteRache

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

    Default

    SCAR Code:
    program New;

    var
      x, y, jump: Integer;

    procedure Go;
    begin
      repeat
        wait(10 + Random(10));
      until (GetColor(142, 244) = 12365986);
      KeyDown(32);
      wait(50 + Random(50));
      KeyUp(32);
      repeat
        wait(1 + Random(1));
      until (GetColor(114, 233) = 7695194)
        KeyDown(32);
      wait(50 + Random(100));
      KeyUp(32);
      jump := jump + 1;
      repeat
        wait(100 + Random(100));
      until (GetColor(259, 136) = 16777215) or (Jump = 3)
        if (jump = 3) then
      begin
        Writeln('Jump is on 3');
        repeat
          wait(100);
        until (GetColor(154, 261) = 16777215)
          if (GetColor(154, 261) = 16777215) then
        begin
          KeyDown(32);
          wait(50 + Random(100));
          KeyUp(32);
          repeat
            wait(100 + Random(100));
          until (GetColor(223, 175) = 13024684);
          KeyDown(32);
          wait(100 + Random(100));
          KeyUp(32)
          repeat
            wait(10 + Random(10));
          until (GetColor(121, 178) = 16777215);
          KeyDown(32);
          wait(100 + Random(200));
          KeyUp(32);
          Exit;
        end;
      end;
      KeyDown(32);
      wait(50 + Random(100));
      KeyUp(32);
    end;

    procedure start;
    begin
      if (GetColor(169, 43) = 14470576) then
      begin
        ClickMouse(295, 215, true);
        wait(300 + Random(200));
        ClickMouse(209, 182, true);
        wait(200 + Random(200));
        ClickMouse(335, 187, true);
        wait(300 + Random(300));
        ClickMouse(384, 163, true); //Easy Game
        //  ClickMouse(384,135,true); //Hard Game
        repeat
          wait(10 + Random(10));
        until (GetColor(210, 179) = 16777215);
        KeyDown(32);
        wait(100 + Random(200));
        KeyUp(32);
      end;
    end;

    begin
      Start;
      repeat
        Go;
      until (false);
    end.

    Work off that :P
    (Target and run when its on the first screen (where u click start but dont))

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

  4. #4
    Join Date
    Sep 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by rogeruk View Post
    SCAR Code:
    program New;

    var
      x, y, jump: Integer;

    procedure Go;
    begin
      repeat
        wait(10 + Random(10));
      until (GetColor(142, 244) = 12365986);
      KeyDown(32);
      wait(50 + Random(50));
      KeyUp(32);
      repeat
        wait(1 + Random(1));
      until (GetColor(114, 233) = 7695194)
        KeyDown(32);
      wait(50 + Random(100));
      KeyUp(32);
      jump := jump + 1;
      repeat
        wait(100 + Random(100));
      until (GetColor(259, 136) = 16777215) or (Jump = 3)
        if (jump = 3) then
      begin
        Writeln('Jump is on 3');
        repeat
          wait(100);
        until (GetColor(154, 261) = 16777215)
          if (GetColor(154, 261) = 16777215) then
        begin
          KeyDown(32);
          wait(50 + Random(100));
          KeyUp(32);
          repeat
            wait(100 + Random(100));
          until (GetColor(223, 175) = 13024684);
          KeyDown(32);
          wait(100 + Random(100));
          KeyUp(32)
          repeat
            wait(10 + Random(10));
          until (GetColor(121, 178) = 16777215);
          KeyDown(32);
          wait(100 + Random(200));
          KeyUp(32);
          Exit;
        end;
      end;
      KeyDown(32);
      wait(50 + Random(100));
      KeyUp(32);
    end;

    procedure start;
    begin
      if (GetColor(169, 43) = 14470576) then
      begin
        ClickMouse(295, 215, true);
        wait(300 + Random(200));
        ClickMouse(209, 182, true);
        wait(200 + Random(200));
        ClickMouse(335, 187, true);
        wait(300 + Random(300));
        ClickMouse(384, 163, true); //Easy Game
        //  ClickMouse(384,135,true); //Hard Game
        repeat
          wait(10 + Random(10));
        until (GetColor(210, 179) = 16777215);
        KeyDown(32);
        wait(100 + Random(200));
        KeyUp(32);
      end;
    end;

    begin
      Start;
      repeat
        Go;
      until (false);
    end.

    Work off that :P
    (Target and run when its on the first screen (where u click start but dont))
    Why do you make everything so complicated? lol

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

    Default

    Hows it complicated?. Please explain if you have any clue.

    It starts the game, by making sure that the "Press any key" is there, else thers no point in pressing space..

    And your so clever your help isnt even correct. KeyDown keeps the key down and you will instantly get a penatly in the game. Nice...

    Plus you dont need SRL to cheat a flash game.

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

  6. #6
    Join Date
    Nov 2007
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks to both of you so much! This has helped me a ton guys, im gonnna go continue on with some tutorials.

    You guys are awesome!!!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Error: Invalid jump in script.
    By Pancakes in forum OSR Help
    Replies: 2
    Last Post: 08-29-2007, 01:26 PM
  2. How to use MultiPlayer to base your script on
    By Killerdou in forum Outdated Tutorials
    Replies: 3
    Last Post: 08-07-2007, 09:24 PM
  3. Error: Invalid jump in script?
    By Pancakes in forum News and General
    Replies: 14
    Last Post: 07-29-2007, 01:45 PM
  4. Script Base
    By Kingofptw in forum OSR Help
    Replies: 8
    Last Post: 03-23-2007, 10:09 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
  •