Adblock breaks this site

Help with scar script.

Discussion in 'Scar/Simba Help' started by jacksteel, Feb 22, 2008.

  1. jacksteel

    jacksteel Guest

    Referrals:
    0
    Help with scar script.

    Hi, i've found a few threads that have the same problem as me, but i've tried everything everyone suggests, i keep getting this after trying to compile my updated gametab.scar file.

    Line 170: [Error] (170:1): Unknown identifier 'Mouse' in script C:\Program Files\SCAR 3.14\includes\SRL\SRL\core\GameTab.scar
    Failed when compiling

    I have SCAR divi 3.14 (newest version)
    I have updated my srl to revision 14

    If anyone can help, which i'm sure you can :p, i'd be very grateful!

    I think i've download all the includes i need to.... in scar, i clicked file>download includes> then a little box comes up, saying 'this file already exists, do you want to overwrite?' so i click overwrite, and it downloads, then says includes downloaded.

    I've downloaded the SVN SRL, and it's at revision 14, if i try to update now, it just says 'At revision 14'. So i think it definetly worked.

    I've tried re-installing SCAR, and all the include files etc.

    Btw, it might just be the gametab script, could anyone please post the script? because on the srl forums i still can't view the junior members stuff, and i just want to check my gametab fix is the right one. At the moment it says:

    //-----------------------------------------------------------------//
    //-- Scar Standard Resource Library --//
    //-- » GameTab Routines I --//
    //-----------------------------------------------------------------//

    // * GameTab 1 = Fightmode
    // * GameTab 2 = Statistic
    // * GameTab 3 = Quest
    // * GameTab 4 = Inventory (see Inventory.scar)
    // * GameTab 5 = Wield
    // * GameTab 6 = Prayer
    // * GameTab 7 = Mage
    // * GameTab 8 = Add Friend
    // * GameTab 9 = Del Friend
    // * GameTab 10 = ClanChat
    // * GameTab 11 = Run/Tools
    // * GameTab 12 = Emotes
    // * GameTab 13 = Music
    // * GameTab 14 = LogOut
    //****************************************************************************//

    // * function GetCurrentTab: Integer; // * by Wizzup?
    // * function TabExists(TabNumber: Integer): Boolean; // * by Flyboy
    // * function GameTab(tabnumber: Integer): Boolean; // * by Starblaster100
    // * function SetFightMode(oFightMode: Integer): Boolean; // * Starblaster100
    // * function GetCombatLevel: Integer; // * by Nielsie95
    // * function SkillCoords(row, column: Integer): TPoint; // * by RsN
    // * function SkillToCoords(skill: String): TPoint; // * by Masquerader extended by Cheesehunk
    // * function GetSkillInfo: Integer; // * by: Raymond
    // * function GetMMLevels: integer; // * by Raymond
    // * function GetXP(Skill: String): Integer; // * by Nielsie95
    // * function XpTillNextLevel(Skill: String): Integer; // * by Nielsie95
    // * function HpPercent: Integer; // * by RsN
    // * function GetHp: Integer; // * by RsN
    // * procedure GetAllLevels; // * by WT-Fakawi
    // * function CurrentWorld: Integer; // * by Cheesehunk and modified by Ron
    // * function EquipmentCoords(i : Integer) : TPoint; // * by RsN
    // * function WearingItem(i: Integer): Boolean; // * by RsN
    // * procedure TakeOff(i: Integer); // * by RsN
    // * function CheckEquipItems(number: Integer): Boolean; // * by SDcit
    // * procedure SetRun(run: Boolean); // * by Wizzup?
    // * procedure RunControl(Run: Boolean); // * by Wizzup?
    // * procedure SetBar(Bar: String; Point: Integer); // * by Nielsie95
    // * procedure DoEmote(EmoteNumber: Integer); // * by Sumilion

    {*******************************************************************************
    function GetCurrentTab: Integer;
    By: Wizzup?
    Description: Returns current tab
    *******************************************************************************}

    function GetCurrentTab: Integer;
    begin
    begin
    if GetColor(543, 178) = 1580634 then
    Result := 1
    else if GetColor(570, 179) = 1778795 then
    Result := 2
    else if GetColor(604, 174) = 1910385 then
    Result := 3
    else if GetColor(632, 172) = 1910385 then
    Result := 4
    else if GetColor(666, 182) = 1647204 then
    Result := 5
    else if GetColor(699, 177) = 1910385 then
    Result := 6
    else if GetColor(735, 177) = 1778795 then
    Result := 7
    else if GetColor(569, 471) = 1910385 then
    Result := 8
    else if GetColor(598, 471) = 1910385 then
    Result := 9
    else if GetColor(633, 478) = 1778795 then
    Result := 10
    else if GetColor(668, 476) = 1778795 then
    Result := 11
    else if GetColor(703, 481) = 1580634 then
    Result := 12
    else if GetColor(740, 471) = 1778795 then
    Result := 13
    else if (GetColor(751, 14) = 1054310) then
    Result := 14
    else if (GetColor(532, 474)= 1647204) then
    Result := 15;
    end;
    end;

    {*******************************************************************************
    function TabExists(TabNumber: Integer): Boolean;
    By: Flyboy
    Description: Returns true if tab exists.
    Very useful for tutorial Is. as well as a simple double check to make sure
    your fully logged in.
    *******************************************************************************}

    function TabExists(TabNumber: Integer): Boolean;
    begin
    case TabNumber of
    1: Result := (GetColor(542, 185) = 14343390);
    2: Result := (GetColor(576, 188) = 3831858);
    3: Result := (GetColor(609, 185) = 14611187);
    4: Result := (GetColor(644, 180) = 1788543);
    5: Result := (GetColor(675, 183) = 9739165);
    6: Result := (GetColor(708, 184) = 14020307);
    7: Result := (GetColor(741, 187) = 5795970);
    8: Result := (GetColor(575, 483) = 3852287);
    9: Result := (GetColor(607, 485) = 993018);
    10: Result := (GetColor(639, 490) = 1038586);
    11: Result := (GetColor(674, 484) = 4741994);
    12: Result := (GetColor(711, 481) = 3172225);
    13: Result := (GetColor(742, 482) = 2137014);
    14: Result := (GetColor(753, 4) = 3985241) Or (GetColor(753, 6) = 658751);
    15: Result := (GetColor(537, 481) =12625552);
    end;
    end;


    {*******************************************************************************
    function GameTab(tabnumber: Integer): Boolean;
    By: Starblaster100
    Description: Switches between tabs.
    *******************************************************************************}

    function GameTab(tabnumber: Integer): Boolean;
    var
    c: Integer;
    Coords: TPoint;
    begin
    If (Tabnumber < 1) Or (TabNumber > 15) Then
    Exit;
    if GetCurrentTab = tabnumber then
    begin
    Result := True;
    Exit;
    end;
    if not TabExists(tabnumber) then
    begin
    Result := False;
    Exit;
    end;
    case TabNumber of
    1: Coords.x := 542;
    2: Coords.x := 576;
    3: Coords.x := 609;
    4: Coords.x := 642;
    5: Coords.x := 674;
    6: Coords.x := 709;
    7: Coords.x := 745;
    8: Coords.x := 575;
    9: Coords.x := 609;
    10: Coords.x := 642;
    11: Coords.x := 673;
    12: Coords.x := 708;
    13: Coords.x := 742;
    14: Coords.x := 755;
    15: Coords.x := 541;
    else
    begin
    Writeln('GameTab "'+IntToStr(TabNumber)+'" does not exist!');
    Exit;
    end;
    end;
    case TabNumber of
    1, 2, 3, 4, 5, 6, 7: Coords.y := 185;
    8, 9, 10, 11, 12, 13,15: Coords.y := 485;
    14: Coords.y :=12;
    end;
    while not(GetCurrentTab = tabnumber) and (c < 4) do
    Begin
    Mouse(Coords.x, Coords.y, 8, 8, true);
    Inc(c);
    end;
    if (c < 4) then
    Result := True;
    end;

    //****************************************************************************//
    // * GameTab 1 Related Functions.
    //****************************************************************************//
    {*******************************************************************************
    function SetFightMode(oFightMode: Integer): Boolean;
    By: Starblaster100
    Description: Sets fight mode. Returns false if failed to set desired mode.
    *******************************************************************************}

    Function SetFightMode(oFightMode: Integer): Boolean;
    Begin
    If not(Loggedin)then Exit;
    GameTab(1);
    Wait(200 + Random(50));
    Case oFightMode of
    1: if not(GetColor(574,258) = 1974404) then
    Mouse(607, 271, 30, 10, True);
    2: if not(GetColor(657,255) = 1974404) then
    Mouse(690, 271, 30, 10, True);
    3: if not(GetColor(574,308) = 1974408) then
    Mouse(606, 325, 30, 10, True);
    4: if not(GetColor(657,311) = 1974408) then
    Mouse(690, 324, 30, 10, True);
    else Exit;
    end;
    Result := True;
    Wait(250);
    end;

    {*******************************************************************************
    function GetCombatLevel: Integer;
    By: Nielsie95
    Description: Returns the players combat level.
    *******************************************************************************}

    function GetCombatLevel: Integer;
    var
    x, y: Integer;
    begin
    Gametab(1);
    Wait(100 + Random(100));
    if IsTextInAreaEx(590, 225, 690, 245, x, y, 'Combat', 0, StatChars, False,
    False, 0, 2, 2070783) then
    try
    Result := StrToInt(Trim(GetTextAtEx(x, y, 0, StatChars, False, False, 0,
    2, 2070783, 20, True, tr_Digits)));
    except
    Writeln('Could Not Get Combat Level');
    end
    end;

    //****************************************************************************//
    // * GameTab 2 Related Functions.
    //****************************************************************************//
    {*******************************************************************************
    function SkillCoords(row, column: Integer): TPoint;
    By: RsN fixed by dark sniper and fixed by Raymond
    Description: Returns Coords of Skill's Row and Column (Used for GetSkill functions)
    *******************************************************************************}

    function SkillCoords(row, column: Integer): TPoint;
    begin
    case Column of
    1: Result.x := 577;
    2: Result.x := 631;
    3: Result.x := 687;
    end;
    case row of
    1: Result.y := 228;
    2: Result.y := 260;
    3: Result.y := 293;
    4: Result.y := 324;
    5: Result.y := 356;
    6: Result.y := 388;
    7: Result.y := 420;
    8: Result.y := 419;
    end;
    end;

    {*******************************************************************************
    function SkillToCoords(skill: string; var Scroll : Boolean): TPoint;
    By: Masquerader extended by Cheesehunk and modified by Raymond.
    Description: Turns skill string into tpoint.
    If Scroll returns true then you must scroll down.
    *******************************************************************************}

    function SkillToCoords(ScrollDownIfNeeded : Boolean; skill: string): TPoint;
    var
    Scroll : Boolean;
    Timer : Integer;
    ScrollTP : TPoint;
    begin
    case LowerCase(skill) of
    'attack': Result := SkillCoords(1, 1);
    'hitpoints','hp': Result := SkillCoords(1, 2);
    'mining': Result := SkillCoords(1, 3);
    'strength': Result := SkillCoords(2, 1);
    'agility': Result := SkillCoords(2, 2);
    'smithing': Result := SkillCoords(2, 3);
    'defence': Result := SkillCoords(3, 1);
    'herblore': Result := SkillCoords(3, 2);
    'fishing': Result := SkillCoords(3, 3);
    'range','ranged': Result := SkillCoords(4, 1);
    'thieving': Result := SkillCoords(4, 2);
    'cooking': Result := SkillCoords(4, 3);
    'prayer': Result := SkillCoords(5, 1);
    'crafting': Result := SkillCoords(5, 2);
    'firemaking': Result := SkillCoords(5, 3);
    'magic': Result := SkillCoords(6, 1);
    'fletching': Result := SkillCoords(6, 2);
    'woodcutting': Result := SkillCoords(6, 3);
    'runecrafting': Result := SkillCoords(7, 1);
    'slayer': Result := SkillCoords(7, 2);
    'farming': Result := SkillCoords(7, 3);
    'construction': Result := SkillCoords(8, 1);
    'hunting', 'hunter': Result := SkillCoords(8, 2);
    'summoning': Result := SkillCoords(8, 3);
    else
    begin;
    writeln('invalid skill: ' + skill);
    Result := Point(0,0);
    exit;
    end;
    end;
    Scroll := False;
    case LowerCase(skill) of
    'construction','hunting', 'hunter','summoning': Scroll := True;
    end;
    GameTab(2);
    if not scroll then
    begin;
    ScrollTP := Point(724, 250);
    if FindColorSpiralTolerance(ScrollTP.x,ScrollTP.y,1646629,719, 245,728, 255,10) then
    begin;
    Mouse(ScrollTP.x,ScrollTP.y,2,2,True);
    Timer := GetSystemTime;
    Repeat
    Wait(100 + Random(50));
    until ((GetSystemTime - Timer) > 10000) or (not FindColorTolerance(ScrollTP.x,ScrollTP.y,1646629,719, 245,728, 255,10))
    end;
    end else
    begin;
    ScrollTP := Point(724, 423);
    if FindColorSpiralTolerance(ScrollTP.x,ScrollTP.y,1646629,719, 414,727, 425,10) then
    begin;
    Mouse(ScrollTP.x,ScrollTP.y,2,2,True);
    Timer := GetSystemTime;
    Repeat
    Wait(100 + Random(50));
    until ((GetSystemTime - Timer) > 10000) or (not FindColorTolerance(ScrollTP.x,ScrollTP.y,1646629,719, 414,727, 425,10))
    end;
    end;
    end;

    {*******************************************************************************
    function GetSkillInfo(skill: string; Amount : Boolean): Integer;
    By: Raymond
    Description: Gets the amount / level of a skill.
    E.G.
    0/15
    Amount = True will return 0.
    Amount = False will return 15 (The actual level).
    *******************************************************************************}

    function GetSkillInfo(skill: string; Amount : Boolean): Integer;
    var
    TP: TPoint;
    Box : TBox;
    TPA : TPointArray;
    Cts : Integer;
    begin
    GameTab(2);
    TP := SkillToCoords(True,skill);
    CTS := GetColorToleranceSpeed;
    ColorToleranceSpeed(0);
    if not Amount then
    TP := Point(TP.x + 7,TP.y + 13);
    FindColorsTolerance(TPA,65535,TP.x - 2,TP.y - 2, TP.x + 15,TP.y + 15,0);
    Box := GetTPABounds(TPA);
    Result := StrToIntDef(GetNumbers(GetTextAtEx(Box.x1-2, Box.y1 -1, 100,
    StatChars, False, True, 0, 5,65535, 2, True, tr_Digits)),0);
    ColorToleranceSpeed(CTS);
    end;

    {*******************************************************************************
    function Function GetMMLevels(LevelType : String;var ColorSign : String): integer;
    By: Raymond / Wizzup
    Description: Returns the level shown next to the minimap.
    Colorsign returns the color of the text (Green,Yellow,Orange,Red).
    Returns -1 if failed.
    *******************************************************************************}

    Function GetMMLevels(LevelType : String; var ColorSign : String): integer;
    var
    TP : TPoint;
    I: Integer;
    Colors : TIntegerArray;
    P: TPointArray;
    B: TBox;
    Signs : TStringArray;
    begin;
    Result := -1;
    ColorSign := '';
    Case LowerCase(Leveltype) of
    'health','hp','hitpoints' : TP := Point(729,29);
    'prayer','pray' : TP := Point(746,68);
    'run','energy' : TP := Point(740,107);
    else
    begin;
    Writeln('Wrong leveltype.');
    Exit;
    end;
    end;
    Colors := [65280,65535,2070783,255];
    Signs := ['Green','Yellow','Orange','Red'];
    For I := 0 to 3 do
    Begin
    FindColorsTolerance(P, Colors, TP.X - 5, TP.Y - 5, TP.X + 40, TP.Y + 20, 0);
    If Length(P) < 1 Then
    Continue;
    B := GetTPABounds(P);
    Result := StrToIntDef(GetNumbers(GetTextAtEx(B.X1 - 1 , B.Y1 - 1, 0, statChars,
    False, False, 0, 4, Colors, 20, False, tr_Digits)), 1);
    ColorSign := Signs;
    End;
    end;

    {*******************************************************************************
    function GetXP(Skill: String): Integer;
    By: Nielsie95
    Description: Returns current xp for a skill. Returns -1 if failed.
    *******************************************************************************}

    function GetXp(skill: string): Integer;
    var
    p: TPoint;
    i, tx, ty, x, y: Integer;
    begin
    Result := -1;
    if (not LoggedIn) or (not TabExists(2)) then Exit;
    GameTab(2);
    if (GetCurrentTab <> 2) then Exit;
    p := SkillToCoords(True,Skill);
    if (p.x < 1) then Exit;
    MMouse(p.x, p.y +5, 12, 4);
    while (not FindColor(x, y, 10551295, MIX1, MIY1, MIX2, MIY2)) and (i < 50) do
    begin
    Wait(100);
    Inc(i);
    end;
    Wait(200 + Random(150));
    if (not FindColor(x, y, 10551295, MIX1, MIY1, MIX2, MIY2)) then Exit;
    if IsTextInAreaEx(x, y, x + 60, y + 60, tx, ty, 'urrent', 0, SmallChars, False, False, 0, 1, 0) then
    Result := StrToIntDef(GetNumbers(GetTextAtEx(tx, ty, 0, SmallChars, False, True, 0, 1, 0, 50, False, tr_AllChars)), -1);
    end;

    {*******************************************************************************
    function XpTillNextLevel(Skill: String): Integer;
    By: Nielsie95
    Description: Returns current xp til you level up in a skill.
    Returns -1 if failed.
    *******************************************************************************}

    function XpTillNextLevel(Skill: string): Integer;
    var
    p: TPoint;
    i, tx, ty, x, y: Integer;
    begin
    Result := -1;
    if (not LoggedIn) or (not TabExists(2)) then Exit;
    GameTab(2);
    if (GetCurrentTab <> 2) then Exit;
    p := SkillToCoords(True,Skill);
    if (p.x < 1) then Exit;
    MMouse(p.x, p.y +5, 12, 4);
    while (not FindColor(x, y, 10551295, MIX1, MIY1, MIX2, MIY2)) and (i < 50) do
    begin
    Wait(100);
    Inc(i);
    end;
    Wait(200 + Random(150));
    if (not FindColor(x, y, 10551295, MIX1, MIY1, MIX2, MIY2)) then Exit;
    if IsTextInAreaEx(x, y, x + 60, y + 60, tx, ty, 'ainder', 0, SmallChars, False, False, 0, 1, 0) then
    Result := StrToIntDef(GetNumbers(GetTextAtEx(tx, ty, 0, SmallChars, False, True, 0, 1, 0, 50, False, tr_AllChars)), -1);
    end;

    {*******************************************************************************
    function HpPercent: Integer;
    By: RsN
    Description: Returns Hp left as a percentage
    *******************************************************************************}

    function HpPercent: Integer;
    var
    tlevel, tamount: Integer;
    begin
    tlevel := GetSkillInfo('hitpoints',False);
    tamount := GetSkillInfo('hitpoints',True);
    if tlevel = 0 then tlevel := 1;
    Result := (tamount * 100) / tlevel;
    end;

    {*******************************************************************************
    function GetHp: Integer;
    By: RsN
    Description: Returns Hp left as a level
    *******************************************************************************}

    function GetHp: Integer;

    begin
    Result := GetSkillInfo('hitpoints',True);
    end;

    {****************************************************************************//
    procedure GetAllLevels;
    By: WT-Fakawi
    Description: Sets all 21 skilllevels to Players.Level[21]

    * 1 8 15
    * 2 9 16
    * 3 10 17
    * 4 11 18
    * 5 12 19
    * 6 13 20
    * 7 14 21
    * 22 23 24

    * 1 = attack
    * 2 = strength
    * 3 = defence
    * 4 = range
    * 5 = prayer
    * 6 = magic
    * 7 = runecrafting
    * 8 = hitpoints
    * 9 = agility
    * 10 = herblore
    * 11 = thieving
    * 12 = crafting
    * 13 = fletching
    * 14 = slayer
    * 15 = mining
    * 16 = smithing
    * 17 = fishing
    * 18 = cooking
    * 19 = firemaking
    * 20 = woodcutting
    * 21 = farming
    * 22 = construction
    * 23 = hunting
    * 24 = summoning
    *******************************************************************************}

    procedure GetAllLevels;
    begin
    try
    Players[CurrentPlayer].level[1] := GetSkillInfo('attack',False);
    Players[CurrentPlayer].level[2] := GetSkillInfo('strength',False);
    Players[CurrentPlayer].level[3] := GetSkillInfo('defence',False);
    Players[CurrentPlayer].level[4] := GetSkillInfo('range',False);
    Players[CurrentPlayer].level[5] := GetSkillInfo('prayer',False);
    Players[CurrentPlayer].level[6] := GetSkillInfo('magic',False);
    Players[CurrentPlayer].level[7] := GetSkillInfo('runecrafting',False);
    Players[CurrentPlayer].level[8] := GetSkillInfo('hitpoints',False);
    Players[CurrentPlayer].level[9] := GetSkillInfo('agility',False);
    Players[CurrentPlayer].level[10] := GetSkillInfo('herblore',False);
    Players[CurrentPlayer].level[11] := GetSkillInfo('thieving',False);
    Players[CurrentPlayer].level[12] := GetSkillInfo('crafting',False);
    Players[CurrentPlayer].level[13] := GetSkillInfo('fletching',False);
    Players[CurrentPlayer].level[14] := GetSkillInfo('slayer',False);
    Players[CurrentPlayer].level[15] := GetSkillInfo('mining',False);
    Players[CurrentPlayer].level[16] := GetSkillInfo('smithing',False);
    Players[CurrentPlayer].level[17] := GetSkillInfo('fishing',False);
    Players[CurrentPlayer].level[18] := GetSkillInfo('cooking',False);
    Players[CurrentPlayer].level[19] := GetSkillInfo('firemaking',False);
    Players[CurrentPlayer].level[20] := GetSkillInfo('woodcutting',False);
    Players[CurrentPlayer].level[21] := GetSkillInfo('farming',False);
    // Players[CurrentPlayer].level[22] := GetSkillLevel('construction');
    // Players[CurrentPlayer].level[23] := GetSkillLevel('hunting');
    // Players[CurrentPlayer].level[24] := GetSkillLevel('summoning');
    except
    WriteLn('Could not get all skill levels');
    Exit;
    end;
    end;

    //****************************************************************************//
    // * GameTab 4 Related Functions. SEE ALSO INVENTORY.SCAR
    //****************************************************************************//

    //****************************************************************************//
    // * GameTab 5 Related Functions.
    //****************************************************************************//

    {*******************************************************************************
    function CurrentWorld: Integer;
    By: Cheesehunk and modified by Ron
    Description: Returns the current world you are on.
    *******************************************************************************}

    function CurrentWorld: Integer;
    var
    TextX, TextY: Integer;
    begin
    GameTab(8);
    Wait(50 + Random(50));
    if IsTextInAreaEx(645, 200, 700, 225, TextX, TextY, 'World', 30, upchars,
    True, False, 0, 0, -1) then
    begin
    try
    Result := StrToInt(Trim(GetTextAtEx(TextX + 36, TextY, 30, upchars, True, False, 0, 0,
    -1, 4, False, tr_Digits)));
    except
    Result := -1;
    WriteLn('ERROR: Getting current world failed.');
    end;
    end;
    end;

    {*******************************************************************************
    function EquipmentCoords(i : Integer) : TPoint;
    By: RsN modded by WT-Fakawi and Nielsie95
    Description: Returns X and Y of the coordinates of the specified equipment item
    *******************************************************************************}

    function EquipmentCoords(i: Integer): TPoint;
    begin
    case i of
    1: Result := IntToPoint(640, 225);
    2: Result := IntToPoint(600, 266);
    3: Result := IntToPoint(640, 266);
    4: Result := IntToPoint(684, 266);
    5: Result := IntToPoint(588, 304);
    6: Result := IntToPoint(644, 304);
    7: Result := IntToPoint(700, 304);
    8: Result := IntToPoint(642, 343);
    9: Result := IntToPoint(588, 384);
    10: Result := IntToPoint(643, 384);
    11: Result := IntToPoint(700, 384);
    end;
    end;

    {*******************************************************************************
    function WearingItem(i: Integer): Boolean;
    By: RsN
    Description: Results True if an item is equiped at i
    *******************************************************************************}

    function WearingItem(i: Integer): Boolean;
    var
    x, y:Integer;
    T: TPoint;
    begin
    GameTab(5);
    T := EquipmentCoords(i);
    If FindColor(x, y, 65536, T.x - 8, T.y - 8, T.x + 8, T.y + 8 ) then
    Result := True;
    end;

    {*******************************************************************************
    procedure TakeOff(i: Integer);
    By: RsN
    Description: UnEquips Item specified in i Needs specification!! (what is 1-i??)
    *******************************************************************************}

    procedure TakeOff(i: Integer);
    var
    T: TPoint;
    begin
    GameTab(5);
    T := EquipmentCoords(i);
    if (WearingItem(i)) then
    begin
    Mouse(T.x, T.y, 5, 5, True);
    Wait(200 + Random(100));
    end;
    end;

    {*******************************************************************************
    function CheckEquipItems(number: Integer): Boolean;
    By: SDcit
    Description: Sees if there are number items equiped and returns true if yes.
    *******************************************************************************}

    function CheckEquipItems(number: Integer): Boolean;
    // Sees if there are number items.
    var
    CheckCoords: Integer;
    x: integer;
    begin
    x := 0;
    begin
    for CheckCoords := 1 to 11 do
    begin
    if WearingItem(CheckCoords) then
    x := x + 1;
    end;
    if (x > number) then
    begin
    WriteLn('ERROR : You have more than ' + IntToStr(number) +
    ' items equiped.');
    WriteLn(' You have : ' + IntToStr(x) + ' Items equiped');
    Result := False;
    end else
    Result := True;
    end;
    end;

    //****************************************************************************//
    // * GameTab 6 Related Functions.
    //****************************************************************************//

    //****************************************************************************//
    // * GameTab 7 Related Functions.
    //****************************************************************************//

    //****************************************************************************//
    // * GameTab 8 Related Functions.
    //****************************************************************************//

    //****************************************************************************//
    // * GameTab 9 Related Functions.
    //****************************************************************************//

    //****************************************************************************//
    // * GameTab 10 Related Functions.
    //****************************************************************************//

    //****************************************************************************//
    // * GameTab 11 Related Functions.
    //****************************************************************************//
    {*******************************************************************************
    procedure SetRun(run: Boolean);
    By: Wizzup?
    Description: Sets Run on or off.
    *******************************************************************************}

    procedure SetRun(Run: Boolean);
    begin
    GameTab(11);
    case Run of
    True: if (GetColor(634, 421) = 5067346) then
    Mouse(647, 428, 8, 8, True);
    False: if (GetColor(634, 421) = 1974404) then
    Mouse(647, 428, 8, 8, True);
    end;
    end;

    {*******************************************************************************
    procedure RunControl(Run: Boolean);
    By: Wizzup?
    Description: Sets Run on or off, using control, DOES NOT stack with SetRun(),
    Use them seperately.
    *******************************************************************************}

    procedure RunControl(Run: Boolean);
    begin
    Wait(10 + Random(20));
    if Run then
    KeyDown(17)
    else
    KeyUp(17);
    Wait(10 + Random(20));
    end;

    {*******************************************************************************
    procedure SetBar(Bar: String; Point: Integer);
    By: Nielsie95
    Description: Set the value of a bar in the Tools screen.
    Valid arguments:
    * Brightness
    * Volume
    * Effect
    * Area
    Point Range: 1 - 4
    *******************************************************************************}

    procedure SetBar(Bar: String; Point: Integer);
    var
    P: TPoint;
    x, y: integer;
    begin
    if (not LoggedIn) then Exit;
    if (Point < 0) or (Point > 4) then Exit;
    GameTab(11);
    Wait(100 +Random(50));
    case LowerCase(Bar) of
    'brightness': P := IntToPoint(577 + (Point * 34) , 229);
    'volume': P := IntToPoint(577 + (Point * 34) , 266);
    'effect': P := IntToPoint(577 + (Point * 34) , 302);
    'area': P := IntToPoint(577 + (Point * 34) , 339);
    else WriteLn('ERROR: Unknown bar!');
    end;

    if not FindColorTolerance(x, y, 10172937, P.x -6, P.y -6, P.x +6, P.y +6, 10) then
    Mouse(P.x, P.y, 3, 3, True);
    end;

    //****************************************************************************//
    // * GameTab 12 Related Functions.
    //****************************************************************************//

    {*****************************************************************************
    procedure DoEmote(EmoteNumber: Integer);
    By: Sumilion
    Description: Clicks on an emote specified by EmoteNumber (1 to 37)
    *****************************************************************************}

    procedure DoEmote(EmoteNumber: Integer);
    var
    row, X1, Y1, X2, Y2, Others: Integer;
    begin
    if (EmoteNumber > 37) or (EmoteNumber < 1) then Exit;
    GameTab(12);
    if (EmoteNumber > 20) then
    begin
    if (GetColor(734, 442) = 1777699) then
    Mouse(734, 442, 10, 10, True);
    Others := 10;
    end else if (GetColor(733, 224) = 1777699) then
    Mouse(733, 224, 10, 10, True);
    if (EmoteNumber > 4) then
    begin
    repeat;
    row := row + 1;
    EmoteNumber := EmoteNumber - 4;
    until (EmoteNumber <= 4) or (row = 10)
    end;
    if (row >= 5) then
    row := row - 5;
    EmoteNumber := EmoteNumber - 1;
    X1 := 554 + (43 * EmoteNumber);
    Y1 := 211 + (49 * row) + Others;
    X2 := 592 + (43 * EmoteNumber);
    Y2 := 257 + (49 * row) + Others;
    MouseBox(X1 + 10, Y1 + 10, X2 - 10, Y2 - 10, 1);
    end;
     
  2. cazax

    cazax Forum Addict

    Joined:
    Nov 13, 2007
    Posts:
    457
    Referrals:
    0
    Sythe Gold:
    0
    Help with scar script.

    You have to include srl:
     
< Greets | Need good fishing script for scar 3.12 >


 
 
Adblock breaks this site