Results 1 to 9 of 9

Thread: 'Else' Error, Please help!

  1. #1
    Join Date
    Jan 2009
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    'Else' Error, Please help!

    I'm a real beginner at scar and i put together this really basic script:

    Code:
    var
    x,y: Integer;
    
    const
    rock1 =11051634;
    rock2 =11248499;
    rock3 =10656622;
    bank1 =7039596;
    bank2 =7236719;
    bank3 =9276561;
    {randomsand1 =6991033;
    randomsand2 =5149353;
    randomsand3 =3173769; }
    
    
         begin
         repeat
                          if (FindColorSpiral(x,y,rock1,361,210,473,341))
                          or (FindColorSpiral(x,y,rock2,193,139,559,430))
                          or (FindColorSpiral(x,y,rock3,4,27,761,608)) then
                            MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
                            Wait(500);
                            ClickMouse(x,y,true);
                            wait(70000);
    
    if (FindColorSpiral(x,y,bank1,361,210,473,341))
    or (FindColorSpiral(x,y,bank2,193,139,559,430))
    or (FindColorSpiral(x,y,bank3,4,27,761,608)) then
        MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
        Wait(500);
        ClickMouse(x,y,true);
        wait(500);
        movemousesmooth(585, 227)
        wait(500)
        clickmouse(585, 227, false)
        wait(500)
        movemousesmooth(597, 302)
        wait(500)
        clickmouse(597, 302, true)
        wait(500)
        movemousesmooth(465, 41)
        wait(500)
        clickmouse(465, 41, true)
        wait(500)
         else
        movemousesmooth(413, 58)
        wait(500)
        clickmouse(413, 58, true)
        wait(10000)
    
     until(false);
    end.
    But when i compile i get this message, and ive checked through time and time again and i just can't see whats wrong with it.

    Code:
    Failed when compiling
    Line 45: [Error] (45:1): Identifier expected in script
    Please help me.

  2. #2
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    If FindColorSpiral(x,y,rock1,361,210,473,341) Then
    Begin
      // everything between the begin and end will be done when the color is found.
    End else
    Begin
      // everything between this begin and end will be done when the color is NOT found.
    End;

    You might wanna take a good look at that

    Good luck scripting!

  3. #3
    Join Date
    Oct 2007
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Dont use clickmouse and move mouse smooth, use:

    MMouse(x, y, rx, ry);
    It will move the mouse to the position, like a human.
    x, y are the coordinates to move the mouse to.
    rx, ry are random coordinates to add to the x, y.

    Mouse(x, y, rx, ry, leftclick);
    It will move the mouse to the position and click the position like a human.
    x, y are coordinates to move the mouse to.
    rx, ry are random coordinates to add to the x, y.
    leftclick is a boolean, so there you eather put: True or False.
    Woot woot.

  4. #4
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  5. #5
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    you are missing an end before Until(false);

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  6. #6
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  7. #7
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    SCAR Code:
    if (FindColorSpiral(x,y,bank1,361,210,473,341))
    or (FindColorSpiral(x,y,bank2,193,139,559,430))
    or (FindColorSpiral(x,y,bank3,4,27,761,608)) then
      //begin
        MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
        Wait(500);
        ClickMouse(x,y,true);
        wait(500);
        movemousesmooth(585, 227)
        wait(500)
        clickmouse(585, 227, false)
        wait(500)
        movemousesmooth(597, 302)
        wait(500)
        clickmouse(597, 302, true)
        wait(500)
        movemousesmooth(465, 41)
        wait(500)
        clickmouse(465, 41, true)
        wait(500)
    //end
         else
    //begin
        movemousesmooth(413, 58)
        wait(500)
        clickmouse(413, 58, true)
        wait(10000)
       //end
     until(false);

    well, he is actually missing 2 begins and 2 ends, as the code would not work properly otherswise.

    and the problem he had is because of the else there in the middle because it does not know to which if to reffer to because of missing begins and ends.

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  8. #8
    Join Date
    Jan 2009
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)
    Okay so ive changed all the movemousesmooth's, etc, and sorted everything out. Works like a charm now =)

    Although it doesn't really matter about making the autoer more human, as i'm only using it on FrugooScape - a private server.

    If anyone wouldn't mind helping me make an anti random for frugooscape let me know, they only have one and its basically 2 or 3 clicks to get out, but i just don't have the knowledge yet.

    Thanks so much for your help everyone, i appreciate it.

  9. #9
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by Q Surfer View Post
    Okay so ive changed all the movemousesmooth's, etc, and sorted everything out. Works like a charm now =)

    Although it doesn't really matter about making the autoer more human, as i'm only using it on FrugooScape - a private server.

    If anyone wouldn't mind helping me make an anti random for frugooscape let me know, they only have one and its basically 2 or 3 clicks to get out, but i just don't have the knowledge yet.

    Thanks so much for your help everyone, i appreciate it.
    if the one they have exists in runescape all you need is to call FindNormalRandoms from time to time.

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Line 135: [Error] (14845:1): Syntax error in script
    By AbsTrACt'^.| in forum OSR Help
    Replies: 16
    Last Post: 05-23-2008, 01:14 PM
  2. Replies: 5
    Last Post: 02-26-2008, 04:14 PM
  3. Smart error and Some kind of Math.scar error
    By FagetHax0r in forum OSR Help
    Replies: 6
    Last Post: 02-24-2008, 10:43 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
  •