Results 1 to 7 of 7

Thread: How to start a script?

  1. #1
    Join Date
    Jul 2007
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default How to start a script?

    Well I have read ALOT of begginer guides and pretty much know all the functions and things. Now I want to create a simple script (like an evergreen cutter in catherby) or something. Now I have no clue how I would start the script and what to include in the script. Got any ideas?





  2. #2
    Join Date
    Aug 2006
    Posts
    408
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well if you looked at most SRL scripts they include
    SRL\srl.scar
    and sometimes a specific skill, in your case that would be the woodcutting include:
    {.include srl/srl/skill/woodcutting.scar}

    I recommend downloading other woodcutting scripts to look at as you work. For a first (or near that) script I wouldn't recommend having much walking. Look at how other script writers detect trees and chop them, and think about how you could do it most effectively.

    Inventory.scar, one of your scar include files in core, has different dropping procedures in it that you should look at.

  3. #3
    Join Date
    Jul 2007
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay well I just read a tut on how to get bitmaps and stuff and I did it all correctly but I get an error so i'm not sure how I can find the logs..

    My script is
    program new;
    {.include srl/srl.scar}

    var//means that these are variables
    x,y,Bitmap:integer;//x,y and ie are integers

    procedure DeclareBMPS;
    begin
    Bitmap := BitmapFromString2(False, 'aA1AB578DAED98D9728' +
    '42010457F89A6179C4706F5FF3F292C260341465C92B22AE1 E1D6' +
    '148A1EDBEEDB384A29D0A2FC988292D35EF939059D862F150 8F33' +
    '20425FD9A611BE7C97AD50385197641E770350907153B137E CF0F' +
    'AF46BB97F21C740A4759BD66640C33C662F82DCF78DF70FDF FF19' +
    '706BCD59BD26AEB6B6944A51D001A545E1D323069B430DC8D 7985' +
    'D3128225C1198645AF2787339A78589178CE44DBD22BC997F BA62' +
    '82D9AE29662584732452F9224DA1EBD941C04D8A21162870F 798A' +
    '46C74416C6427BD8EA55D5DA9C5C2B18E14CB582013138E7C A862' +
    '6ADBAF85BB40DCDC9D3BBFB11F2167FADF9F92DADC84F7BE3 0AB9' +
    '4CC23836F97B386B4DD912ABE374B4F7901FD32CC78A3C899 57EA' +
    '82B15AB6AF266E6ECE5CCDCBBF0ABA8FECC87768438A7BDDF 063F' +
    '141D21EA41E6AA726BDA42F3FBE6DEFEBD37ADBC057E3221A 54CA' +
    '8BB43912D0D6FCCDDBE8BAA76FBBA5E1ACF9EF32FBE1DC913 9B18' +
    '51585C39675E895B076D977376E4584E6E4446C23CAA2BE4B 11FF' +
    '1C882BCD1C17BA2DAE39F3DE4957BD4E4C573A5A7D8D96B76 7B7E' +
    '4FB6449E823CE54616EDDDDE7E5187DA208F116E91B71CE62 0F9A' +
    '51D2A55684DBEECB5AE8A79B797166E9FED4B1BDEFEB9338C F14F' +
    'BA549961856A473F3D567D514F7CE53557EDEE4A8DFD6407E 1C5D' +
    'F62AD98AF44BEDA75DFE01B19DE67CB6D3837F8F308DFFE3F 87F7' +
    '15F1ABE303122');
    end;

    procedure ClickBMPS;
    begin
    wait(300+random(32))
    movemousesmooth(x,y)
    wait(32+random(16))
    clickmouse(x,y,true)
    end;


    Procedure FindBMPS;
    begin
    if(FindBitmap(Bitmap,x,y))then
    ClickBMPS;
    end;

    begin
    repeat
    wait(1300)
    DeclareBMPS;
    FindBMPS;
    until(false)
    end.

    and the error is
    Line 5: [Error] (14454:1): Duplicate identifier 'x' in script

    I've tried taking the the {.include srl/srl.scar} out but then it says successfully compiled but it does not do anything.





  4. #4
    Join Date
    Jun 2007
    Location
    I'm not sure...
    Posts
    581
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    never use movemousesmooth. Use Mouse or MMouse (but you've gotta do {.include Srl/Srl.scar})

    Don't use bitmaps, use colors or DTMs, and what happens when you get a full inventory?
    ---------------------------------------------------------


    Pm me if you need any math functions made. Me = l0ving t3h mathz

    ---------------------------------------------------------

  5. #5
    Join Date
    Jul 2007
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well that bitmap isn't even part of the script i'm going to make. I just want to know that i'm doing everything right, so I don't really care how detectable it is right now anyway

    edit: nothing happens when I get a full inv, the script compiles but doesnt run.





  6. #6
    Join Date
    Oct 2006
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That wont work. If your looking for a bitmap of a tree it will be hard to find seeing as it is 3d and you would have to be in eexactly 1 position. try searching for a few different of the trees colors and then move your mouse over them the check if in the top left corner it says "Cut Tree" (whatever its meant to say) if not look for the color again in a different place. and by the way you need to a have a semicolon at the end of most lines. and you cant have the variables x and y. they are globals of SRL. just change them to something else like a and b or xx and yy. So here is your script free of errors:
    SCAR Code:
    program new;

    {.include srl/srl.scar}

    var  // means that these are variables
       xx,yy,Bitmap:integer;  // xx,yy and ie are integers

    procedure DeclareBMPS;
    begin
              Bitmap := BitmapFromString2(False, 'aA1AB578DAED98D9728' +
         '42010457F89A6179C4706F5FF3F292C260341465C92B22AE1 E1D6' +
         '148A1EDBEEDB384A29D0A2FC988292D35EF939059D862F150 8F33' +
         '20425FD9A611BE7C97AD50385197641E770350907153B137E CF0F' +
         'AF46BB97F21C740A4759BD66640C33C662F82DCF78DF70FDF FF19' +
         '706BCD59BD26AEB6B6944A51D001A545E1D323069B430DC8D 7985' +
         'D3128225C1198645AF2787339A78589178CE44DBD22BC997F BA62' +
         '82D9AE29662584732452F9224DA1EBD941C04D8A21162870F 798A' +
         '46C74416C6427BD8EA55D5DA9C5C2B18E14CB582013138E7C A862' +
         '6ADBAF85BB40DCDC9D3BBFB11F2167FADF9F92DADC84F7BE3 0AB9' +
         '4CC23836F97B386B4DD912ABE374B4F7901FD32CC78A3C899 57EA' +
         '82B15AB6AF266E6ECE5CCDCBBF0ABA8FECC87768438A7BDDF 063F' +
         '141D21EA41E6AA726BDA42F3FBE6DEFEBD37ADBC057E3221A 54CA' +
         '8BB43912D0D6FCCDDBE8BAA76FBBA5E1ACF9EF32FBE1DC913 9B18' +
         '51585C39675E895B076D977376E4584E6E4446C23CAA2BE4B 11FF' +
         '1C882BCD1C17BA2DAE39F3DE4957BD4E4C573A5A7D8D96B76 7B7E' +
         '4FB6449E823CE54616EDDDDE7E5187DA208F116E91B71CE62 0F9A' +
         '51D2A55684DBEECB5AE8A79B797166E9FED4B1BDEFEB9338C F14F' +
         'BA549961856A473F3D567D514F7CE53557EDEE4A8DFD6407E 1C5D' +
         'F62AD98AF44BEDA75DFE01B19DE67CB6D3837F8F308DFFE3F 87F7' +
         '15F1ABE303122');
    end;

    procedure ClickBMPS;
    begin
         // I changed the functions you used into better ones. But I left them commented incase
         // you still wanted them.

         // wait(300 + random(100));
         // movemousesmooth(xx, yy);
         // wait(200 + random(100));
         // clickmouse(xx, yy, true);
         Mouse(xx, yy, 10, 10, true); // It moves waits clicks etc. all in one.
    end;


    Procedure FindBMPS;
    begin
         if(FindBitmap(Bitmap,x,y))then
            ClickBMPS;
    end;

    begin
         repeat
               wait(4000 + random(1000));
               DeclareBMPS;
               FindBMPS;
         until(false)
    end.

    It may not work but that is impressive for a first script
    Good luck!

  7. #7
    Join Date
    Jul 2007
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    The bitmap is willow logs, not a tree.

    edit: by the way I didn't write the script myself, I followed a tut and what to exactly put in..

    edit2: that script doesn't work either
    Successfully compiled
    [Runtime Error] : Exception: data error in line 10 in script





Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 6
    Last Post: 06-03-2006, 09:32 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
  •