Results 1 to 11 of 11

Thread: Identifier expected in script...But Why?

  1. #1
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Identifier expected in script...But Why?

    Ok, so Im bored and decide to make this script while I w8 for SRL to be updated, so I can finish my law runner. Then I run into this problem:

    Line 20: [Error] (14469:1): Identifier expected in script C:\Program Files\SCAR 3.11\Scripts\Macrosoft Lumbridge Swamp Tar Collector.scar

    I cant seem to figure out why this happens?

    SCAR Code:
    program SwampTarCollector;

    {.include SRL/SRL.scar}
    {.include SRL/SRL\Skill\Magic.scar} //for lumb home tele

    var
     i: Integer;

    Procedure LumbTele;
    begin
    end;
    Procedure WalkToLumb;
    begin
    end;
    Function SwampCheck: Boolean;//checks if in the swamp
     begin
      If not (FindMMColorTol(x, y, 7965518, 15)) and not(FindMMColorTol(x, y, 6191915, 20))
       Then
        Result:= False;
       Else
        Result:= True;
     end;


    Procedure PickUpTar;
     begin
      FindMMColorTol( x, y, 2105598, 10);//find the red color of the item dot
      if(not(FindMMColorTol( x, y, 2105598, 10))) Then
       begin
        SwampCheck;
        if (SwampCheck= True) Then
         begin
         i=0
         repeat
          wait(1000);//Wait for a swamp tar to respawn
          i=i+1;
          case Random(25) of//antiban for when waiting
           1: RandomRClick;
           7: PickUpMouse;
           10: PickUpMouse;
           17: AlmostLogout;
         until(FindMMColorTol( x, y, 2105598, 10) or (i=15);
         if(i=15) then //if it waited for 15 seconds without a respawn, reset the place in the swamp
          begin
           LumbTele;
           WalkToSwamp;
          end;
       end;
      Mouse(x, y, 5, 5, True);
      Wait(500);
      Flag;
      FindObjectMulti(x, y, 'ake', 'wamp', 'tar', 3552827, 2434343, 3289655, 10, 20, True, True);
      case Random(3) of
       0: Mouse(x, y, 10, 10, True);
       1: Mouse(x, y, 10, 10, True);
       2: begin Mouse(x, y, 10, 10, False);
           ChooseOptionEx('ake');
        end;
    end;

    begin
    end.

    I cant seem to figure out why this happens?

    Can someone please help me?

  2. #2
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    SCAR Code:
    Then
        Result:= False;
       Else
    take out the ; after false because you cant have one if using an else statement

  3. #3
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oh, lol, didn't catch that, thanks, man, thats the reason most people don't code at 11:00...

  4. #4
    Join Date
    Aug 2007
    Posts
    75
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol its 2:26am here and i'm still going strong!(cant spell through)

  5. #5
    Join Date
    Nov 2006
    Location
    In an Amish Paradise
    Posts
    729
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Try this...
    SCAR Code:
    program SwampTarCollector;

    {.include SRL/SRL.scar}
    {.include SRL/SRL\Skill\Magic.scar} //for lumb home tele

    var
     i: Integer;

    Procedure LumbTele;
    begin
    end;
    Procedure WalkToLumb;
    begin
    end;
    Function SwampCheck: Boolean;//checks if in the swamp
    begin
      If not (FindMMColorTol(x, y, 7965518, 15)) and not(FindMMColorTol(x, y, 6191915, 20))then
        Begin    //need begin to have else
          Result:= False;
        end else
          Result:= True;
    end;


    Procedure PickUpTar;
     begin
      FindMMColorTol( x, y, 2105598, 10);//find the red color of the item dot
      if(not(FindMMColorTol( x, y, 2105598, 10))) Then
       begin
        SwampCheck;
        if (SwampCheck= True) Then
         begin
         i:=0  // needed :
         repeat
          wait(1000);//Wait for a swamp tar to respawn
          i:=i+1;
          case Random(25) of//antiban for when waiting
            1: Begin RandomRClick; end;
            7: Begin PickUpMouse; end;
            10: begin PickUpMouse; end;
            17: begin AlmostLogout; end;
          end;
         until(FindMMColorTol( x, y, 2105598, 10)) or (i=15);
         if(i=15) then //if it waited for 15 seconds without a respawn, reset the place in the swamp
          begin
           LumbTele;
           //WalkToSwamp;    //need to add to script
          end;
       end;
      Mouse(x, y, 5, 5, True);
      Wait(500);
      Flag;
      FindObjectMulti(x, y, 'ake', 'wamp', 'tar', 3552827, 2434343, 3289655, 10, 20, True, True);
      case Random(3) of
       0: Mouse(x, y, 10, 10, True);
       1: Mouse(x, y, 10, 10, True);
       2: begin Mouse(x, y, 10, 10, False);
           ChooseOptionEx('ake');
          end;
       end;
     end;
    end;

    begin
    end.

    ~Stupedspam

  6. #6
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Dude View Post
    lol its 2:26am here and i'm still going strong!(cant spell through)
    lol i love staying up to code, in fact, I find it hard to stop coding, its addicting! Its so much more fun than actually playing rs

    but it is getting sorta late, and im 13, still growing, and like 20 percentile height and weight, i dont exactly want to stun my growth with a vault or anything (If you dont know what vault is, , lol, just had to say that, vault is a soda LOADED with caffein and sugar to give you energy...)

  7. #7
    Join Date
    Aug 2007
    Posts
    75
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    something along the lines of redbull or lucasade(sp?) then?

    Yeah i know what you mean about coding, it is a bit addictive, C++ is even worse for me, done several all nighters at university then got up after a morning/afternoon sleep and not been able to remember what half of it does! Anyway quater to 3 time for bed!

  8. #8
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by stupedspam View Post
    SCAR Code:
    Begin    //need begin to have else
      Result:= False;
    end else

    ~Stupedspam
    You don't need to have begin for end..else. You just can't have a semicolon at the end of the identifier before 'else'.

    SCAR Code:
    Result := False
    else

  9. #9
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks jason, i already got it

    Dude- yeah lol, c++ is addicting, what compiler do you use, I use ms visual c++

  10. #10
    Join Date
    Jan 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    program Harpoon_Buyer;

    {$i srl/srl/misc/smart.simba}
    {$i SRL/SRL.simba}
    //{.Include SRL\SRL\Misc\Debug.simba}
    //{$i SRL/SRL/misc/paintsmart.simba}
    {$i ObjectDTM/ObjDTMInclude.Simba}



    Const //Yoho's
    SERVER = ('54'); // Enter "0" to pick a random server.
    MEMBERS = False; // Set to True if using a RS-Members account. False if F2P.
    SRLStats_Username = ''; // Your SRL Stats Username
    SRLStats_Password = ''; // Your SRL Stats Password
    NumbOfPlayers= 1; //How many players are you using
    StartPlayer= 0; //Player to start auoting with! (0 means first char)
    Version = 1.2;

    Var
    tries: integer;
    opened : boolean;
    Poon: integer;
    aFound: Extended;
    {************************************************* ******************************
    procedure DeclarePlayers;
    By: SRL
    Description: SRL's Player Setup
    ************************************************** *****************************}
    procedure DeclarePlayers;
    var i:integer;
    begin
    NumberOfPlayers(6);
    CurrentPlayer := 4;
    for i := 1 to NumbOfPlayers-5 do
    Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

    Players[0].Name := '';
    Players[0].Pass := '';
    Players[0].Nick := '';
    Players[0].Member := False;
    Players[0].Active := True;
    Players[0].Pin := '';
    end;

    Procedure ObjSetup; //Euph's
    begin;
    ObjDTM_Setup;
    end;

    Procedure StatsGuise(wat:String); //Yoho's
    Begin
    Status(wat);
    Disguise(wat);
    End;

    //Function CheckAndClick(X,Y:Integer):Boolean;
    //By: YoHoJo
    //Description: Moves mouse to x,y, checks for uptext, and clikcs if found
    //************************************************** *****************************}
    Function CheckAndClick(X,Y:Integer):Boolean;
    Begin
    MMouse(x, y, 5, 5);
    {Wait(100 + Random(50));
    If CountUpColor('B', 41, 5, 86, 24, 70, 140) Then}
    If WaitUpTextMulti(['Mine','ine'], 150) Then
    Begin
    Result:=True;
    GetMousePos(x, y);
    Mouse(x, y, 0, 0,True);
    Wait(100+Random(50));
    FFlag(0);
    End;
    End;

    Procedure FailSafe(Reason:String); //Yoho's
    begin
    Players[CurrentPlayer].Loc:=reason;
    Logout;
    Terminatescript;
    end;

    Procedure HumanMMouse(eX, eY, ranX, ranY: Integer);
    var
    randSpeed: extended;
    X,Y,X2,Y2,A,Dist,MP: integer;
    begin
    A := MouseSpeed;
    GetMousePos(X, Y);
    Dist := Distance(X, Y, eX, eY);
    MP := Round(Dist/150);
    if MP < 0 then
    MP := 1;

    randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
    X2 := RandomRange(eX-(A*MP), eX+(A*MP));
    Y2 := RandomRange(eY-(A*MP), eY+(A*MP));
    WindMouse(X, Y, X2, Y2, 11, 8, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
    GetMousePos(X, Y);
    MMouse(eX, eY, ranX, ranY);
    MouseSpeed := A;
    end;

    Procedure Loadvars;
    begin;
    MouseSpeed := RandomRange(14, 18);
    end;


    Procedure Antiban; //I liked a few of Yoho's antibans, I implemented them here
    Begin
    Case Random(254) Of
    0: HoverSkill('Constitution', False);
    1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
    2: IdleTime(100+random(700), 100+Random(100), 0.2+RandomE/2);
    3: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
    4: HoverSkill('random', False);
    5: RandomMovement;
    End;
    end;

    Procedure ProgressReport;
    begin
    Cleardebug;
    Writeln('You have been Pooning for:' + TimeRunning);
    Writeln('Poons Bought:' + IntToStr(Poon*28));
    end;

    procedure Resting;
    var
    X,Y: Integer;
    s: String;
    begin
    if not loggedin then exit;
    FindNormalRandoms;
    Antiban;
    DidRedClick;

    begin
    if (Not runenergy(50)) then
    begin
    setrest;
    Wait(10000+Random(5000));
    RestUntil(80)

    end;
    end;
    end;

    Procedure BuyThosePoons;
    Var
    X,Y,I: Integer;
    TPA : TPointArray;
    ATPA : T2DPointArray;

    begin
    If not loggedin then exit;
    FindNormalRandoms;
    Antiban;
    DidRedClick;
    Timerunning;

    begin
    Resting;
    end;

    begin
    SetAngle(SRL_ANGLE_HIGH);
    MakeCompass('S');

    if not invfull then
    begin
    if not shopscreen then
    begin
    If (FindObjCustom(x,y,['alk', 'talk'], [7841457, 926253, 8561065, 7118242, 7510954], 3)) Then
    begin

    MMouse(X, Y, 1, 1);
    ClickMouse2(False);
    Writeln('Talking to the Fisherman');
    Wait(600+random(250));
    Waitoption('rade', 3000);
    Wait(3500+random(250));
    end;


    begin
    If shopscreen then
    begin
    MouseBox(186, 55, 225, 98, 2);
    begin
    getmousepos(x, y);
    Writeln('Buying dose poons');
    ClickMouse2(False);
    Wait(600+random(250));
    Waitoption('00', 3000);
    Wait(1500+random(250));
    end;

    begin
    MouseBox(479, 13, 493, 27, 1);
    begin
    Wait(1000+random(500));
    end;
    end;
    end;
    end;
    end;
    end;
    end;


    Procedure WalkToTheDepositBox;
    var
    Path: TStringArray;
    DoorDTM, X, Y, I: Integer;
    TPA : TPointArray;
    ATPA : T2DPointArray;
    begin
    if not loggedin then exit;
    FindNormalRandoms;
    Antiban;
    DidRedClick;

    if not invfull then
    begin
    buythosepoons;
    end;

    begin
    Path:= ['626:102:4:1:7:605:69:1:7:597:98:1:7:656:97:3:7:64 6:131'];
    for I := 0 to 0 do
    ObjDTM_Walk(Path[i], 0, 100, 80, True);
    Wait(2000+Random(500));

    begin
    DoorDTM := DTMFromString('mwQAAAHic42RgYPBnYmCwAuJkIPYDYmsgTg RiGyD2BeIEIBZlZGD4BVT7mwFCizBCxLSAWAeKLYzlGSrynBjK chwZagpdGTydNRnsrZQZ3B3VGVwc5cCYH6iXEGYkAsMBAAWQDm 0=');
    if FindDTMRotated(DoorDTM, x, y, 0, 0, 700, 500, -Pi, Pi, Pi/30, aFound) then
    begin
    MMouse(X, Y, 2, 2);
    ClickMouse2(True);
    Wait(2000+random(250));
    end;
    if not FindDTM(DoorDTM, x, y, 0, 0, 700, 500) then
    begin
    writeln('Doors Open');
    Wait(1000+Random(500));
    Path:= ['688:51:6:3:7:644:113:1:7:655:81:1:7:607:54:1:7:59 8:81:1:7:618:116:2:7:602:118'];
    for I := 0 to 0 do
    ObjDTM_Walk(Path[i], 0, 100, 80, True);
    end;
    FreeDtm(doorDTM) // FreeBitmap(Door);
    end;
    end;
    end;

    Procedure Flagcheck;
    var
    Path: TStringArray;
    X, Y, I: Integer;
    TPA : TPointArray;
    ATPA : T2DPointArray;

    begin
    Wait(5000+Random(1000));

    begin
    Path:= ['666:56:1:1:7:592:113:1:669:57'];
    //this one replace // '686:62:1:1:7:594:112' Might do box
    for I := 0 to 0 do
    ObjDTM_Walk(Path[i], 0, 100, 80, True);
    Wait(2000+Random(500));


    begin
    Path:= ['644:86:3:3:7:593:39:3:7:609:31:3:7:597:27'];
    for I := 0 to 0 do
    ObjDTM_Walk(Path[i], 0, 100, 80, True);
    Wait(2000+Random(500));
    end;
    end;
    end;

    Procedure DepositPoons;
    var
    X,Y,I: Integer;
    TPA : TPointArray;
    ATPA : T2DPointArray;
    begin
    if not loggedin then exit;
    FindNormalRandoms;
    Antiban;
    DidRedClick;
    Inc(Poon);
    ProgressReport;

    begin
    resting;
    end;

    If Invfull then
    begin
    If not depositscreen then
    begin
    If (FindObjCustom(x,y,['eposit', 'deposit'], [5991031, 5924981], 2)) Then
    begin
    Writeln('Opening Deposit box');
    MMouse(X, Y, 5, 5);
    ClickMouse2(True);
    Wait(3000+random(250));
    end;

    begin
    If (FindObjCustom(x,y,['eposit', 'deposit'], [1854330, 1985922, 1655411, 1655411], 8)) Then
    begin
    Writeln('Depositing dose poons');
    MMouse(X, Y, 3, 3);
    ClickMouse2(True);
    Wait(1000+random(250));
    end;
    end;
    end;
    end;
    end;

    Procedure BackToTheShop;
    var
    Path: TStringArray;
    Door2DTM, Door3DTM, Door4DTM, X, Y, I: Integer;

    begin
    if not loggedin then exit;
    FindNormalRandoms;
    Antiban;
    DidRedClick;

    If invfull then
    begin
    DepositPoons;
    end;

    begin
    If not invfull then
    begin
    Path:= ['569:87:1:3:7:588:31'];
    for I := 0 to 0 do
    ObjDTM_Walk(Path[i], 0, 100, 80, True);
    Wait(2500+Random(500));



    begin
    Path:= ['610:142:3:3:7:635:36:3:7:652:27:3:7:640:23:1:610: 142'];
    for I := 0 to 0 do
    ObjDTM_Walk(Path[i], 0, 100, 80, True);
    Wait(2000+Random(500));

    begin
    Path:= ['568:97:2:1:7:597:85:3:7:587:119'];
    for I := 0 to 0 do
    ObjDTM_Walk(Path[i], 0, 100, 80, True);
    Wait(4000+Random(500));
    begin
    SetAngle(SRL_ANGLE_HIGH);
    MakeCompass('S');
    Door2DTM := DTMFromString('mwQAAAHic42RgYMhgZGAIZoTQtUAcAsQ1QB wGxFVQ8SggdkbCkUAcDsSZUHkQbWIgy1Ca7chQme/MUJzlwODmoM5gb6nM4OIgC8f8QPsIYUYiMBwAABsUDnY=');
    if FindDTMRotated(Door2DTM, x, y, 0, 0, 700, 500, -Pi, Pi, Pi/30, aFound) then
    begin
    MMouse(X, Y, 2, 2);
    ClickMouse2(True);
    Wait(2000+random(250));
    end;

    begin
    if not FindDTM(Door2DTM, x, y, 0, 0, 700, 500) then
    begin
    writeln('Doors Open')
    end;

    begin
    Door3DTM := DTMFromString('mwQAAAHic42RgYNjByMCwAIi3AfEZIF4CpV cC8Tkg3g3EG4B4DhDPhuJNQLwWiPcB8V4oNtKTZijOcmAoz3Vi yE2xYXBzUGfwdtVkcHGQhWN+oH2EMCMRGA4Ao98UVQ==');
    if FindDTMRotated(Door3DTM, x, y, 0, 0, 700, 500, -Pi, Pi, Pi/30, aFound) then
    begin
    MMouse(X, Y, 2, 2)
    ClickMouse2(True)
    Wait(2000+random(250))
    end;

    begin
    Door4DTM := DTMFromString('mwQAAAHic42RgYFBmYmDgBWIrIFYFYn4gtg BiISA2Z4LIJzIyMHgAsTsUg/gJQFwCxIVQ2txInqEsxwmMKwtcGDydNRmCvPUY3JzkGewtlcE0 P9A+QpiRCAwHAMUvDK4=');
    begin
    MMouse(X, Y, 2, 2);
    ClickMouse2(True);
    Wait(2000+random(250));
    end;
    begin
    Path:= ['628:63:7:1:7:581:119:1:7:597:73:1:7:605:43:1:7:65 5:72:1:7:618:110:3:7:645:106:2:7:601:112'];
    for I := 0 to 0 do
    ObjDTM_Walk(Path[i], 0, 100, 80, True);
    Wait(2000+Random(500));
    end;
    end;
    FreeDtm(Door3DTM)
    FreeDtm(Door4DTM)
    end;
    end;
    end;
    end;
    end;
    end;
    end;
    end;

    begin
    Smart_Server := 54;
    Smart_Members := False;
    Smart_Signed := True;
    Smart_SuperDetail := False;
    SetupSRL;
    Loadvars;
    ObjSetup;
    Declareplayers;
    if not (LoggedIn) then
    LoginPlayer;
    Repeat
    Repeat
    BuyThosePoons;
    WalkToTheDepositBox;
    Flagcheck;
    DepositPoons;
    BackToTheShop;
    Until(Poon=42) or (not LoggedIn);
    NextPlayer(Players[CurrentPlayer].Active);
    Poon:=0;
    Until(false);


    Please Need help with this script.

  11. #11
    Join Date
    Feb 2011
    Location
    Wisconsin
    Posts
    398
    Mentioned
    1 Post(s)
    Quoted
    10 Post(s)

    Default

    kame don't post this on a 4 1/2 year old gravdig.. post it on the original thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Bah!! Identifier Expected in Script.
    By siroober in forum OSR Help
    Replies: 3
    Last Post: 05-03-2008, 11:46 PM
  2. Identifier expected in script
    By StrikerX in forum OSR Help
    Replies: 2
    Last Post: 04-11-2008, 12:21 PM
  3. Identifier expected in script
    By Becks in forum OSR Help
    Replies: 6
    Last Post: 04-11-2008, 06:41 AM
  4. Identifier expected in script
    By wasapiguy2 in forum OSR Help
    Replies: 2
    Last Post: 03-25-2008, 09:57 AM
  5. Identifier expected in script?
    By steth1010 in forum OSR Help
    Replies: 6
    Last Post: 05-06-2007, 09:03 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
  •