Results 1 to 5 of 5

Thread: Scar Error! Need help

  1. #1
    Join Date
    Dec 2007
    Location
    Aus
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Scar Error! Need help

    Something's Wrong with my Scar 3.13! Whenever I try to use an auto-woodcutter i get an error saying Unknown Identifier "Loggedin"!

    Heres my script:


    //-----------------------------------------------------------------//
    //-- Scar Standard Resource Library --//
    //-- Woodcutting routines --//
    //-----------------------------------------------------------------//
    // * function FindAxe: Boolean; // * by Sumilion
    // * procedure FindBirdsNest; // * by Liquid and Starblaster100
    // * function FindEnt(TreeColor: Integer): Boolean; // * by Sumilion
    // * procedure SetupWoodcutting; // * SRL

    var
    EquipAxe: Boolean;

    {************************************************* ******************************
    function FindAxe: Boolean;
    By: Sumilion
    Description: Finds if there is an axe present. Axe can be wielded or unwielded.
    Stores place in Boolean var EquipAxe.
    ************************************************** *****************************}

    function FindAxe: Boolean;
    var
    InvAxe, WieldAxe, Ix, Iy, i: Integer;
    dtmAxes: array[0..6] of Integer;
    begin
    if LoggedIn then
    begin
    GameTab(4);
    dtmAxes[1] := DTMFromString('78DA639CCEC4C0F09401051485F13188006 94' +
    '620FE0F048C4B806AEEA2AA718E4864E082AA0101C6C54035 F751' +
    'D5D887C6A1AA590A547313558D4B740A8A1A00CFA10E03'); //rune
    dtmAxes[2] := DTMFromString('78DA6374606060686440014D497C0C22409 A1' +
    '188FF0301A337905187AAC6C6D786810BAA0604187D804415 AA1A' +
    '7B7F7B5435BE40A21C558D73B0338A1A00C1660AA8'); //addy
    dtmAxes[3] := DTMFromString('78DA633CC4C4C010C0C8800C5A53F818528 03' +
    '448F43F10309E05AAF14155636111CCC0055503028CE7816A 5C51' +
    'D5D839C4A2AA3981A9C6C52D0D450D0061FC0C64'); //mith
    dtmAxes[4] := DTMFromString('78DA63CC636260D8C3C8800C5A53F818528 03' +
    '448F43F10305602D5EC4055939B9ACAC0055503028CD54035 1B51' +
    'D594E5E5A2AA29C154D3545989A20600C3BC0E32'); //steel
    dtmAxes[5] := DTMFromString('78DA63BCC9C4C0309191010498182020C68 59' +
    '34103488344FF0301E353A04C2F230332F0707161E082AA01 01C6' +
    '0740356DA86A22838351D5BC00AAE94655932ACA89AAE639A 6394' +
    '1DEDE286A00B1F90F6D'); //iron
    dtmAxes[6] := DTMFromString('78DA63EC626060086140016DA97C0C22409 A1' +
    '188FF0301E33420C307558D97A5220317540D08304E051201 A86A' +
    'DCCCE451D54C07129EA86AFC6C5450D40000D77E0AA2'); //bronze
    GameTab(5);
    for WieldAxe := 1 to 7 do
    begin
    if(WieldAxe = 7)then
    Break;
    if(FindDtm(dtmAxes[WieldAxe], Ix, Iy, MIX1, MIY1, MIX2, MIY2))then
    Break;
    end;
    GameTab(4);
    for InvAxe := 1 to 7 do
    begin
    if(InvAxe = 7)then
    Break;
    if(FindDtm(dtmAxes[InvAxe], Ix, Iy, MIX1, MIY1, MIX2, MIY2))then
    Break;
    end;

    if(InvAxe = 7)and(WieldAxe = 7)then
    begin
    Result := False;
    Writeln('No axe was found.');
    for i := 0 to 6 do
    FreeDtm(dtmAxes[i]);
    Exit;
    end;
    if((InvAxe - WieldAxe) < 0)then
    EquipAxe := False
    else
    EquipAxe := True;
    case Min(WieldAxe, InvAxe) of
    1: WriteLn('Using Rune axe');
    2: WriteLn('Using Addy axe');
    3: WriteLn('Using Mith axe');
    4: WriteLn('Using Steel axe');
    5: WriteLn('Using Iron axe');
    6: WriteLn('Using Bronze axe');
    end;
    Result := True;
    for i := 0 to 6 do
    FreeDtm(dtmAxes[i]);
    end;
    end;

    {************************************************* ******************************
    procedure FindBirdsNest;
    By: Liquid and Starblaster100
    Description: If a birds nest is found, it will pick it up
    ************************************************** *****************************}

    procedure FindBirdsNest;
    var
    tries, x, y: Integer;
    begin
    if (Pos(GetNewChatMsg, 'A bird') <> 0) then
    begin
    repeat
    if not (FindObj(x, y, 'Take Bird', 3952984, 10)) or
    not (FindObj(x, y, 'Take Bird', 1713706, 10)) or
    not (FindObj(x, y, 'Take Bird', 1581604, 10)) then
    begin
    KeyDown(VK_LEFT);
    Wait(700 + Random(500));
    KeyUp(VK_LEFT);
    Wait(400 + Random(300));
    end;
    if not (FindObj(x, y, 'Take Bird', 3952984, 10)) or
    not (FindObj(x, y, 'Take Bird', 1713706, 10)) or
    not (FindObj(x, y, 'Take Bird', 1581604, 10)) then
    begin
    x := 648;
    y := 83;
    tries := tries + 1;
    FindColorSpiral(x, y, 241, 570, 5, 725, 155);
    Mouse(x + 3, y + 3, 2, 2, True);
    Flag;
    Wait(200 + Random(100));
    end;
    if (FindObj(x, y, 'Take Bird', 3952984, 10)) or
    (FindObj(x, y, 'Take Bird', 1713706, 10)) or
    (FindObj(x, y, 'Take Bird', 1581604, 10)) then
    begin
    WriteLn('Birds Nest Found');
    Wait(450 + Random(400));
    GetMousePos(x, y);
    Mouse(x, y, 0, 0, True);
    Flag;
    Wait(500 + Random(300));
    if (Screenshots) then
    SaveScreenshot('Birds Nest - SRL - ' + IntToStr(GetTimeRunning) + '.bmp');
    tries := tries + 100;
    Birdsnest := Birdsnest + 1;
    Mouse(583, 226, 2, 2, False);
    Wait(100 + Random(100));
    ChooseOption('Examine');
    Exit;
    end;
    until (FindObj(x, y, 'Take Bird', 3952984, 10)) or
    (FindObj(x, y, 'Take Bird', 1713706, 10)) or
    (FindObj(x, y, 'Take Bird', 1581604, 10)) or (tries > 5)
    end;
    end;

    {************************************************* ******************************
    function FindEnt(fx, fy: Integer; AvoidWhenFound: Boolean): Boolean;
    By: Sumilion
    Description: Will look for an Ent and avoid if found.
    ************************************************** *****************************}

    function FindEnt(fx, fy: Integer; AvoidWhenFound: Boolean): Boolean;
    var
    arUpTextEntColorPoints: TPointArray;
    x, y, EntTime, tcts: Integer;
    begin
    if not(LoggedIn)then
    Exit;
    GetMousePos(x, y);
    if(x <> fx)or(y <> fy)then
    MMouse(fx, fy, 0, 0);
    if(IsUpText('Chop'))then
    begin
    tcts := GetColorToleranceSpeed;
    ColorToleranceSpeed(2);
    SetColorspeed2Modifiers(0.4, 0.4);
    FindColorsTolerance(arUpTextEntColorPoints, 51657, 80, 6, 127, 20, 5);
    Result := Length(arUpTextEntColorPoints) > 10;
    ColorToleranceSpeed(tcts);
    end;
    if(Result)then
    begin
    WriteLn('Ent Found!!');
    if(AvoidWhenFound)then
    begin
    Writeln('Waiting for it to go away.');
    MouseFindNoFlag(MMCX, MMCY, -1, 1);
    MarkTime(EntTime);
    while(TimeFromMark(EntTime) < 35000)do
    if(Random(20) > 15)then
    IdleTime(500, 500, 0.4)
    else
    Wait(500 + Random(500));
    EntsAvoided := EntsAvoided + 1;
    end;
    end;
    end;


    {************************************************* ******************************
    procedure SetupWoodcutting;
    By: SRL
    Description: Declares Global Bitmaps.
    ************************************************** *****************************}

    procedure SetupWoodcutting;
    begin
    end;


    Any Help plz? Im new
    What the hell!? Why are you looking here? My post is above here!

  2. #2
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok for one edit your post and put [*scar] [*/scar] tags around all the code you posted (without the asterisks of course).

    Second - Is that the exact script you're trying to compile? Because if so, you probably need to install SRL since that's just the WC include of SRL.
    Temporarily inactive.

  3. #3
    Join Date
    Jun 2007
    Posts
    1,312
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ducels you could have helped him out by scar tagging it for him.
    SCAR Code:
    //-----------------------------------------------------------------//
    //-- Scar Standard Resource Library --//
    //-- Woodcutting routines --//
    //-----------------------------------------------------------------//
    // * function FindAxe: Boolean; // * by Sumilion
    // * procedure FindBirdsNest; // * by Liquid and Starblaster100
    // * function FindEnt(TreeColor: Integer): Boolean; // * by Sumilion
    // * procedure SetupWoodcutting; // * SRL

    var
    EquipAxe: Boolean;

    {************************************************* ******************************
    function FindAxe: Boolean;
    By: Sumilion
    Description: Finds if there is an axe present. Axe can be wielded or unwielded.
    Stores place in Boolean var EquipAxe.
    ************************************************** *****************************}


    function FindAxe: Boolean;
    var
    InvAxe, WieldAxe, Ix, Iy, i: Integer;
    dtmAxes: array[0..6] of Integer;
    begin
    if LoggedIn then
    begin
    GameTab(4);
    dtmAxes[1] := DTMFromString('78DA639CCEC4C0F09401051485F13188006 94' +
    '620FE0F048C4B806AEEA2AA718E4864E082AA0101C6C54035 F751' +
    'D5D887C6A1AA590A547313558D4B740A8A1A00CFA10E03'); //rune
    dtmAxes[2] := DTMFromString('78DA6374606060686440014D497C0C22409 A1' +
    '188FF0301A337905187AAC6C6D786810BAA0604187D804415 AA1A' +
    '7B7F7B5435BE40A21C558D73B0338A1A00C1660AA8'); //addy
    dtmAxes[3] := DTMFromString('78DA633CC4C4C010C0C8800C5A53F818528 03' +
    '448F43F10309E05AAF14155636111CCC0055503028CE7816A 5C51' +
    'D5D839C4A2AA3981A9C6C52D0D450D0061FC0C64'); //mith
    dtmAxes[4] := DTMFromString('78DA63CC636260D8C3C8800C5A53F818528 03' +
    '448F43F10305602D5EC4055939B9ACAC0055503028CD54035 1B51' +
    'D594E5E5A2AA29C154D3545989A20600C3BC0E32'); //steel
    dtmAxes[5] := DTMFromString('78DA63BCC9C4C0309191010498182020C68 59' +
    '34103488344FF0301E353A04C2F230332F0707161E082AA01 01C6' +
    '0740356DA86A22838351D5BC00AAE94655932ACA89AAE639A 6394' +
    '1DEDE286A00B1F90F6D'); //iron
    dtmAxes[6] := DTMFromString('78DA63EC626060086140016DA97C0C22409 A1' +
    '188FF0301E33420C307558D97A5220317540D08304E051201 A86A' +
    'DCCCE451D54C07129EA86AFC6C5450D40000D77E0AA2'); //bronze
    GameTab(5);
    for WieldAxe := 1 to 7 do
    begin
    if(WieldAxe = 7)then
    Break;
    if(FindDtm(dtmAxes[WieldAxe], Ix, Iy, MIX1, MIY1, MIX2, MIY2))then
    Break;
    end;
    GameTab(4);
    for InvAxe := 1 to 7 do
    begin
    if(InvAxe = 7)then
    Break;
    if(FindDtm(dtmAxes[InvAxe], Ix, Iy, MIX1, MIY1, MIX2, MIY2))then
    Break;
    end;

    if(InvAxe = 7)and(WieldAxe = 7)then
    begin
    Result := False;
    Writeln('No axe was found.');
    for i := 0 to 6 do
    FreeDtm(dtmAxes[i]);
    Exit;
    end;
    if((InvAxe - WieldAxe) < 0)then
    EquipAxe := False
    else
    EquipAxe := True;
    case Min(WieldAxe, InvAxe) of
    1: WriteLn('Using Rune axe');
    2: WriteLn('Using Addy axe');
    3: WriteLn('Using Mith axe');
    4: WriteLn('Using Steel axe');
    5: WriteLn('Using Iron axe');
    6: WriteLn('Using Bronze axe');
    end;
    Result := True;
    for i := 0 to 6 do
    FreeDtm(dtmAxes[i]);
    end;
    end;

    {************************************************* ******************************
    procedure FindBirdsNest;
    By: Liquid and Starblaster100
    Description: If a birds nest is found, it will pick it up
    ************************************************** *****************************}


    procedure FindBirdsNest;
    var
    tries, x, y: Integer;
    begin
    if (Pos(GetNewChatMsg, 'A bird') <> 0) then
    begin
    repeat
    if not (FindObj(x, y, 'Take Bird', 3952984, 10)) or
    not (FindObj(x, y, 'Take Bird', 1713706, 10)) or
    not (FindObj(x, y, 'Take Bird', 1581604, 10)) then
    begin
    KeyDown(VK_LEFT);
    Wait(700 + Random(500));
    KeyUp(VK_LEFT);
    Wait(400 + Random(300));
    end;
    if not (FindObj(x, y, 'Take Bird', 3952984, 10)) or
    not (FindObj(x, y, 'Take Bird', 1713706, 10)) or
    not (FindObj(x, y, 'Take Bird', 1581604, 10)) then
    begin
    x := 648;
    y := 83;
    tries := tries + 1;
    FindColorSpiral(x, y, 241, 570, 5, 725, 155);
    Mouse(x + 3, y + 3, 2, 2, True);
    Flag;
    Wait(200 + Random(100));
    end;
    if (FindObj(x, y, 'Take Bird', 3952984, 10)) or
    (FindObj(x, y, 'Take Bird', 1713706, 10)) or
    (FindObj(x, y, 'Take Bird', 1581604, 10)) then
    begin
    WriteLn('Birds Nest Found');
    Wait(450 + Random(400));
    GetMousePos(x, y);
    Mouse(x, y, 0, 0, True);
    Flag;
    Wait(500 + Random(300));
    if (Screenshots) then
    SaveScreenshot('Birds Nest - SRL - ' + IntToStr(GetTimeRunning) + '.bmp');
    tries := tries + 100;
    Birdsnest := Birdsnest + 1;
    Mouse(583, 226, 2, 2, False);
    Wait(100 + Random(100));
    ChooseOption('Examine');
    Exit;
    end;
    until (FindObj(x, y, 'Take Bird', 3952984, 10)) or
    (FindObj(x, y, 'Take Bird', 1713706, 10)) or
    (FindObj(x, y, 'Take Bird', 1581604, 10)) or (tries > 5)
    end;
    end;

    {************************************************* ******************************
    function FindEnt(fx, fy: Integer; AvoidWhenFound: Boolean): Boolean;
    By: Sumilion
    Description: Will look for an Ent and avoid if found.
    ************************************************** *****************************}


    function FindEnt(fx, fy: Integer; AvoidWhenFound: Boolean): Boolean;
    var
    arUpTextEntColorPoints: TPointArray;
    x, y, EntTime, tcts: Integer;
    begin
    if not(LoggedIn)then
    Exit;
    GetMousePos(x, y);
    if(x <> fx)or(y <> fy)then
    MMouse(fx, fy, 0, 0);
    if(IsUpText('Chop'))then
    begin
    tcts := GetColorToleranceSpeed;
    ColorToleranceSpeed(2);
    SetColorspeed2Modifiers(0.4, 0.4);
    FindColorsTolerance(arUpTextEntColorPoints, 51657, 80, 6, 127, 20, 5);
    Result := Length(arUpTextEntColorPoints) > 10;
    ColorToleranceSpeed(tcts);
    end;
    if(Result)then
    begin
    WriteLn('Ent Found!!');
    if(AvoidWhenFound)then
    begin
    Writeln('Waiting for it to go away.');
    MouseFindNoFlag(MMCX, MMCY, -1, 1);
    MarkTime(EntTime);
    while(TimeFromMark(EntTime) < 35000)do
    if(Random(20) > 15)then
    IdleTime(500, 500, 0.4)
    else
    Wait(500 + Random(500));
    EntsAvoided := EntsAvoided + 1;
    end;
    end;
    end;


    {************************************************* ******************************
    procedure SetupWoodcutting;
    By: SRL
    Description: Declares Global Bitmaps.
    ************************************************** *****************************}


    procedure SetupWoodcutting;
    begin
    end;
    Actually ... this is just a list of procedures and functions. Of course it doesn't work.

    Go through the tutorials, this is not a woodcutting script.
    Active only during the Summer...

  4. #4
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    You can't run an include since an include is just a bunch of procedures and function, with the ability to be called in any script where you include the file. You most likely won't be able to compile a part of an SRL include, even if you make a mainloop.

    Conclusion: You can't run an include.

    -Knives

  5. #5
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by JackLKrawl View Post
    ducels you could have helped him out by scar tagging it for him.
    Me SCAR tagging it would make no difference. I only wanted him to do it to reduce space.
    Temporarily inactive.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Error in SRL.scar
    By Dervish in forum OSR Help
    Replies: 5
    Last Post: 03-22-2008, 05: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
  •