Results 1 to 10 of 10

Thread: New to scripting-first script-please help

  1. #1
    Join Date
    Mar 2007
    Posts
    105
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default New to scripting-first script-please help

    Hi, i really want to become a scripter and today i made an attempt at trying my first script. i got it to do what it needs to do, chop a load of oaks then drop them and repeat. but it does it all by coords, and im not sure how to use colors instead. i think the coords might be clicking the same place over and over again and thats detectable. how do i make it click colors? once i get this problem down ill add antirandoms and antiban

    Heres my script so far, i will just post it since its only 25 lines:


    program Adamschopper;
    {.include SRL/SRL.scar}
    Procedure Chop;
    begin
    repeat
    MMouse(365,83,0,0);
    wait(100+random(50));
    Mouse(365,83,0,0,false);
    MMouse(341,110,0,0);
    wait(100+random(50))
    Mouse(341,110,0,0,true);
    wait(5000+random(300));
    until(InvFull);
    end;
    procedure Drop;
    begin
    DropALl;
    end;
    begin
    SetupSRL;
    repeat
    Chop;
    Drop;
    until(false);
    end.


    thanks for all the help!

  2. #2
    Join Date
    Mar 2007
    Location
    Under a rock
    Posts
    813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Use stuff like findcolor, dont use the mouse coords. Do a findcolor procedure, then a mouse(x,y,1,1,true), then a wait. There are many built in srl functions, use them to your advantage.

  3. #3
    Join Date
    Mar 2007
    Posts
    105
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    First id like to say thanks for the quick reply, i appreciate it.

    The problem is i don't understand Findcolor.

    begin
    repeat
    if(FindColor(x,y,color,coords,coords,coords,coords ))then
    MMouse(x,y,0,0);
    wait(100+random(50));
    Mouse(x,y,0,0,true);
    until(false);
    end;

    Whats the coords,coords,coords,coords. at the end? and what exactly do i put in the "x,y,color" in FindColor(x,y,color,coords,coords,coords,coords)) please try to be simple and try to explain it to someone who just started learning this 2 days ago

  4. #4
    Join Date
    Jun 2006
    Location
    New Zealand
    Posts
    285
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Try a simple color finding technique like:
    SCAR Code:
    if(findcolor(a, b, 12345, MSX1, MSY1, MSX2, MSY2)) then
    Mouse(x, y, 2, 2, true);
    That will look for the color 12345 in the main screen, store the x, y co-ords in the variables "a" and "b" ("a" stores the x pos, "b" stores the y pos) and then click it.
    Huehuehuehuehue

  5. #5
    Join Date
    Mar 2007
    Posts
    105
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    That clicks on the top corner of rs window no matter what color i put in 12345. im totally newb at this stuff thanks.

  6. #6
    Join Date
    Mar 2007
    Location
    Under a rock
    Posts
    813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Best thing to do i think is look at other peoples scripts, preferably the basic ones, and see how they use functions and what they use them for. Look through some powershoppers in the free scripts section and see what they do.

  7. #7
    Join Date
    Mar 2007
    Posts
    105
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanks ill do that thanks for all your help

  8. #8
    Join Date
    Apr 2007
    Location
    Finland
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If i can say something to this is coords thing it would be this

    The first 2 coords mean top left and the second ones mean bottom right. And think of it like a box in a box (h)

    Found a picture here: http://www.villavu.com/forum/showthread.php?t=8605
    2nd post

  9. #9
    Join Date
    Jan 2007
    Location
    Skaville, Jamaica
    Posts
    1,117
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Rune Hacker View Post
    Best thing to do i think is look at other peoples scripts, preferably the basic ones, and see how they use functions and what they use them for. Look through some powershoppers in the free scripts section and see what they do.
    A Powershopper? Sounds like something I'd get my girlfriend .

    Anyway, that image he was talking about



    It basically means, that the first 2 coords will set where the colors can't go outside of at the top. Same with the last 2, but at the bottom. It works sorta like this. Open paint, choose the rectangle tool. Now, let's say for your first 2 coords, you had 0,0. Click 0,0 and hold it down. For the last two, let's say 500,500. Drag your mouse down to 500,500 and let go. That's the box that SCAR would look in for the color.

  10. #10
    Join Date
    Mar 2007
    Posts
    276
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i would also recommend Spacing your lines so it is easier to read

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Scripting Help
    By Simtoon in forum OSR Help
    Replies: 0
    Last Post: 10-22-2008, 08:02 AM
  2. Looking for script requests and a scripting partner
    By Raskolnikov in forum RS3 Outdated / Broken Scripts
    Replies: 1
    Last Post: 06-30-2008, 12:01 PM
  3. Scripting Help: My first script :)
    By Macho Man67 in forum OSR Help
    Replies: 9
    Last Post: 05-15-2007, 06:43 PM
  4. Scripting Help(first script)Im a noob
    By Macho Man67 in forum OSR Help
    Replies: 1
    Last Post: 03-15-2007, 03:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •