Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Interfaces base done

  • Loading branch information...
commit 4f0d9dd2dba1b8d047f4049a49d4f82bd0ebff40 1 parent 547f97a
Trenton Smith tlsdude authored
61 Modules/Core/Core.simba
@@ -11,6 +11,67 @@ begin
11 11 Writeln('['+Category+'] '+Message);
12 12 end;
13 13
  14 +(*
  15 +R_TrimHTML
  16 +~~~~~~~~~~
  17 +
  18 +.. code-block:: pascal
  19 +
  20 + function R_TrimHTML(S : string): string;
  21 +
  22 +Removes the HTML junk from a string.
  23 +
  24 +.. note::
  25 +
  26 + by lordsaturn, pyroryan
  27 +
  28 +*)
  29 +function R_TrimHTML(S : string): string;
  30 +var
  31 + P, P2, PLength: integer;
  32 + Temp: string;
  33 +begin
  34 + P := Pos('<', S);
  35 + P2 := Pos('>', S);
  36 + Result := S;
  37 + PLength := P2 - P + 1;
  38 + while (P <> 0) and (P2 <> 0) do
  39 + begin
  40 + Delete(Result, P, PLength);
  41 + P := Pos('<', Result);
  42 + Temp := Result;
  43 + Delete(Temp, 1, P - 1);
  44 + PLength := Pos('>', Temp);
  45 + end;
  46 +end;
  47 +
  48 +(*
  49 +R_StrInArr
  50 +~~~~~~~~~~
  51 +
  52 +.. code-block:: pascal
  53 +
  54 + function R_StrInArr(str: string; arrS: TStringArray): Boolean;
  55 +
  56 +Returns True if str is found in the Array. Case sensitive. Uses Pos.
  57 +
  58 +.. note::
  59 +
  60 + by Narcle, Nava2
  61 +
  62 +*)
  63 +function R_StrInArr(str: string; arrS: TStringArray): Boolean;
  64 +var
  65 + I, L, H: Integer;
  66 +begin
  67 + Result := True;
  68 + L := Low(arrS); H := High(arrS);
  69 + for I := L to H do
  70 + if Pos(Str, arrS[I]) > 0 then
  71 + Exit;
  72 + Result := False;
  73 +end;
  74 +
14 75 {$include_once Hooks.simba}
15 76 {$include_once SMART.simba}
16 77 {$include_once Globals.simba}
144 Modules/Core/Globals.simba
@@ -23,3 +23,147 @@ var
23 23 {$IFDEF UseLaptopMouse}
24 24 R_LMouse_MissChance: Integer;
25 25 {$ENDIF}
  26 +
  27 +const
  28 + NULL_INT = -1;
  29 + NULL_STRING = '';
  30 +
  31 + {Gametab constants}
  32 + INTERFACE_GAMETAB = 548;
  33 + INTERFACE_GAMETAB_FACENORTH = 177;
  34 +
  35 + RTAB_FRIENDSLIST = 99;
  36 + RTAB_CHAT = 100;
  37 + RTAB_CLANCHAT = 101;
  38 + RTAB_OPTIONS = 102;
  39 + RTAB_EMOTES = 103;
  40 + RTAB_MUSIC = 104;
  41 + RTAB_NOTES = 105;
  42 + RTAB_COMBAT = 128;
  43 + RTAB_TASKS = 129;
  44 + RTAB_STATS = 130;
  45 + RTAB_QUESTS = 131;
  46 + RTAB_INVENTORY = 132;
  47 + RTAB_EQUIPMENT = 133;
  48 + RTAB_PRAYER = 134;
  49 + RTAB_SPELLBOOK = 135;
  50 +
  51 + INTERFACE_HITPOINTS = 748;
  52 + INTERFACE_PRAYER = 749;
  53 + INTERFACE_RUN = 750;
  54 + INTERFACE_SUMMONING = 747;
  55 + INTERFACE_WORLDMAP = 755;
  56 + INTERFACE_WORLDMAP_CLOSE = 44;
  57 +
  58 + SETTING_RUN = 173;
  59 +
  60 + {Inventory Constants}
  61 + INTERFACE_INVENTORY = 679;
  62 + INTERFACE_BANKINVENTORY = 763;
  63 +
  64 + {Equipment Constants}
  65 + INTERFACE_EQUIPMENT = 387;
  66 +
  67 + EQUIPMENT_HELMET = 8;
  68 + EQUIPMENT_CAPE = 11;
  69 + EQUIPMENT_NECKLACE = 14;
  70 + EQUIPMENT_WEAPON = 17;
  71 + EQUIPMENT_TORSO = 20;
  72 + EQUIPMENT_SHIELD = 23;
  73 + EQUIPMENT_LEGS = 26;
  74 + EQUIPMENT_GLOVES = 29;
  75 + EQUIPMENT_BOOTS = 32;
  76 + EQUIPMENT_RING = 35;
  77 + EQUIPMENT_AMMO = 38;
  78 +
  79 + {Quest Constants}
  80 + INTERFACE_QUESTS = 190;
  81 + INTERFACE_QUESTINFO = 275;
  82 + INTERFACE_QUESTSTART = 178;
  83 + QUEST_INFO_NAME = 2;
  84 + QUEST_INFO_CLOSE = 8;
  85 + QUEST_START_YES = 78;
  86 + QUEST_POINTS = 2;
  87 + QUEST_LIST = 18;
  88 + QUEST_SCROLL = 17;
  89 + QUEST_FILTER = 10;
  90 + QUEST_DONE = 12;
  91 + QUEST_CHECKED = 699;
  92 + QUEST_STARTED = 65535;
  93 + QUEST_UNSTARTED = 16711680;
  94 + QUEST_COMPLETE = 65280;
  95 + QUEST_FILTERED = 2236962;
  96 + QUEST_UNKNOWN = -1;
  97 +
  98 + {Player Model Constants}
  99 + MODEL_EQUIPMENT_CONSTANT = 1073741824;
  100 +
  101 + MODEL_EQUIPMENT_HEAD = 0;
  102 + MODEL_EQUIPMENT_CAPE = 1;
  103 + MODEL_EQUIPMENT_NECK = 2;
  104 + MODEL_EQUIPMENT_WEAPON = 3;
  105 + MODEL_EQUIPMENT_BODY = 4;
  106 + MODEL_EQUIPMENT_SHIELD = 5;
  107 + MODEL_EQUIPMENT_LEGS = 7;
  108 + MODEL_EQUIPMENT_HANDS = 9;
  109 + MODEL_EQUIPMENT_BOOTS = 10;
  110 +
  111 + {Object Constants}
  112 + OBJ_INTERACTABLE = 1;
  113 + OBJ_WALLOBJECT = 2;
  114 + OBJ_WALLDECORATION = 3;
  115 + OBJ_FLOORDECORATION = 4;
  116 +
  117 + {Bank Constants}
  118 + INTERFACE_BANK = 762;
  119 + INTERFACE_BANK_BTN_CLOSE = 43;
  120 + INTERFACE_BANK_BTN_DEPOSITBAG = 33;
  121 + INTERFACE_BANK_BTN_DEPOSITEQUIP = 35;
  122 + INTERFACE_BANK_BTN_DEPOSITBEAST = 37;
  123 + INTERFACE_BANK_BTN_NOTE = 19;
  124 +
  125 + INTERFACE_BANK_SLOTS = 93;
  126 + INTERFACE_BANK_SLOTS_MAX = 515;
  127 +
  128 + INTERFACE_BANK_SCROLLBAR = 114;
  129 + INTERFACE_BANK_SCROLLBAR_BAR = 1;
  130 + INTERFACE_BANK_SCROLLBAR_BARTOP = 2;
  131 + INTERFACE_BANK_SCROLLBAR_BARBOT = 3;
  132 + INTERFACE_BANK_SCROLLBAR_UP = 4;
  133 + INTERFACE_BANK_SCROLLBAR_DOWN = 5;
  134 +
  135 + INTERFACE_PINSCREEN = 13;
  136 +
  137 + INTERFACE_DEPOSITBOX = 11;
  138 +
  139 + TEXTURE_BANKTABSELECTED = 1419;
  140 + TEXTURE_WITHDRAWMODE_NOTED = 1433;
  141 +
  142 + {Chat Constants}
  143 + INTERFACE_CHAT = 137;
  144 + INTERFACE_CHAT_OPTIONS = 751;
  145 + INTERFACE_CHAT_SCROLL = 59;
  146 +
  147 + RCHAT_GAME = 31;
  148 + RCHAT_PUBLIC = 28;
  149 + RCHAT_PRIVATE = 25;
  150 + RCHAT_FRIENDS = 8;
  151 + RCHAT_CLAN = 22;
  152 + RCHAT_TRADE = 19;
  153 + RCHAT_ASSIST = 16;
  154 +
  155 + {Misc Constants}
  156 + CROSSHAIR_NONE = 0;
  157 + CROSSHAIR_YELLOW = 1;
  158 + CROSSHAIR_RED = 2;
  159 + INTERFACE_LOGIN_SCREEN = 596;
  160 + INTERFACE_LOBBY_SCREEN = 907;
  161 +
  162 + {Interface Constants}
  163 + SEARCH_NAME = 0;
  164 + SEARCH_TEXT = 1;
  165 + SEARCH_ACTION = 2;
  166 +
  167 +
  168 + SCROLLBAR_UP = 4;
  169 + SCROLLBAR_DOWN = 5;
