Results 1 to 3 of 3

Thread: Help with First Script

  1. #1
    Join Date
    Aug 2006
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Help with First Script

    i recently took the beginners tutorial on how to make a script. i have made a few procedures (like loggin, and mining) but i cant seem to fit them all together. heres a section of the script, if doesnt play the 'mine' procedure. can someone plz fix up the script so it plays both procedures, thanks.

    program PowerMiner;

    var
    x,y: Integer;

    const
    IronColor= 5263446;// Set the color of the Iron

    procedure FindIron;
    begin
    Wait(100+random(200));
    if(FindColorSpiral(x,y,IronColor,0,0,600,600)) then
    begin
    Writeln('Iron Found');
    end else
    Writeln('Did not find Iron');
    end;

    procedure Mine;
    begin
    if(FindColor(x,y,IronColor,0,0,100,100)) then
    begin
    MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
    Wait(100+random(10));
    ClickMouse(x,y,true);
    end;
    end;

    begin//Loop
    FindIron;
    Mine;
    Mine;
    Mine;
    end.

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

    Default

    Well you should try including SRL after you say the program name by doing this:
    SCAR Code:
    {.include SRL/SRL.scar}

    Then instead of using MoveMouseSmooth and ClickMouse all you have to use is "Mouse". Use it like this:
    Mouse(xcoordinate, ycoordinate, randomx, randomy, trueorfalse). Make it true to left click, false to right click.

    You're mining procedure only finds the rock if it's color exactly matches the one you picked, try using tolerance. Also if you want it to be even more accurate, have it hold the mouse over what it thinks is iron, then look in the top left of the screen to see if it says "Mine Iron" before clicking.

  3. #3
    Join Date
    Sep 2006
    Location
    Great Britain
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Your mine procedure is wrong:

    [QUOTE]
    procedure Mine;
    begin
    if(FindColor(x,y,IronColor,0,0,100,100)) then
    begin
    MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
    Wait(100+random(10));
    ClickMouse(x,y,true);
    end;
    end;
    [/QUTOE]

    It is only searching in the very top left corner.

    You need to change the co-ordinates of where the color searches.
    It should be 600, 600 not 100,100
    if(FindColor(x,y,IronColor,0,0,600,600)) then

Thread Information

Users Browsing this Thread

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

Posting Permissions

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