Scar-noob tries to modify peanut-dash script...

Discussion in 'Code Snippets and Tutorials' started by Ropi, Mar 2, 2008.

  1. Ropi

    Ropi Level II

    Joined:
    Dec 19, 2007
    Messages:
    222
    Likes Received:
    1
    Location:
    Germany
    Hi there,

    i'm new to SCAR, but it looks like TurboPascal or even QBasic in my early PC-Days...

    i got this script with the SCAR-Download:

    program peanut;

    var
    x,y: Integer;

    procedure Start;
    begin
    repeat
    SendArrowSilent(3);
    SendArrowSilent(1);
    until(GetColor(161, 350) = 255);
    SendArrowSilent(0);
    end;

    procedure DoubleBackFlip;
    begin
    SendArrowSilent(3);
    SendArrowSilent(1);
    SendArrowSilent(3);
    SendArrowSilent(1);
    SendArrowSilent(0);
    end;

    procedure The;
    begin
    repeat
    SendArrowSilent(1);
    Wait(50);
    until(GetColor(350, 240) = 16676470);
    repeat
    if (FindColor(x, y, 3568020, 383, 200, 493, 308)) then DoubleBackFlip;
    if (FindColor(x, y, 6189691, 1, 85, 500, 400)) then DoubleBackFlip;
    until(getcolor(112, 117) = 14777660)
    MoveMouseSmooth(156, 115);
    ClickMouse(156, 115, True);
    end;

    begin
    repeat
    Start;
    Wait(5000);
    The;
    until(getcolor(58,223)=16777215);
    end.

    The problem was in the "the" procedure for me...

    until(getcolor(112,117) etc... this is a fix spot i think, and my windows seems not to fit for this adress... so i tried to change it, that it looks in an area for this blue color "start next round" is written in... than i want the mouse to move there and klick were it found this color... then wait a random time betwenn 750 and 1500 ms and start again with the main programm...

    i modified the sction this way:

    repeat
    if (FindColor(x, y, 3568020, 383, 200, 493, 308)) then DoubleBackFlip;
    if (FindColor(x, y, 6189691, 1, 85, 500, 400)) then DoubleBackFlip;
    until(FindColor(x, y, 8688755, 230, 30, 250, 60));
    FindColor(x, y, 14777660, 104, 111, 209, 129))
    MoveMouseSmooth(x, y);
    ClickMouse(x, y, True);
    wait(750 + random(750));

    this produces the following error:

    Failed when compiling
    Line 34: [Error] (34:46): Identifier expected in script F:\Programme\SCAR 3.14\Scripts\Neopets\peanut.scar

    so what is my mistakes?
     
  2. ricky92

    ricky92 Administrator
    Staff Member

    Joined:
    Nov 10, 2006
    Messages:
    1,866
    Likes Received:
    67
    FindColor(x, y, 14777660, 104, 111, 209, 129))

    replace this with:

    FindColor(x, y, 14777660, 104, 111, 209, 129);
     
  3. Ropi

    Ropi Level II

    Joined:
    Dec 19, 2007
    Messages:
    222
    Likes Received:
    1
    Location:
    Germany
    thanks a lot... it works now...

    but only for one run... this part:

    FindColor(x, y, 14777660, 104, 111, 209, 129);
    MoveMouseSmooth(x, y);
    ClickMouse(x, y, True);
    wait(750 + random(750));

    was supposed to do the following:

    - look in the upper left for the light blue words "start next round"
    - give the coordinates to x and y
    - move the mouse right there an click...
    - the wait a random time

    the script than should start again with the start procedure and finish the next run...

    but in fact, it seem not to do anything after the first run, so time runs out and the game quits the try...
     
  4. SuBLiME

    SuBLiME Level I

    Joined:
    Apr 17, 2008
    Messages:
    60
    Likes Received:
    0
    Another point: As I recall, neopets implemented color change sometimes back. This means you'll have to either set a tolerance or use the getcolor function.
     
  5. chelsea1

    chelsea1 Level IV

    Joined:
    Nov 26, 2006
    Messages:
    2,538
    Likes Received:
    31
    Location:
    London
    i either use the getcolor function OR look for BLACK (0) pixes as they don't change