516 Modules/Core/Hooks.simba
... ... @@ -1,356 +1,366 @@
1 1 const
2   - ClientVersion = 663;
3   - HookRev = 4;
  2 + ClientVersion = 664;
  3 + HookRev = 2;
4 4
5 5 {Static Hooks}
6   - hook_static_LoginIndex = 'fia.e';
7   - hook_static_CamPosX = 'fea.q';
8   - hook_static_CamPosY = 'hea.x';
9   - hook_static_CamPosZ = 'lp.l';
10   - hook_static_CameraPitch = 'ha.i';
11   - hook_static_CameraYaw = 'wca.e';
12   - hook_static_ChatLines = 'sla.g';
13   - hook_static_MyPlayer = 'ho.D';
14   - hook_static_BaseX = 'wk.Lb';
15   - hook_static_BaseY = 'kl.a';
16   - hook_static_MapAngle = 'uo.E';
17   - hook_static_NPCIndexArray = 'db.f';
18   - hook_static_LoopCycle = 'ig.r';
19   - hook_static_NPCNC = 'tg.N';
20   - hook_static_ItemDefLoader = 'hj.E';
21   - hook_static_ObjectDefLoader = 'cc.f';
22   - hook_static_NPCNodes = 'cs.d';
23   - hook_static_GroundSettingsArray = 'aca.u';
24   - hook_static_LoadedPlane = 'wj.a';
25   - hook_static_PlaneArray = 'ud.d';
26   - hook_static_Toolkit = 'pi.i';
27   - hook_static_CollapsedMenuItems = 'rk.d';
28   - hook_static_MenuNodeList = 'rq.a';
29   - hook_static_MenuOpen = 'rk.e';
30   - hook_static_MenuOptionCount = 'it.g';
31   - hook_static_MenuCollapsedOptionsCount = 'kha.b';
32   - hook_static_MenuX = 'dma.k';
33   - hook_static_MenuY = 'bw.v';
34   - hook_static_MenuWidth = 'ula.a';
35   - hook_static_MenuHeight = 'fo.m';
36   - hook_static_MenuHeight2 = 'ma.C';
37   - hook_static_MenuWidth2 = 'tja.p';
38   - hook_static_MenuY2 = 'ww.p';
39   - hook_static_MenuX2 = 'tha.l';
40   - hook_static_IsMenuTabbed = 'lj.e';
41   - hook_static_Interfaces = 'mq.q';
42   - hook_static_ValidInterfaces = 'ii.f';
43   - hook_static_InterfaceBoundsArray = 'rj.d';
44   - hook_static_InterfaceDismissBounds = 'fw.a';
45   - hook_static_InterfaceNC = 'fca.a';
46   - hook_static_Settings = 'se.z';
47   - hook_static_GroundItemCache = 'bh.G';
48   - hook_static_GroundDataArray = 'vf.e';
49   - hook_static_SkillExperiences = 'lm.w';
50   - hook_static_SkillLevels = 'jea.l';
51   - hook_static_DestX = 'pf.f';
52   - hook_static_DestY = 'pl.k';
53   - hook_static_PlayerCount = 'rla.w';
54   - hook_static_PlayerIndexArray = 'mv.e';
55   - hook_static_Players = 'vga.g';
56   - hook_static_NPCCount = 'kk.d';
57   - hook_static_GroundTiles = 'sha.j';
58   - hook_static_CrossHairColor = 'jba.i';
  6 + hook_static_LoginIndex = 'ld.D';
  7 + hook_static_CamPosX = 'nl.ib';
  8 + hook_static_CamPosY = 'gq.H';
  9 + hook_static_CamPosZ = 'mw.w';
  10 + hook_static_CameraPitch = 'sj.nc';
  11 + hook_static_CameraYaw = 'tfa.b';
  12 + hook_static_ChatLines = 'cu.l';
  13 + hook_static_MyPlayer = 'hj.O';
  14 + hook_static_BaseX = 'hk.e';
  15 + hook_static_BaseY = 'ha.e';
  16 + hook_static_MapAngle = 'gl.m';
  17 + hook_static_NPCIndexArray = 'ifa.a';
  18 + hook_static_LoopCycle = 'qo.r';
  19 + hook_static_NPCNC = 'or.e';
  20 + hook_static_ItemDefLoader = 'rd.q';
  21 + hook_static_ObjectDefLoader = 'eka.b';
  22 + hook_static_NPCNodes = 'ok.e';
  23 + hook_static_GroundSettingsArray = 'mfa.h';
  24 + hook_static_LoadedPlane = 'vl.g';
  25 + hook_static_PlaneArray = 'et.E';
  26 + hook_static_Toolkit = 'mi.c';
  27 + hook_static_CollapsedMenuItems = 'nca.m';
  28 + hook_static_MenuNodeList = 'ij.e';
  29 + hook_static_MenuOpen = 'fu.u';
  30 + hook_static_MenuOptionCount = 'qv.J';
  31 + hook_static_MenuCollapsedOptionsCount = 'ad.f';
  32 + hook_static_MenuX = 'gn.s';
  33 + hook_static_MenuY = 'gma.h';
  34 + hook_static_MenuWidth = 'wba.b';
  35 + hook_static_MenuHeight = 'o.i';
  36 + hook_static_MenuX2 = 'ic.g';
  37 + hook_static_MenuY2 = 'rk.m';
  38 + hook_static_MenuWidth2 = 'aia.a';
  39 + hook_static_MenuHeight2 = 'rr.b';
  40 + hook_static_IsMenuTabbed = 'wq.i';
  41 + hook_static_Interfaces = 'sha.f';
  42 + hook_static_ValidInterfaces = 'bca.e';
  43 + hook_static_InterfaceBoundsArray = 'g.j';
  44 + hook_static_InterfaceDismissBounds = 'r.y';
  45 + hook_static_InterfaceNC = 'om.q';
  46 + hook_static_Settings = 'mi.a';
  47 + hook_static_GroundItemCache = 'st.j';
  48 + hook_static_GroundDataArray = 'ts.d';
  49 + hook_static_GrandExchange = 'vc.d';
  50 + hook_static_SkillExperiences = 'aa.a';
  51 + hook_static_SkillLevels = 'uda.h';
  52 + hook_static_DestX = 'mfa.a';
  53 + hook_static_DestY = 'lm.k';
  54 + hook_static_PlayerCount = 'iga.l';
  55 + hook_static_PlayerIndexArray = 'su.c';
  56 + hook_static_Players = 'es.j';
  57 + hook_static_NPCCount = 'go.d';
  58 + hook_static_GroundTiles = 'ua.p';
  59 + hook_static_CrossHairColor = 'nja.B';
59 60
60 61 {Class SDModel}
61   - class_SDModel = 'hma';
62   - hook_sdmodel_Indices1 = 'J';
63   - hook_sdmodel_Indices2 = 'ub';
64   - hook_sdmodel_Indices3 = 'y';
65   - hook_sdmodel_PointsX = 'sb';
66   - hook_sdmodel_PointsY = 'vb';
67   - hook_sdmodel_PointsZ = 'Mb';
  62 + class_SDModel = 'mc';
  63 + hook_sdmodel_Indices1 = 'X';
  64 + hook_sdmodel_Indices2 = 'L';
  65 + hook_sdmodel_Indices3 = 'Pb';
  66 + hook_sdmodel_PointsX = 'Lb';
  67 + hook_sdmodel_PointsY = 'Q';
  68 + hook_sdmodel_PointsZ = 'Z';
68 69
69 70 {Class ChatLine}
70   - class_ChatLine = 'dw';
71   - hook_chatline_Name = 'c';
72   - hook_chatline_Message = 'a';
73   - hook_chatline_Type = 'h';
  71 + class_ChatLine = 'wl';
  72 + hook_chatline_Name = 'k';
  73 + hook_chatline_Message = 'e';
  74 + hook_chatline_Type = 'j';
74 75
75 76 {Class Animable}
76   - class_Animable = 'bla';
77   - hook_animable_PixelX = 'i';
78   - hook_animable_PixelY = 'q';
79   - hook_animable_Plane = 'p';
  77 + class_Animable = 'tl';
  78 + hook_animable_PixelX = 'n';
  79 + hook_animable_PixelY = 'i';
  80 + hook_animable_Plane = 's';
80 81
81 82 {Class Player}
82   - class_Player = 'oba';
83   - hook_player_Level = 'hd';
84   - hook_player_Name = 'Vc';
85   - hook_player_Team = 'ed';
86   - hook_player_PlayerDef = 'Sc';
  83 + class_Player = 'bi';
  84 + hook_player_Team = 'Ed';
  85 + hook_player_Level = 'Ad';
  86 + hook_player_Name = 'Kc';
  87 + hook_player_PlayerDef = 'ed';
87 88
88 89 {Class Character}
89   - class_Character = 'wka';
90   - hook_character_Motion = 'lc';
91   - hook_character_AnimationQueue = 'jb';
92   - hook_character_Animation = 'Fb';
93   - hook_character_WalkQueueX = 'wc';
94   - hook_character_WalkQueueY = 'lb';
95   - hook_character_Height = 'bc';
96   - hook_character_Orientation = 'sb';
97   - hook_character_LoopCycleStatus = 'Dc';
98   - hook_character_HPRatio = 'Fc';
99   - hook_character_Interacting = 'ib';
  90 + class_Character = 'sj';
  91 + hook_character_Motion = 'zc';
  92 + hook_character_AnimationQueue = 'db';
  93 + hook_character_Animation = 'mb';
  94 + hook_character_WalkQueueX = 'ec';
  95 + hook_character_WalkQueueY = 'Ib';
  96 + hook_character_Height = 'cc';
  97 + hook_character_Orientation = 'Nb';
  98 + hook_character_LoopCycleStatus = 'N';
  99 + hook_character_HPRatio = 'Vb';
  100 + hook_character_Interacting = 'Ac';
100 101
101 102 {Class AnimableNode}
102   - class_AnimableNode = 'sla';
103   - hook_animablenode_Animable = 'f';
104   - hook_animablenode_Next = 'b';
  103 + class_AnimableNode = 'gma';
  104 + hook_animablenode_Animable = 'i';
  105 + hook_animablenode_Next = 'g';
105 106
106 107 {Class AnimableEntity}
107   - class_AnimableEntity = 'qfa';
108   - hook_animableentity_AreaX1 = 'D';
109   - hook_animableentity_AreaX2 = 'x';
110   - hook_animableentity_AreaY1 = 'I';
111   - hook_animableentity_AreaY2 = 'E';
  108 + class_AnimableEntity = 'kg';
  109 + hook_animableentity_AreaX1 = 'E';
  110 + hook_animableentity_AreaX2 = 'D';
  111 + hook_animableentity_AreaY1 = 'J';
  112 + hook_animableentity_AreaY2 = 'I';
112 113
113 114 {Class PlayerDef}
114   - class_PlayerDef = 'maa';
115   - hook_playerdef_Equipment = 'i';
  115 + class_PlayerDef = 'ffa';
  116 + hook_playerdef_Equipment = 'd';
116 117
117 118 {Class Animation}
118   - class_Animation = 'js';
119   - hook_animation_Def = 'm';
  119 + class_Animation = 'cb';
  120 + hook_animation_Def = 'B';
120 121
121 122 {Class AnimationDef}
122   - class_AnimationDef = 'bg';
123   - hook_animationdef_ID = 't';
  123 + class_AnimationDef = 'qea';
  124 + hook_animationdef_ID = 'p';
124 125
125 126 {Class NodeCache}
126   - class_NodeCache = 'gn';
127   - hook_nodecache_Nodes = 'h';
  127 + class_NodeCache = 'lba';
  128 + hook_nodecache_Nodes = 'i';
128 129
129 130 {Class Item}
130   - class_Item = 'tha';
131   - hook_item_ID = 'j';
132   - hook_item_Stack = 'm';
  131 + class_Item = 'qo';
  132 + hook_item_ID = 'q';
  133 + hook_item_Stack = 'n';
133 134
134 135 {Class NodeListCache}
135   - class_NodeListCache = 'eja';
136   - hook_nodelistcache_NodeList = 'u';
  136 + class_NodeListCache = 'uq';
  137 + hook_nodelistcache_NodeList = 'm';
137 138
138 139 {Class NodeList}
139   - class_NodeList = 'tj';
140   - hook_nodelist_Current = 'q';
141   - hook_nodelist_Head = 'd';
  140 + class_NodeList = 'cga';
  141 + hook_nodelist_Current = 'h';
  142 + hook_nodelist_Head = 'c';
142 143
143 144 {Class Node}
144   - class_Node = 'an';
145   - hook_node_Next = 'd';
146   - hook_node_Previous = 'a';
  145 + class_Node = 'hh';
  146 + hook_node_Next = 'j';
  147 + hook_node_Previous = 'c';
147 148 hook_node_ID = 'g';
148 149
149 150 {Class ItemDefLoader}
150   - class_ItemDefLoader = 'wo';
151   - hook_itemdefloader_Models = 'g';
152   - hook_itemdefloader_Composites = 't';
  151 + class_ItemDefLoader = 'bg';
  152 + hook_itemdefloader_Models = 'u';
  153 + hook_itemdefloader_Composites = 'p';
153 154
154 155 {Class ItemDef}
155   - class_ItemDef = 'eh';
156   - hook_itemdef_Loader = 'eb';
157   - hook_itemdef_Actions = 'b';
158   - hook_itemdef_GroundActions = 'Bb';
  156 + class_ItemDef = 'k';
  157 + hook_itemdef_Loader = 'P';
  158 + hook_itemdef_Actions = 'Y';
  159 + hook_itemdef_GroundActions = 'Z';
159 160
160 161 {Class MRUNodes}
161   - class_MRUNodes = 'si';
162   - hook_mrunodes_NodeCache = 'r';
  162 + class_MRUNodes = 'dka';
  163 + hook_mrunodes_NodeCache = 'v';
163 164
164 165 {Class ObjectDefLoader}
165   - class_ObjectDefLoader = 'rka';
166   - hook_objectdefloader_Models = 'c';
167   - hook_objectdefloader_Composites = 'm';
  166 + class_ObjectDefLoader = 'hg';
  167 + hook_objectdefloader_Models = 'w';
  168 + hook_objectdefloader_Composites = 'u';
168 169
169 170 {Class ObjectDef}
170   - class_ObjectDef = 'hca';
171   - hook_objectdef_Loader = 'Fb';
172   - hook_objectdef_Actions = 'tb';
173   - hook_objectdef_Name = 'W';
174   - hook_objectdef_SettingIndex = 'Pb';
175   - hook_objectdef_ChildrenIDs = 'T';
  171 + class_ObjectDef = 'dga';
  172 + hook_objectdef_Loader = 'gb';
  173 + hook_objectdef_Actions = 'X';
  174 + hook_objectdef_Name = 'Fb';
  175 + hook_objectdef_SettingIndex = 'H';
  176 + hook_objectdef_ChildrenIDs = 'm';
176 177
177 178 {Class NPC}
178   - class_NPC = 'gja';
179   - hook_npc_NPCDef = 'jd';
180   - hook_npc_Level = 'Nc';
  179 + class_NPC = 'efa';
  180 + hook_npc_NPCDef = 'Kc';
  181 + hook_npc_Level = 'Tc';
181 182
182 183 {Class NPCDef}
183   - class_NPCDef = 'at';
184   - hook_npcdef_Name = 'D';
185   - hook_npcdef_Actions = 'ob';
186   - hook_npcdef_Loader = 'db';
187   - hook_npcdef_Level = 'A';
188   - hook_npcdef_ID = 'R';
189   - hook_npcdef_ChildrenIDs = 'O';
190   - hook_npcdef_SettingIndex = 'b';
  184 + class_NPCDef = 'nl';
  185 + hook_npcdef_Actions = 'j';
  186 + hook_npcdef_Name = 'gb';
  187 + hook_npcdef_Loader = 'i';
  188 + hook_npcdef_Level = 'db';
  189 + hook_npcdef_ID = 'O';
  190 + hook_npcdef_ChildrenIDs = 'a';
  191 + hook_npcdef_SettingIndex = 'm';
191 192
192 193 {Class NPCDefLoader}
193   - class_NPCDefLoader = 'eba';
194   - hook_npcdefloader_Models = 'i';
195   - hook_npcdefloader_Composites = 'p';
  194 + class_NPCDefLoader = 'bja';
  195 + hook_npcdefloader_Models = 'n';
  196 + hook_npcdefloader_Composites = 'l';
196 197
197 198 {Class NPCNode}
198   - class_NPCNode = 'cd';
199   - hook_npcnode_NPC = 'n';
  199 + class_NPCNode = 'rga';
  200 + hook_npcnode_NPC = 'o';
200 201
201 202 {Class SDPlane}
202 203 class_SDPlane = 's';
203   - hook_sdplane_TileHeights = 'l';
  204 + hook_sdplane_TileHeights = 'g';
204 205
205 206 {Class GraphicsToolkit}
206 207 class_GraphicsToolkit = 'ha';
207   - hook_graphicstoolkit_Index = 'd';
  208 + hook_graphicstoolkit_Index = 'r';
208 209
209 210 {Class SDViewport}
210   - class_SDViewport = 'nm';
211   - hook_sdviewport_xOff = 'i';
212   - hook_sdviewport_xX = 'C';
213   - hook_sdviewport_xY = 'g';
214   - hook_sdviewport_xZ = 'o';
215   - hook_sdviewport_yOff = 'p';
216   - hook_sdviewport_yX = 'I';
217   - hook_sdviewport_yY = 'n';
218   - hook_sdviewport_yZ = 'z';
219   - hook_sdviewport_zOff = 'B';
220   - hook_sdviewport_zX = 'l';
221   - hook_sdviewport_zY = 'K';
222   - hook_sdviewport_zZ = 'x';
  211 + class_SDViewport = 'pja';
  212 + hook_sdviewport_xOff = 'A';
  213 + hook_sdviewport_xX = 'e';
  214 + hook_sdviewport_xY = 'D';
  215 + hook_sdviewport_xZ = 'C';
  216 + hook_sdviewport_yOff = 'j';
  217 + hook_sdviewport_yX = 'g';
  218 + hook_sdviewport_yY = 'f';
  219 + hook_sdviewport_yZ = 'F';
  220 + hook_sdviewport_zOff = 't';
  221 + hook_sdviewport_zX = 'y';
  222 + hook_sdviewport_zY = 'k';
  223 + hook_sdviewport_zZ = 'I';
223 224
224 225 {Class SDToolkit}
225   - class_SDToolkit = 'rea';
226   - hook_sdtoolkit_Viewport = 'N';
227   - hook_sdtoolkit_xMin = 'O';
228   - hook_sdtoolkit_xMax = 'A';
229   - hook_sdtoolkit_yMin = 'G';
230   - hook_sdtoolkit_yMax = 'M';
231   - hook_sdtoolkit_zMin = 'pb';
232   - hook_sdtoolkit_zMax = 'B';
233   - hook_sdtoolkit_xScale = 'R';
234   - hook_sdtoolkit_yScale = 'rb';
  226 + class_SDToolkit = 'lq';
  227 + hook_sdtoolkit_Viewport = 'bb';
  228 + hook_sdtoolkit_xMin = 'gb';
  229 + hook_sdtoolkit_xMax = 'U';
  230 + hook_sdtoolkit_yMin = 'nb';
  231 + hook_sdtoolkit_yMax = 'S';
  232 + hook_sdtoolkit_zMin = 'cb';
  233 + hook_sdtoolkit_zMax = 'F';
  234 + hook_sdtoolkit_xScale = 'z';
  235 + hook_sdtoolkit_yScale = 'E';
235 236
236 237 {Class MenuGroupNode}
237   - class_MenuGroupNode = 'q';
238   - hook_menugroupnode_NodeSubListItems = 'z';
  238 + class_MenuGroupNode = 'jb';
  239 + hook_menugroupnode_NodeSubListItems = 'B';
239 240
240 241 {Class NodeSubList}
241   - class_NodeSubList = 'pda';
  242 + class_NodeSubList = 'vl';
242 243 hook_nodesublist_Head = 'i';
243 244
244 245 {Class NodeSub}
245   - class_NodeSub = 'ffa';
246   - hook_nodesub_Next = 'r';
  246 + class_NodeSub = 'no';
  247 + hook_nodesub_Next = 'p';
247 248
248 249 {Class Menu}
249   - class_Menu = 'ej';
250   - hook_menu_Action = 'y';
251   - hook_menu_Option = 'N';
  250 + class_Menu = 'tt';
  251 + hook_menu_Action = 'A';
  252 + hook_menu_Option = 'y';
252 253
253 254 {Class Interface}
254   - class_Interface = 'av';
255   - hook_interface_TextColor = 'ad';
  255 + class_Interface = 'oh';
  256 + hook_interface_TextColor = 'U';
256 257 hook_interface_ModelZoom = 'Ec';
257   - hook_interface_ModelID = 'a';
258   - hook_interface_X = 'ub';
259   - hook_interface_Y = 'Ub';
260   - hook_interface_Width = 'fb';
261   - hook_interface_Height = 'tc';
262   - hook_interface_IsHidden = 'yd';
263   - hook_interface_ParentID = 'Gb';
264   - hook_interface_ID = 'zd';
265   - hook_interface_ComponentID = 'q';
266   - hook_interface_ComponentStackSize = 'mb';
267   - hook_interface_Actions = 'pc';
268   - hook_interface_ComponentName = 'W';
269   - hook_interface_Text = 'Oc';
270   - hook_interface_TextureID = 'Cb';
271   - hook_interface_Children = 'tb';
272   - hook_interface_BoundsArrayIndex = 'pb';
273   - hook_interface_HorizontalScrollBarSize = 'Yc';
274   - hook_interface_VerticalScrollBarSize = 'b';
275   - hook_interface_HorizontalScrollBarPosition = 'rd';
276   - hook_interface_HorizontalScrollBarThumbSize = 'fb';
277   - hook_interface_VerticalScrollBarPosition = 'ac';
278   - hook_interface_VerticalScrollBarThumbSize = 'tc';
  258 + hook_interface_ModelID = 'Zc';
  259 + hook_interface_X = 'vb';
  260 + hook_interface_Y = 'wb';
  261 + hook_interface_Width = 'V';
  262 + hook_interface_Height = 'Pb';
  263 + hook_interface_IsHidden = 'bb';
  264 + hook_interface_ParentID = 'H';
  265 + hook_interface_ID = 'ob';
  266 + hook_interface_ComponentID = 'xb';
  267 + hook_interface_ComponentStackSize = 'Uc';
  268 + hook_interface_Actions = 'nd';
  269 + hook_interface_ComponentName = 'c';
  270 + hook_interface_Text = 'qb';
  271 + hook_interface_TextureID = 'nc';
  272 + hook_interface_Children = 'n';
  273 + hook_interface_BoundsArrayIndex = 'tc';
  274 + hook_interface_HorizontalScrollBarSize = 'rd';
  275 + hook_interface_VerticalScrollBarSize = 'kb';
  276 + hook_interface_HorizontalScrollBarPosition = 'Bb';
  277 + hook_interface_HorizontalScrollBarThumbSize = 'V';
  278 + hook_interface_VerticalScrollBarPosition = 'bc';
  279 + hook_interface_VerticalScrollBarThumbSize = 'Pb';
279 280
280 281 {Class InterfaceNode}
281   - class_InterfaceNode = 'tv';
282   - hook_interfacenode_ID = 'k';
  282 + class_InterfaceNode = 'fka';
  283 + hook_interfacenode_ID = 'o';
283 284
284 285 {Class SettingArray}
285   - class_SettingArray = 'ud';
286   - hook_settingarray_Data = 'n';
  286 + class_SettingArray = 'es';
  287 + hook_settingarray_Data = 'i';
287 288
288 289 {Class SoftReference}
289   - class_SoftReference = 'eea';
  290 + class_SoftReference = 'ni';
290 291 hook_softreference_Reference = 'B';
291 292
292 293 {Class HardReference}
293   - class_HardReference = 'cfa';
294   - hook_hardreference_Object = 'I';
  294 + class_HardReference = 'mn';
  295 + hook_hardreference_Object = 'E';
295 296
296 297 {Class Ground}
297   - class_Ground = 'nt';
298   - hook_ground_FloorDecoration = 'f';
299   - hook_ground_WallDecoration2 = 'v';
300   - hook_ground_WallDecoration1 = 'k';
301   - hook_ground_WallObject2 = 'e';
302   - hook_ground_WallObject1 = 'm';
303   - hook_ground_AnimableList = 'h';
304   -
305   -{Class WallObjectData}
306   - class_WallObjectData = 'ee';
307   - hook_wallobjectdata_ID = 'jb';
308   - hook_wallobjectdata_Model = 'kb';
309   - hook_wallobjectdata_Orientation = 'G';
  298 + class_Ground = 'qj';
  299 + hook_ground_FloorDecoration = 'n';
  300 + hook_ground_WallDecoration2 = 'g';
  301 + hook_ground_WallDecoration1 = 'c';
  302 + hook_ground_WallObject2 = 'd';
  303 + hook_ground_WallObject1 = 'o';
  304 + hook_ground_AnimableList = 'p';
310 305
311 306 {Class FloorDecorationData}
312   - class_FloorDecorationData = 'qda';
313   - hook_floordecorationdata_ID = 'ib';
314   - hook_floordecorationdata_Model = 'X';
315   - hook_floordecorationdata_Orientation = 'db';
  307 + class_FloorDecorationData = 'ao';
  308 + hook_floordecorationdata_ID = 'E';
  309 + hook_floordecorationdata_Model = 'M';
  310 + hook_floordecorationdata_Orientation = 'S';
  311 +
  312 +{Class WallObjectData}
  313 + class_WallObjectData = 'nq';
  314 + hook_wallobjectdata_ID = 'W';
  315 + hook_wallobjectdata_Model = 'K';
  316 + hook_wallobjectdata_Orientation = 'M';
316 317
317 318 {Class WallDecorationData}
318   - class_WallDecorationData = 'me';
319   - hook_walldecorationdata_ID = 'N';
320   - hook_walldecorationdata_Model = 'fb';
321   - hook_walldecorationdata_Orientation = 'M';
  319 + class_WallDecorationData = 'ie';
  320 + hook_walldecorationdata_ID = 'fb';
  321 + hook_walldecorationdata_Model = 'Y';
  322 + hook_walldecorationdata_Orientation = 'db';
322 323
323 324 {Class InteractiveObject}
324   - class_InteractiveObject = 'sr';
325   - hook_interactiveobject_Model = 'nb';
326   - hook_interactiveobject_ID = 'P';
327   - hook_interactiveobject_Orientation = 'bb';
  325 + class_InteractiveObject = 'tca';
  326 + hook_interactiveobject_Model = 'N';
  327 + hook_interactiveobject_ID = 'hb';
  328 + hook_interactiveobject_Orientation = 'gb';
328 329
329 330 {Class InteractiveObject2}
330   - class_InteractiveObject2 = 'lla';
331   - hook_interactiveobject2_ObjectData = 'O';
  331 + class_InteractiveObject2 = 'up';
  332 + hook_interactiveobject2_ObjectData = 'K';
332 333
333 334 {Class SecondLevelObject}
334   - class_SecondLevelObject = 'gw';
335   - hook_secondlevelobject_ID = 'o';
336   - hook_secondlevelobject_ModelID = 'k';
337   - hook_secondlevelobject_Orientation = 'a';
338   - hook_secondlevelobject_Model = 'C';
  335 + class_SecondLevelObject = 'rl';
  336 + hook_secondlevelobject_ID = 'k';
  337 + hook_secondlevelobject_ModelID = 'H';
  338 + hook_secondlevelobject_Orientation = 'm';
  339 + hook_secondlevelobject_Model = 'j';
339 340
340 341 {Class WallDecorationSub2}
341   - class_WallDecorationSub2 = 'oda';
342   - hook_walldecorationsub2_Composite = 'O';
  342 + class_WallDecorationSub2 = 'fga';
  343 + hook_walldecorationsub2_Composite = 'G';
343 344
344 345 {Class FloorDecorationSub2}
345   - class_FloorDecorationSub2 = 'wn';
346   - hook_floordecorationsub2_Composite = 'fb';
  346 + class_FloorDecorationSub2 = 'mm';
  347 + hook_floordecorationsub2_Composite = 'Z';
347 348
348 349 {Class WallObjectSub2}
349   - class_WallObjectSub2 = 'vh';
350   - hook_wallobjectsub2_Composite = 'D';
  350 + class_WallObjectSub2 = 'sb';
  351 + hook_wallobjectsub2_Composite = 'T';
351 352
352 353 {Class GroundData}
353   - class_GroundData = 'tq';
354   - hook_grounddata_CollisionFlags = 'r';
355   - hook_grounddata_OffsetX = 'n';
356   - hook_grounddata_OffsetY = 'y';
  354 + class_GroundData = 'lka';
  355 + hook_grounddata_CollisionFlags = 'x';
  356 + hook_grounddata_OffsetX = 'b';
  357 + hook_grounddata_OffsetY = 'w';
  358 +
  359 +{Class GrandExchange}
  360 + class_GrandExchange = 'ut';
  361 + hook_grandexchange_getStatus = 'b';
  362 + hook_grandexchange_getID = 'g';
  363 + hook_grandexchange_getPrice = 'c';
  364 + hook_grandexchange_getTotal = 'e';
  365 + hook_grandexchange_getTransferred = 'i';
  366 + hook_grandexchange_getSpent = 'h';
342 Modules/Core/Interfaces.simba
@@ -2,7 +2,7 @@
2 2 Interfaces
3 3 ==========
4 4
5   -File containing interface routines.
  5 +File containing core interface routines.
6 6
7 7 *)
8 8
@@ -27,6 +27,45 @@ begin
27 27 end;
28 28
29 29 (*
  30 +R_GetValidInterfaces
  31 +~~~~~~~~~~~~~~~~~~~~
  32 +
  33 +.. code-block:: pascal
  34 +
  35 + function R_GetValidInterfaces: TIntegerArray;
  36 +
  37 +Returns an array of all the valid interfaces.
  38 +
  39 +.. note::
  40 +
  41 + by Drags111
  42 +
  43 +*)
  44 +function R_GetValidInterfaces: TIntegerArray;
  45 +var
  46 + Interfaces, IL, I, C: integer;
  47 +begin
  48 + try
  49 + Interfaces := SmartGetFieldObject(0, hook_static_Interfaces);
  50 + IL := SmartGetFieldArraySize(Interfaces, '', 1);
  51 + SetLength(Result, IL);
  52 +
  53 + for I := 0 to IL-1 do
  54 + begin
  55 + if(R_ValidInterface(I))then
  56 + begin
  57 + Result[C] :=I;
  58 + Inc(C);
  59 + end;
  60 + end;
  61 +
  62 + SetLength(Result, C);
  63 + finally
  64 + SmartFreeObject(Interfaces);
  65 + end;
  66 +end;
  67 +
  68 +(*
30 69 R_GetInterface
31 70 ~~~~~~~~~~~~~~
32 71
@@ -49,8 +88,13 @@ begin
49 88 Exit;
50 89
51 90 Child := SmartGetFieldArray2DObject(0, hook_static_Interfaces, ParentI, ChildI);
52   - if not SmartIsNull(Child)then
53   - Result := Interface_Create(Child);
  91 + if SmartIsNull(Child)then
  92 + begin
  93 + SmartFreeObject(Child);
  94 + Exit;
  95 + end;
  96 +
  97 + Result := Interface_Create(Child);
54 98 end;
55 99
56 100 (*
@@ -89,4 +133,296 @@ begin
89 133 Result := Interface_Create(Component);
90 134 end;
91 135
  136 +function R_GetInterfaceParent(Child: TInterface): TInterface;
  137 +var
  138 + ParentID: Integer;
  139 +begin
  140 + ParentID := Interface_GetParentID(Child);
  141 + if ParentID > 0 then
  142 + Result := Interface_Create(SmartGetFieldArray2DObject(0, hook_static_Interfaces, ParentID shr 16, ParentID and $FFFF));
  143 +end;
  144 +
  145 +(*
  146 +R_GetValidChildren
  147 +~~~~~~~~~~~~~~~~~~
  148 +
  149 +.. code-block:: pascal
  150 +
  151 + function R_GetValidChildren(ParentI : Integer): TIntegerArray;
  152 +
  153 +Returns all the children in the parent interface.
  154 +
  155 +.. note::
  156 +
  157 + by pyroryan
  158 +
  159 +*)
  160 +function R_GetValidChildren(ParentI : Integer): TIntegerArray;
  161 +var
  162 + C, Child: Integer;
  163 +begin
  164 + if not R_ValidInterface(ParentI) then Exit;
  165 + try
  166 + C := 0;
  167 + Child := SmartGetFieldArray2DObject(0, hook_static_Interfaces, ParentI, C);
  168 + while not SmartIsNull(Child) do
  169 + begin
  170 + SetArrayLength (Result, C+1);
  171 + Result[C] := C;
  172 + Inc(C);
  173 + SmartFreeObject(Child);
  174 + Child := SmartGetFieldArray2DObject(0, hook_static_Interfaces, ParentI, C);
  175 + end;
  176 + SetLength(Result, C);
  177 + finally
  178 + SmartFreeObject(Child);
  179 + end;
  180 +end;
  181 +
  182 +(*
  183 +R_GetValidComponents
  184 +~~~~~~~~~~~~~~~~~~~~
  185 +
  186 +.. code-block:: pascal
  187 +
  188 + function R_GetValidComponents(ParentI, ChildI: Integer): TIntegerArray;
  189 +
  190 +Returns all the components in the parent-->child interface.
  191 +
  192 +.. note::
  193 +
  194 + by mormonman
  195 +
  196 +*)
  197 +function R_GetValidComponents(ParentI, ChildI: Integer): TIntegerArray;
  198 +var
  199 + Child: TInterface;
  200 + C, Component: Integer;
  201 +begin
  202 + try
  203 + Child := R_GetInterface(ParentI, ChildI);
  204 + if SmartIsNull(Child.Obj) then
  205 + Exit;
  206 + C := 0;
  207 + Component := SmartGetFieldArrayObject(Child.Obj, hook_interface_Children, C);
  208 + while not (SmartIsNull(Component)) do
  209 + begin
  210 + SetArrayLength (Result, C+1);
  211 + Result[C] := C;
  212 + Inc(C);
  213 + SmartFreeObject(Component);
  214 + Component := SmartGetFieldArrayObject(Child.Obj, hook_interface_Children, C);
  215 + end;
  216 + SetLength(Result, C);
  217 + finally
  218 + SmartFreeObject(Component);
  219 + Interface_Free(Child);
  220 + end;
  221 +end;
  222 +
  223 +(*
  224 +R_FindInterface
  225 +~~~~~~~~~~~~~~~~~~~~
  226 +
  227 +.. code-block:: pascal
  228 +
  229 + function R_FindInterface(Text: String; SearchConst: Integer): TInterface;
92 230
  231 +Returns the interface that contains the text.
  232 + @Text - EXACT text to search for(case-sensitive)
  233 + @SearchConst - SEARCH_NAME = Search Interface.GetName
  234 + SEARCH_TEXT = Search Interface.GetText
  235 + SEARCH_ACTION = Search Interface.GetActions
  236 +
  237 +.. note::
  238 +
  239 + by mormonman
  240 +
  241 +*)
  242 +function R_FindInterface(Text: String; SearchConst: Integer): TInterface;
  243 +var
  244 + IntArr, ChildArr, CompArr: TIntegerArray;
  245 + Child: TInterface;
  246 + i, h, j: Integer;
  247 + Actions: TStringArray;
  248 + T: String;
  249 +begin
  250 + IntArr := R_GetValidInterfaces;
  251 + if (High(IntArr) < 0) then Exit;
  252 + for i := 0 to High(IntArr) do
  253 + begin
  254 + ChildArr := R_GetValidChildren(IntArr[i]);
  255 + if (High(ChildArr) < 0) then Continue;
  256 + for h := 0 to High(ChildArr) do
  257 + begin
  258 + Child := R_GetInterface(IntArr[i], ChildArr[h]);
  259 + case SearchConst of
  260 + SEARCH_NAME : T := Interface_GetName(Child);
  261 + SEARCH_TEXT : T := Interface_GetText(Child);
  262 + SEARCH_ACTION :
  263 + begin
  264 + Actions := Interface_GetActions(Child);
  265 + if R_StrInArr(Text, Actions) then
  266 + begin
  267 + Result := Child;
  268 + Exit;
  269 + end;
  270 + end;
  271 + else Exit;
  272 + end;
  273 + if SearchConst < SEARCH_ACTION then
  274 + if (Pos(Text, T) > 0) then
  275 + begin
  276 + Result := Child;
  277 + Exit;
  278 + end;
  279 + Interface_Free(Child);
  280 + CompArr := R_GetValidComponents(IntArr[i], ChildArr[h]);
  281 + if (High(CompArr) < 0) then Continue;
  282 + for j := 0 to High(CompArr) do
  283 + begin
  284 + Child := R_GetInterfaceComponent(IntArr[i], ChildArr[h], CompArr[j]);
  285 + case SearchConst of
  286 + SEARCH_NAME : T := Interface_GetName(Child);
  287 + SEARCH_TEXT : T := Interface_GetText(Child);
  288 + SEARCH_ACTION :
  289 + begin
  290 + Actions := Interface_GetActions(Child);
  291 + if R_StrInArr(Text, Actions) then
  292 + begin
  293 + Result := Child;
  294 + Exit;
  295 + end;
  296 + end;
  297 + else Exit;
  298 + end;
  299 + if SearchConst < SEARCH_ACTION then
  300 + if (Pos(Text, T) > 0) then
  301 + begin
  302 + Result := Child;
  303 + Exit;
  304 + end;
  305 + Interface_Free(Child);
  306 + end;
  307 + end;
  308 + end;
  309 +end;
  310 +
  311 +(*
  312 +R_ClickInterface
  313 +~~~~~~~~~~~~~~~~
  314 +
  315 +.. code-block:: pascal
  316 +
  317 + procedure R_ClickInterface(Child: TInterface; ClickType: Integer);
  318 +
  319 +Moves the mouse to and (depending on the ClickType) will click the interface
  320 +child/component. The ClickType follows the same rule as MouseBox:
  321 + 1: Left Click
  322 + 2: Right Click
  323 + 3: No Click
  324 +
  325 +.. note::
  326 +
  327 + by Drags111
  328 +
  329 +*)
  330 +procedure R_ClickInterface(Child: TInterface; ClickType: Integer);
  331 +var
  332 + Box: TBox;
  333 +begin
  334 + Box := Interface_GetBounds(Child);
  335 + R_MouseBox(Box.X1, Box.Y1, Box.X2, Box.Y2, ClickType);
  336 +end;
  337 +
  338 +procedure R_ClickInterfaceMiddle(Child: TInterface; ClickType: Integer);
  339 +var
  340 + P: TPoint;
  341 +begin
  342 + P := R_MiddleBox(Interface_GetBounds(Child));
  343 + R_MouseBox(P.x - 10, P.y - 10, P.x + 10, P.y + 10, ClickType);
  344 +end;
  345 +
  346 +(*
  347 +R_ScrollTo
  348 +~~~~~~~~~~~~~~~~
  349 +
  350 +.. code-block:: pascal
  351 +
  352 + function R_ScrollTo(Target, UpA, DnA: TInterfaceChild) : Boolean;
  353 +
  354 +Scrolls to the Target using the Up and Down arrows specified by ScrollBar.
  355 +Works for both TRSChild and TRSComponent
  356 + @Box - Box that the Target needs to be in for the function to return true.
  357 +
  358 +.. note::
  359 +
  360 + by mormonman
  361 +
  362 +*)
  363 +function R_ScrollTo(Target, ScrollBar: TInterface) : Boolean;
  364 +var
  365 + T, I, x, y: Integer;
  366 + Bounds, InBox: TBox;
  367 + P1, P2: TPoint;
  368 + UpA, DnA, Box: TInterface;
  369 + Dir: String;
  370 +begin
  371 + if (Interface_GetID(Target) < 1) then Exit;
  372 + try
  373 + UpA := Interface_Create(SmartGetFieldArrayObject(ScrollBar.Obj, hook_Interface_Children, SCROLLBAR_UP));
  374 + DnA := Interface_Create(SmartGetFieldArrayObject(ScrollBar.Obj, hook_Interface_Children, SCROLLBAR_DOWN));
  375 +
  376 + Bounds := Interface_GetBounds(Target);
  377 + Box := R_GetInterfaceParent(ScrollBar);
  378 + InBox := Interface_GetBounds(Box);
  379 + P1 := Point(Bounds.X1, Bounds.Y1);
  380 + P2 := Point(Bounds.X2, Bounds.Y2);
  381 + Result := PointInBox(P1, InBox)
  382 + and PointInBox(P2, InBox)
  383 + and not Interface_IsHidden(Target);
  384 + if Result then
  385 + Exit;
  386 +
  387 + for I := 1 to 2 do
  388 + begin
  389 + if(P1.y < InBox.Y1)then
  390 + Dir := 'up'
  391 + else if(P2.y > InBox.Y2)then
  392 + Dir := 'down';
  393 + if(dir = '')then
  394 + begin
  395 + R_Debug('Error getting destination direction.', 'R_ScrollTo');
  396 + Exit;
  397 + end;// else R_Debug('Dir: ' +Dir, 'R_ScrollTo');
  398 +
  399 + case dir of
  400 + 'up': R_ClickInterface(UpA, 3);
  401 + 'down': R_ClickInterface(DnA, 3);
  402 + end;
  403 + GetMousePos(x, y);
  404 + HoldMouse(x, y, 1);
  405 + T := GetSystemTime + 10000;
  406 +
  407 + while not(PointInBox(P1, InBox) and PointInBox(P2, InBox)) do
  408 + begin
  409 + if(GetSystemTime > T)then