Permalink
Browse files

Merge pull request #2 from mormonman/master

Interfaces.
  • Loading branch information...
2 parents 547f97a + 187f49f commit 668fdd2ea3d7dde25138c90bf4555186418d3de4 @jdeanwaite jdeanwaite committed Sep 15, 2011
Showing with 1,448 additions and 282 deletions.
  1. +80 −1 Modules/Core/Core.simba
  2. +145 −0 Modules/Core/Globals.simba
  3. +263 −253 Modules/Core/Hooks.simba
  4. +356 −2 Modules/Core/Interfaces.simba
  5. +43 −22 Modules/Core/Mouse.simba
  6. +561 −4 Wrappers/Interface.simba
View
81 Modules/Core/Core.simba
@@ -6,9 +6,88 @@ The core modual includes the base files of reflection needed for function.
*)
+(*
+R_Debug
+~~~~~~~~~~
+
+.. code-block:: pascal
+
+ procedure R_Debug(Message, Category: String);
+
+Prints "[Category] Message". If Category is undefined it
+defaults to "Reflection"
+
+.. note::
+
+ by Drags111
+
+*)
procedure R_Debug(Message, Category: String);
begin
- Writeln('['+Category+'] '+Message);
+ if (Category = '') then
+ Writeln('[Reflection] '+Message)
+ else Writeln('['+Category+'] '+Message);
+end;
+
+(*
+R_TrimHTML
+~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function R_TrimHTML(S : string): string;
+
+Removes the HTML junk from a string.
+
+.. note::
+
+ by lordsaturn, pyroryan
+
+*)
+function R_TrimHTML(S : string): string;
+var
+ P, P2, PLength: integer;
+ Temp: string;
+begin
+ P := Pos('<', S);
+ P2 := Pos('>', S);
+ Result := S;
+ PLength := P2 - P + 1;
+ while (P <> 0) and (P2 <> 0) do
+ begin
+ Delete(Result, P, PLength);
+ P := Pos('<', Result);
+ Temp := Result;
+ Delete(Temp, 1, P - 1);
+ PLength := Pos('>', Temp);
+ end;
+end;
+
+(*
+R_StrInArr
+~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function R_StrInArr(str: string; arrS: TStringArray): Boolean;
+
+Returns True if str is found in the Array. Case sensitive. Uses Pos.
+
+.. note::
+
+ by Narcle, Nava2
+
+*)
+function R_StrInArr(str: string; arrS: TStringArray): Boolean;
+var
+ I, L, H: Integer;
+begin
+ Result := True;
+ L := Low(arrS); H := High(arrS);
+ for I := L to H do
+ if Pos(Str, arrS[I]) > 0 then
+ Exit;
+ Result := False;
end;
{$include_once Hooks.simba}
View
145 Modules/Core/Globals.simba
@@ -23,3 +23,148 @@ var
{$IFDEF UseLaptopMouse}
R_LMouse_MissChance: Integer;
{$ENDIF}
+
+const
+ NULL_INT = -1;
+ NULL_STRING = '';
+
+ {Gametab constants}
+ INTERFACE_GAMETAB = 548;
+ INTERFACE_GAMETAB_FACENORTH = 177;
+
+ RTAB_FRIENDSLIST = 99;
+ RTAB_CHAT = 100;
+ RTAB_CLANCHAT = 101;
+ RTAB_OPTIONS = 102;
+ RTAB_EMOTES = 103;
+ RTAB_MUSIC = 104;
+ RTAB_NOTES = 105;
+ RTAB_COMBAT = 128;
+ RTAB_TASKS = 129;
+ RTAB_STATS = 130;
+ RTAB_QUESTS = 131;
+ RTAB_INVENTORY = 132;
+ RTAB_EQUIPMENT = 133;
+ RTAB_PRAYER = 134;
+ RTAB_SPELLBOOK = 135;
+
+ INTERFACE_HITPOINTS = 748;
+ INTERFACE_PRAYER = 749;
+ INTERFACE_RUN = 750;
+ INTERFACE_SUMMONING = 747;
+ INTERFACE_WORLDMAP = 755;
+ INTERFACE_WORLDMAP_CLOSE = 44;
+
+ SETTING_RUN = 173;
+
+ {Inventory Constants}
+ INTERFACE_INVENTORY = 679;
+ INTERFACE_BANKINVENTORY = 763;
+
+ {Equipment Constants}
+ INTERFACE_EQUIPMENT = 387;
+
+ EQUIPMENT_HELMET = 8;
+ EQUIPMENT_CAPE = 11;
+ EQUIPMENT_NECKLACE = 14;
+ EQUIPMENT_WEAPON = 17;
+ EQUIPMENT_TORSO = 20;
+ EQUIPMENT_SHIELD = 23;
+ EQUIPMENT_LEGS = 26;
+ EQUIPMENT_GLOVES = 29;
+ EQUIPMENT_BOOTS = 32;
+ EQUIPMENT_RING = 35;
+ EQUIPMENT_AMMO = 38;
+
+ {Quest Constants}
+ INTERFACE_QUESTS = 190;
+ INTERFACE_QUESTINFO = 275;
+ INTERFACE_QUESTSTART = 178;
+ QUEST_INFO_NAME = 2;
+ QUEST_INFO_CLOSE = 8;
+ QUEST_START_YES = 78;
+ QUEST_POINTS = 2;
+ QUEST_LIST = 18;
+ QUEST_SCROLL = 17;
+ QUEST_FILTER = 10;
+ QUEST_DONE = 12;
+ QUEST_CHECKED = 699;
+ QUEST_STARTED = 65535;
+ QUEST_UNSTARTED = 16711680;
+ QUEST_COMPLETE = 65280;
+ QUEST_FILTERED = 2236962;
+ QUEST_UNKNOWN = -1;
+
+ {Player Model Constants}
+ MODEL_EQUIPMENT_CONSTANT = 1073741824;
+
+ MODEL_EQUIPMENT_HEAD = 0;
+ MODEL_EQUIPMENT_CAPE = 1;
+ MODEL_EQUIPMENT_NECK = 2;
+ MODEL_EQUIPMENT_WEAPON = 3;
+ MODEL_EQUIPMENT_BODY = 4;
+ MODEL_EQUIPMENT_SHIELD = 5;
+ MODEL_EQUIPMENT_LEGS = 7;
+ MODEL_EQUIPMENT_HANDS = 9;
+ MODEL_EQUIPMENT_BOOTS = 10;
+
+ {Object Constants}
+ OBJ_INTERACTABLE = 1;
+ OBJ_WALLOBJECT = 2;
+ OBJ_WALLDECORATION = 3;
+ OBJ_FLOORDECORATION = 4;
+
+ {Bank Constants}
+ INTERFACE_BANK = 762;
+ INTERFACE_BANK_BTN_CLOSE = 43;
+ INTERFACE_BANK_BTN_DEPOSITBAG = 33;
+ INTERFACE_BANK_BTN_DEPOSITEQUIP = 35;
+ INTERFACE_BANK_BTN_DEPOSITBEAST = 37;
+ INTERFACE_BANK_BTN_NOTE = 19;
+
+ INTERFACE_BANK_SLOTS = 93;
+ INTERFACE_BANK_SLOTS_MAX = 515;
+
+ INTERFACE_BANK_SCROLLBAR = 114;
+ INTERFACE_BANK_SCROLLBAR_BAR = 1;
+ INTERFACE_BANK_SCROLLBAR_BARTOP = 2;
+ INTERFACE_BANK_SCROLLBAR_BARBOT = 3;
+ INTERFACE_BANK_SCROLLBAR_UP = 4;
+ INTERFACE_BANK_SCROLLBAR_DOWN = 5;
+
+ INTERFACE_PINSCREEN = 13;
+
+ INTERFACE_DEPOSITBOX = 11;
+
+ TEXTURE_BANKTABSELECTED = 1419;
+ TEXTURE_WITHDRAWMODE_NOTED = 1433;
+
+ {Chat Constants}
+ INTERFACE_CHAT = 137;
+ INTERFACE_CHAT_OPTIONS = 751;
+ INTERFACE_CHAT_SCROLL = 59;
+
+ RCHAT_GAME = 31;
+ RCHAT_PUBLIC = 28;
+ RCHAT_PRIVATE = 25;
+ RCHAT_FRIENDS = 8;
+ RCHAT_CLAN = 22;
+ RCHAT_TRADE = 19;
+ RCHAT_ASSIST = 16;
+
+ {Misc Constants}
+ mouse_Move = 3;
+ CROSSHAIR_NONE = 0;
+ CROSSHAIR_YELLOW = 1;
+ CROSSHAIR_RED = 2;
+ INTERFACE_LOGIN_SCREEN = 596;
+ INTERFACE_LOBBY_SCREEN = 907;
+
+ {Interface Constants}
+ SEARCH_NAME = 0;
+ SEARCH_TEXT = 1;
+ SEARCH_ACTION = 2;
+
+
+ SCROLLBAR_UP = 4;
+ SCROLLBAR_DOWN = 5;
View
516 Modules/Core/Hooks.simba
@@ -1,356 +1,366 @@
const
- ClientVersion = 663;
- HookRev = 4;
+ ClientVersion = 664;
+ HookRev = 2;
{Static Hooks}
- hook_static_LoginIndex = 'fia.e';
- hook_static_CamPosX = 'fea.q';
- hook_static_CamPosY = 'hea.x';
- hook_static_CamPosZ = 'lp.l';
- hook_static_CameraPitch = 'ha.i';
- hook_static_CameraYaw = 'wca.e';
- hook_static_ChatLines = 'sla.g';
- hook_static_MyPlayer = 'ho.D';
- hook_static_BaseX = 'wk.Lb';
- hook_static_BaseY = 'kl.a';
- hook_static_MapAngle = 'uo.E';
- hook_static_NPCIndexArray = 'db.f';
- hook_static_LoopCycle = 'ig.r';
- hook_static_NPCNC = 'tg.N';
- hook_static_ItemDefLoader = 'hj.E';
- hook_static_ObjectDefLoader = 'cc.f';
- hook_static_NPCNodes = 'cs.d';
- hook_static_GroundSettingsArray = 'aca.u';
- hook_static_LoadedPlane = 'wj.a';
- hook_static_PlaneArray = 'ud.d';
- hook_static_Toolkit = 'pi.i';
- hook_static_CollapsedMenuItems = 'rk.d';
- hook_static_MenuNodeList = 'rq.a';
- hook_static_MenuOpen = 'rk.e';
- hook_static_MenuOptionCount = 'it.g';
- hook_static_MenuCollapsedOptionsCount = 'kha.b';
- hook_static_MenuX = 'dma.k';
- hook_static_MenuY = 'bw.v';
- hook_static_MenuWidth = 'ula.a';
- hook_static_MenuHeight = 'fo.m';
- hook_static_MenuHeight2 = 'ma.C';
- hook_static_MenuWidth2 = 'tja.p';
- hook_static_MenuY2 = 'ww.p';
- hook_static_MenuX2 = 'tha.l';
- hook_static_IsMenuTabbed = 'lj.e';
- hook_static_Interfaces = 'mq.q';
- hook_static_ValidInterfaces = 'ii.f';
- hook_static_InterfaceBoundsArray = 'rj.d';
- hook_static_InterfaceDismissBounds = 'fw.a';
- hook_static_InterfaceNC = 'fca.a';
- hook_static_Settings = 'se.z';
- hook_static_GroundItemCache = 'bh.G';
- hook_static_GroundDataArray = 'vf.e';
- hook_static_SkillExperiences = 'lm.w';
- hook_static_SkillLevels = 'jea.l';
- hook_static_DestX = 'pf.f';
- hook_static_DestY = 'pl.k';
- hook_static_PlayerCount = 'rla.w';
- hook_static_PlayerIndexArray = 'mv.e';
- hook_static_Players = 'vga.g';
- hook_static_NPCCount = 'kk.d';
- hook_static_GroundTiles = 'sha.j';
- hook_static_CrossHairColor = 'jba.i';
+ hook_static_LoginIndex = 'ld.D';
+ hook_static_CamPosX = 'nl.ib';
+ hook_static_CamPosY = 'gq.H';
+ hook_static_CamPosZ = 'mw.w';
+ hook_static_CameraPitch = 'sj.nc';
+ hook_static_CameraYaw = 'tfa.b';
+ hook_static_ChatLines = 'cu.l';
+ hook_static_MyPlayer = 'hj.O';
+ hook_static_BaseX = 'hk.e';
+ hook_static_BaseY = 'ha.e';
+ hook_static_MapAngle = 'gl.m';
+ hook_static_NPCIndexArray = 'ifa.a';
+ hook_static_LoopCycle = 'qo.r';
+ hook_static_NPCNC = 'or.e';
+ hook_static_ItemDefLoader = 'rd.q';
+ hook_static_ObjectDefLoader = 'eka.b';
+ hook_static_NPCNodes = 'ok.e';
+ hook_static_GroundSettingsArray = 'mfa.h';
+ hook_static_LoadedPlane = 'vl.g';
+ hook_static_PlaneArray = 'et.E';
+ hook_static_Toolkit = 'mi.c';
+ hook_static_CollapsedMenuItems = 'nca.m';
+ hook_static_MenuNodeList = 'ij.e';
+ hook_static_MenuOpen = 'fu.u';
+ hook_static_MenuOptionCount = 'qv.J';
+ hook_static_MenuCollapsedOptionsCount = 'ad.f';
+ hook_static_MenuX = 'gn.s';
+ hook_static_MenuY = 'gma.h';
+ hook_static_MenuWidth = 'wba.b';
+ hook_static_MenuHeight = 'o.i';
+ hook_static_MenuX2 = 'ic.g';
+ hook_static_MenuY2 = 'rk.m';
+ hook_static_MenuWidth2 = 'aia.a';
+ hook_static_MenuHeight2 = 'rr.b';
+ hook_static_IsMenuTabbed = 'wq.i';
+ hook_static_Interfaces = 'sha.f';
+ hook_static_ValidInterfaces = 'bca.e';
+ hook_static_InterfaceBoundsArray = 'g.j';
+ hook_static_InterfaceDismissBounds = 'r.y';
+ hook_static_InterfaceNC = 'om.q';
+ hook_static_Settings = 'mi.a';
+ hook_static_GroundItemCache = 'st.j';
+ hook_static_GroundDataArray = 'ts.d';
+ hook_static_GrandExchange = 'vc.d';
+ hook_static_SkillExperiences = 'aa.a';
+ hook_static_SkillLevels = 'uda.h';
+ hook_static_DestX = 'mfa.a';
+ hook_static_DestY = 'lm.k';
+ hook_static_PlayerCount = 'iga.l';
+ hook_static_PlayerIndexArray = 'su.c';
+ hook_static_Players = 'es.j';
+ hook_static_NPCCount = 'go.d';
+ hook_static_GroundTiles = 'ua.p';
+ hook_static_CrossHairColor = 'nja.B';
{Class SDModel}
- class_SDModel = 'hma';
- hook_sdmodel_Indices1 = 'J';
- hook_sdmodel_Indices2 = 'ub';
- hook_sdmodel_Indices3 = 'y';
- hook_sdmodel_PointsX = 'sb';
- hook_sdmodel_PointsY = 'vb';
- hook_sdmodel_PointsZ = 'Mb';
+ class_SDModel = 'mc';
+ hook_sdmodel_Indices1 = 'X';
+ hook_sdmodel_Indices2 = 'L';
+ hook_sdmodel_Indices3 = 'Pb';
+ hook_sdmodel_PointsX = 'Lb';
+ hook_sdmodel_PointsY = 'Q';
+ hook_sdmodel_PointsZ = 'Z';
{Class ChatLine}
- class_ChatLine = 'dw';
- hook_chatline_Name = 'c';
- hook_chatline_Message = 'a';
- hook_chatline_Type = 'h';
+ class_ChatLine = 'wl';
+ hook_chatline_Name = 'k';
+ hook_chatline_Message = 'e';
+ hook_chatline_Type = 'j';
{Class Animable}
- class_Animable = 'bla';
- hook_animable_PixelX = 'i';
- hook_animable_PixelY = 'q';
- hook_animable_Plane = 'p';
+ class_Animable = 'tl';
+ hook_animable_PixelX = 'n';
+ hook_animable_PixelY = 'i';
+ hook_animable_Plane = 's';
{Class Player}
- class_Player = 'oba';
- hook_player_Level = 'hd';
- hook_player_Name = 'Vc';
- hook_player_Team = 'ed';
- hook_player_PlayerDef = 'Sc';
+ class_Player = 'bi';
+ hook_player_Team = 'Ed';
+ hook_player_Level = 'Ad';
+ hook_player_Name = 'Kc';
+ hook_player_PlayerDef = 'ed';
{Class Character}
- class_Character = 'wka';
- hook_character_Motion = 'lc';
- hook_character_AnimationQueue = 'jb';
- hook_character_Animation = 'Fb';
- hook_character_WalkQueueX = 'wc';
- hook_character_WalkQueueY = 'lb';
- hook_character_Height = 'bc';
- hook_character_Orientation = 'sb';
- hook_character_LoopCycleStatus = 'Dc';
- hook_character_HPRatio = 'Fc';
- hook_character_Interacting = 'ib';
+ class_Character = 'sj';
+ hook_character_Motion = 'zc';
+ hook_character_AnimationQueue = 'db';
+ hook_character_Animation = 'mb';
+ hook_character_WalkQueueX = 'ec';
+ hook_character_WalkQueueY = 'Ib';
+ hook_character_Height = 'cc';
+ hook_character_Orientation = 'Nb';
+ hook_character_LoopCycleStatus = 'N';
+ hook_character_HPRatio = 'Vb';
+ hook_character_Interacting = 'Ac';
{Class AnimableNode}
- class_AnimableNode = 'sla';
- hook_animablenode_Animable = 'f';
- hook_animablenode_Next = 'b';
+ class_AnimableNode = 'gma';
+ hook_animablenode_Animable = 'i';
+ hook_animablenode_Next = 'g';
{Class AnimableEntity}
- class_AnimableEntity = 'qfa';
- hook_animableentity_AreaX1 = 'D';
- hook_animableentity_AreaX2 = 'x';
- hook_animableentity_AreaY1 = 'I';
- hook_animableentity_AreaY2 = 'E';
+ class_AnimableEntity = 'kg';
+ hook_animableentity_AreaX1 = 'E';
+ hook_animableentity_AreaX2 = 'D';
+ hook_animableentity_AreaY1 = 'J';
+ hook_animableentity_AreaY2 = 'I';
{Class PlayerDef}
- class_PlayerDef = 'maa';
- hook_playerdef_Equipment = 'i';
+ class_PlayerDef = 'ffa';
+ hook_playerdef_Equipment = 'd';
{Class Animation}
- class_Animation = 'js';
- hook_animation_Def = 'm';
+ class_Animation = 'cb';
+ hook_animation_Def = 'B';
{Class AnimationDef}
- class_AnimationDef = 'bg';
- hook_animationdef_ID = 't';
+ class_AnimationDef = 'qea';
+ hook_animationdef_ID = 'p';
{Class NodeCache}
- class_NodeCache = 'gn';
- hook_nodecache_Nodes = 'h';
+ class_NodeCache = 'lba';
+ hook_nodecache_Nodes = 'i';
{Class Item}
- class_Item = 'tha';
- hook_item_ID = 'j';
- hook_item_Stack = 'm';
+ class_Item = 'qo';
+ hook_item_ID = 'q';
+ hook_item_Stack = 'n';
{Class NodeListCache}
- class_NodeListCache = 'eja';
- hook_nodelistcache_NodeList = 'u';
+ class_NodeListCache = 'uq';
+ hook_nodelistcache_NodeList = 'm';
{Class NodeList}
- class_NodeList = 'tj';
- hook_nodelist_Current = 'q';
- hook_nodelist_Head = 'd';
+ class_NodeList = 'cga';
+ hook_nodelist_Current = 'h';
+ hook_nodelist_Head = 'c';
{Class Node}
- class_Node = 'an';
- hook_node_Next = 'd';
- hook_node_Previous = 'a';
+ class_Node = 'hh';
+ hook_node_Next = 'j';
+ hook_node_Previous = 'c';
hook_node_ID = 'g';
{Class ItemDefLoader}
- class_ItemDefLoader = 'wo';
- hook_itemdefloader_Models = 'g';
- hook_itemdefloader_Composites = 't';
+ class_ItemDefLoader = 'bg';
+ hook_itemdefloader_Models = 'u';
+ hook_itemdefloader_Composites = 'p';
{Class ItemDef}
- class_ItemDef = 'eh';
- hook_itemdef_Loader = 'eb';
- hook_itemdef_Actions = 'b';
- hook_itemdef_GroundActions = 'Bb';
+ class_ItemDef = 'k';
+ hook_itemdef_Loader = 'P';
+ hook_itemdef_Actions = 'Y';
+ hook_itemdef_GroundActions = 'Z';
{Class MRUNodes}
- class_MRUNodes = 'si';
- hook_mrunodes_NodeCache = 'r';
+ class_MRUNodes = 'dka';
+ hook_mrunodes_NodeCache = 'v';
{Class ObjectDefLoader}
- class_ObjectDefLoader = 'rka';
- hook_objectdefloader_Models = 'c';
- hook_objectdefloader_Composites = 'm';
+ class_ObjectDefLoader = 'hg';
+ hook_objectdefloader_Models = 'w';
+ hook_objectdefloader_Composites = 'u';
{Class ObjectDef}
- class_ObjectDef = 'hca';
- hook_objectdef_Loader = 'Fb';
- hook_objectdef_Actions = 'tb';
- hook_objectdef_Name = 'W';
- hook_objectdef_SettingIndex = 'Pb';
- hook_objectdef_ChildrenIDs = 'T';
+ class_ObjectDef = 'dga';
+ hook_objectdef_Loader = 'gb';
+ hook_objectdef_Actions = 'X';
+ hook_objectdef_Name = 'Fb';
+ hook_objectdef_SettingIndex = 'H';
+ hook_objectdef_ChildrenIDs = 'm';
{Class NPC}
- class_NPC = 'gja';
- hook_npc_NPCDef = 'jd';
- hook_npc_Level = 'Nc';
+ class_NPC = 'efa';
+ hook_npc_NPCDef = 'Kc';
+ hook_npc_Level = 'Tc';
{Class NPCDef}
- class_NPCDef = 'at';
- hook_npcdef_Name = 'D';
- hook_npcdef_Actions = 'ob';
- hook_npcdef_Loader = 'db';
- hook_npcdef_Level = 'A';
- hook_npcdef_ID = 'R';
- hook_npcdef_ChildrenIDs = 'O';
- hook_npcdef_SettingIndex = 'b';
+ class_NPCDef = 'nl';
+ hook_npcdef_Actions = 'j';
+ hook_npcdef_Name = 'gb';
+ hook_npcdef_Loader = 'i';
+ hook_npcdef_Level = 'db';
+ hook_npcdef_ID = 'O';
+ hook_npcdef_ChildrenIDs = 'a';
+ hook_npcdef_SettingIndex = 'm';
{Class NPCDefLoader}
- class_NPCDefLoader = 'eba';
- hook_npcdefloader_Models = 'i';
- hook_npcdefloader_Composites = 'p';
+ class_NPCDefLoader = 'bja';
+ hook_npcdefloader_Models = 'n';
+ hook_npcdefloader_Composites = 'l';
{Class NPCNode}
- class_NPCNode = 'cd';
- hook_npcnode_NPC = 'n';
+ class_NPCNode = 'rga';
+ hook_npcnode_NPC = 'o';
{Class SDPlane}
class_SDPlane = 's';
- hook_sdplane_TileHeights = 'l';
+ hook_sdplane_TileHeights = 'g';
{Class GraphicsToolkit}
class_GraphicsToolkit = 'ha';
- hook_graphicstoolkit_Index = 'd';
+ hook_graphicstoolkit_Index = 'r';
{Class SDViewport}
- class_SDViewport = 'nm';
- hook_sdviewport_xOff = 'i';
- hook_sdviewport_xX = 'C';
- hook_sdviewport_xY = 'g';
- hook_sdviewport_xZ = 'o';
- hook_sdviewport_yOff = 'p';
- hook_sdviewport_yX = 'I';
- hook_sdviewport_yY = 'n';
- hook_sdviewport_yZ = 'z';
- hook_sdviewport_zOff = 'B';
- hook_sdviewport_zX = 'l';
- hook_sdviewport_zY = 'K';
- hook_sdviewport_zZ = 'x';
+ class_SDViewport = 'pja';
+ hook_sdviewport_xOff = 'A';
+ hook_sdviewport_xX = 'e';
+ hook_sdviewport_xY = 'D';
+ hook_sdviewport_xZ = 'C';
+ hook_sdviewport_yOff = 'j';
+ hook_sdviewport_yX = 'g';
+ hook_sdviewport_yY = 'f';
+ hook_sdviewport_yZ = 'F';
+ hook_sdviewport_zOff = 't';
+ hook_sdviewport_zX = 'y';
+ hook_sdviewport_zY = 'k';
+ hook_sdviewport_zZ = 'I';
{Class SDToolkit}
- class_SDToolkit = 'rea';
- hook_sdtoolkit_Viewport = 'N';
- hook_sdtoolkit_xMin = 'O';
- hook_sdtoolkit_xMax = 'A';
- hook_sdtoolkit_yMin = 'G';
- hook_sdtoolkit_yMax = 'M';
- hook_sdtoolkit_zMin = 'pb';
- hook_sdtoolkit_zMax = 'B';
- hook_sdtoolkit_xScale = 'R';
- hook_sdtoolkit_yScale = 'rb';
+ class_SDToolkit = 'lq';
+ hook_sdtoolkit_Viewport = 'bb';
+ hook_sdtoolkit_xMin = 'gb';
+ hook_sdtoolkit_xMax = 'U';
+ hook_sdtoolkit_yMin = 'nb';
+ hook_sdtoolkit_yMax = 'S';
+ hook_sdtoolkit_zMin = 'cb';
+ hook_sdtoolkit_zMax = 'F';
+ hook_sdtoolkit_xScale = 'z';
+ hook_sdtoolkit_yScale = 'E';
{Class MenuGroupNode}
- class_MenuGroupNode = 'q';
- hook_menugroupnode_NodeSubListItems = 'z';
+ class_MenuGroupNode = 'jb';
+ hook_menugroupnode_NodeSubListItems = 'B';
{Class NodeSubList}
- class_NodeSubList = 'pda';
+ class_NodeSubList = 'vl';
hook_nodesublist_Head = 'i';
{Class NodeSub}
- class_NodeSub = 'ffa';
- hook_nodesub_Next = 'r';
+ class_NodeSub = 'no';
+ hook_nodesub_Next = 'p';
{Class Menu}
- class_Menu = 'ej';
- hook_menu_Action = 'y';
- hook_menu_Option = 'N';
+ class_Menu = 'tt';
+ hook_menu_Action = 'A';
+ hook_menu_Option = 'y';
{Class Interface}
- class_Interface = 'av';
- hook_interface_TextColor = 'ad';
+ class_Interface = 'oh';
+ hook_interface_TextColor = 'U';
hook_interface_ModelZoom = 'Ec';
- hook_interface_ModelID = 'a';
- hook_interface_X = 'ub';
- hook_interface_Y = 'Ub';
- hook_interface_Width = 'fb';
- hook_interface_Height = 'tc';
- hook_interface_IsHidden = 'yd';
- hook_interface_ParentID = 'Gb';
- hook_interface_ID = 'zd';
- hook_interface_ComponentID = 'q';
- hook_interface_ComponentStackSize = 'mb';
- hook_interface_Actions = 'pc';
- hook_interface_ComponentName = 'W';
- hook_interface_Text = 'Oc';
- hook_interface_TextureID = 'Cb';
- hook_interface_Children = 'tb';
- hook_interface_BoundsArrayIndex = 'pb';
- hook_interface_HorizontalScrollBarSize = 'Yc';
- hook_interface_VerticalScrollBarSize = 'b';
- hook_interface_HorizontalScrollBarPosition = 'rd';
- hook_interface_HorizontalScrollBarThumbSize = 'fb';
- hook_interface_VerticalScrollBarPosition = 'ac';
- hook_interface_VerticalScrollBarThumbSize = 'tc';
+ hook_interface_ModelID = 'Zc';
+ hook_interface_X = 'vb';
+ hook_interface_Y = 'wb';
+ hook_interface_Width = 'V';
+ hook_interface_Height = 'Pb';
+ hook_interface_IsHidden = 'bb';
+ hook_interface_ParentID = 'H';
+ hook_interface_ID = 'ob';
+ hook_interface_ComponentID = 'xb';
+ hook_interface_ComponentStackSize = 'Uc';
+ hook_interface_Actions = 'nd';
+ hook_interface_ComponentName = 'c';
+ hook_interface_Text = 'qb';
+ hook_interface_TextureID = 'nc';
+ hook_interface_Children = 'n';
+ hook_interface_BoundsArrayIndex = 'tc';
+ hook_interface_HorizontalScrollBarSize = 'rd';
+ hook_interface_VerticalScrollBarSize = 'kb';
+ hook_interface_HorizontalScrollBarPosition = 'Bb';
+ hook_interface_HorizontalScrollBarThumbSize = 'V';
+ hook_interface_VerticalScrollBarPosition = 'bc';
+ hook_interface_VerticalScrollBarThumbSize = 'Pb';
{Class InterfaceNode}
- class_InterfaceNode = 'tv';
- hook_interfacenode_ID = 'k';
+ class_InterfaceNode = 'fka';
+ hook_interfacenode_ID = 'o';
{Class SettingArray}
- class_SettingArray = 'ud';
- hook_settingarray_Data = 'n';
+ class_SettingArray = 'es';
+ hook_settingarray_Data = 'i';
{Class SoftReference}
- class_SoftReference = 'eea';
+ class_SoftReference = 'ni';
hook_softreference_Reference = 'B';
{Class HardReference}
- class_HardReference = 'cfa';
- hook_hardreference_Object = 'I';
+ class_HardReference = 'mn';
+ hook_hardreference_Object = 'E';
{Class Ground}
- class_Ground = 'nt';
- hook_ground_FloorDecoration = 'f';
- hook_ground_WallDecoration2 = 'v';
- hook_ground_WallDecoration1 = 'k';
- hook_ground_WallObject2 = 'e';
- hook_ground_WallObject1 = 'm';
- hook_ground_AnimableList = 'h';
-
-{Class WallObjectData}
- class_WallObjectData = 'ee';
- hook_wallobjectdata_ID = 'jb';
- hook_wallobjectdata_Model = 'kb';
- hook_wallobjectdata_Orientation = 'G';
+ class_Ground = 'qj';
+ hook_ground_FloorDecoration = 'n';
+ hook_ground_WallDecoration2 = 'g';
+ hook_ground_WallDecoration1 = 'c';
+ hook_ground_WallObject2 = 'd';
+ hook_ground_WallObject1 = 'o';
+ hook_ground_AnimableList = 'p';
{Class FloorDecorationData}
- class_FloorDecorationData = 'qda';
- hook_floordecorationdata_ID = 'ib';
- hook_floordecorationdata_Model = 'X';
- hook_floordecorationdata_Orientation = 'db';
+ class_FloorDecorationData = 'ao';
+ hook_floordecorationdata_ID = 'E';
+ hook_floordecorationdata_Model = 'M';
+ hook_floordecorationdata_Orientation = 'S';
+
+{Class WallObjectData}
+ class_WallObjectData = 'nq';
+ hook_wallobjectdata_ID = 'W';
+ hook_wallobjectdata_Model = 'K';
+ hook_wallobjectdata_Orientation = 'M';
{Class WallDecorationData}
- class_WallDecorationData = 'me';
- hook_walldecorationdata_ID = 'N';
- hook_walldecorationdata_Model = 'fb';
- hook_walldecorationdata_Orientation = 'M';
+ class_WallDecorationData = 'ie';
+ hook_walldecorationdata_ID = 'fb';
+ hook_walldecorationdata_Model = 'Y';
+ hook_walldecorationdata_Orientation = 'db';
{Class InteractiveObject}
- class_InteractiveObject = 'sr';
- hook_interactiveobject_Model = 'nb';
- hook_interactiveobject_ID = 'P';
- hook_interactiveobject_Orientation = 'bb';
+ class_InteractiveObject = 'tca';
+ hook_interactiveobject_Model = 'N';
+ hook_interactiveobject_ID = 'hb';
+ hook_interactiveobject_Orientation = 'gb';
{Class InteractiveObject2}
- class_InteractiveObject2 = 'lla';
- hook_interactiveobject2_ObjectData = 'O';
+ class_InteractiveObject2 = 'up';
+ hook_interactiveobject2_ObjectData = 'K';
{Class SecondLevelObject}
- class_SecondLevelObject = 'gw';
- hook_secondlevelobject_ID = 'o';
- hook_secondlevelobject_ModelID = 'k';
- hook_secondlevelobject_Orientation = 'a';
- hook_secondlevelobject_Model = 'C';
+ class_SecondLevelObject = 'rl';
+ hook_secondlevelobject_ID = 'k';
+ hook_secondlevelobject_ModelID = 'H';
+ hook_secondlevelobject_Orientation = 'm';
+ hook_secondlevelobject_Model = 'j';
{Class WallDecorationSub2}
- class_WallDecorationSub2 = 'oda';
- hook_walldecorationsub2_Composite = 'O';
+ class_WallDecorationSub2 = 'fga';
+ hook_walldecorationsub2_Composite = 'G';
{Class FloorDecorationSub2}
- class_FloorDecorationSub2 = 'wn';
- hook_floordecorationsub2_Composite = 'fb';
+ class_FloorDecorationSub2 = 'mm';
+ hook_floordecorationsub2_Composite = 'Z';
{Class WallObjectSub2}
- class_WallObjectSub2 = 'vh';
- hook_wallobjectsub2_Composite = 'D';
+ class_WallObjectSub2 = 'sb';
+ hook_wallobjectsub2_Composite = 'T';
{Class GroundData}
- class_GroundData = 'tq';
- hook_grounddata_CollisionFlags = 'r';
- hook_grounddata_OffsetX = 'n';
- hook_grounddata_OffsetY = 'y';
+ class_GroundData = 'lka';
+ hook_grounddata_CollisionFlags = 'x';
+ hook_grounddata_OffsetX = 'b';
+ hook_grounddata_OffsetY = 'w';
+
+{Class GrandExchange}
+ class_GrandExchange = 'ut';
+ hook_grandexchange_getStatus = 'b';
+ hook_grandexchange_getID = 'g';
+ hook_grandexchange_getPrice = 'c';
+ hook_grandexchange_getTotal = 'e';
+ hook_grandexchange_getTransferred = 'i';
+ hook_grandexchange_getSpent = 'h';
View
358 Modules/Core/Interfaces.simba
@@ -27,6 +27,45 @@ begin
end;
(*
+R_GetValidInterfaces
+~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function R_GetValidInterfaces: TIntegerArray;
+
+Returns an array of all the valid interfaces.
+
+.. note::
+
+ by Drags111
+
+*)
+function R_GetValidInterfaces: TIntegerArray;
+var
+ Interfaces, IL, I, C: integer;
+begin
+ try
+ Interfaces := SmartGetFieldObject(0, hook_static_Interfaces);
+ IL := SmartGetFieldArraySize(Interfaces, '', 1);
+ SetLength(Result, IL);
+
+ for I := 0 to IL-1 do
+ begin
+ if(R_ValidInterface(I))then
+ begin
+ Result[C] :=I;
+ Inc(C);
+ end;
+ end;
+
+ SetLength(Result, C);
+ finally
+ SmartFreeObject(Interfaces);
+ end;
+end;
+
+(*
R_GetInterface
~~~~~~~~~~~~~~
@@ -49,8 +88,13 @@ begin
Exit;
Child := SmartGetFieldArray2DObject(0, hook_static_Interfaces, ParentI, ChildI);
- if not SmartIsNull(Child)then
- Result := Interface_Create(Child);
+ if SmartIsNull(Child)then
+ begin
+ SmartFreeObject(Child);
+ Exit;
+ end;
+
+ Result := Interface_Create(Child);
end;
(*
@@ -89,4 +133,314 @@ begin
Result := Interface_Create(Component);
end;
+function R_GetInterfaceParent(Child: TInterface): TInterface;
+var
+ ParentID: Integer;
+begin
+ ParentID := Interface_GetParentID(Child);
+ if ParentID > 0 then
+ Result := Interface_Create(SmartGetFieldArray2DObject(0, hook_static_Interfaces, ParentID shr 16, ParentID and $FFFF));
+end;
+
+(*
+R_GetValidChildren
+~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function R_GetValidChildren(ParentI : Integer): TIntegerArray;
+
+Returns all the children in the parent interface.
+
+.. note::
+
+ by pyroryan
+
+*)
+function R_GetValidChildren(ParentI : Integer): TIntegerArray;
+var
+ C, Child: Integer;
+begin
+ if not R_ValidInterface(ParentI) then Exit;
+ try
+ C := 0;
+ Child := SmartGetFieldArray2DObject(0, hook_static_Interfaces, ParentI, C);
+ while not SmartIsNull(Child) do
+ begin
+ SetArrayLength (Result, C+1);
+ Result[C] := C;
+ Inc(C);
+ SmartFreeObject(Child);
+ Child := SmartGetFieldArray2DObject(0, hook_static_Interfaces, ParentI, C);
+ end;
+ SetLength(Result, C);
+ finally
+ SmartFreeObject(Child);
+ end;
+end;
+
+(*
+R_GetValidComponents
+~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function R_GetValidComponents(ParentI, ChildI: Integer): TIntegerArray;
+
+Returns all the components in the parent-->child interface.
+
+.. note::
+
+ by mormonman
+
+*)
+function R_GetValidComponents(ParentI, ChildI: Integer): TIntegerArray;
+var
+ Child: TInterface;
+ C, Component: Integer;
+begin
+ try
+ Child := R_GetInterface(ParentI, ChildI);
+ if SmartIsNull(Child.Obj) then
+ Exit;
+ C := 0;
+ Component := SmartGetFieldArrayObject(Child.Obj, hook_interface_Children, C);
+ while not (SmartIsNull(Component)) do
+ begin
+ SetArrayLength (Result, C+1);
+ Result[C] := C;
+ Inc(C);
+ SmartFreeObject(Component);
+ Component := SmartGetFieldArrayObject(Child.Obj, hook_interface_Children, C);
+ end;
+ SetLength(Result, C);
+ finally
+ SmartFreeObject(Component);
+ Interface_Free(Child);
+ end;
+end;
+
+(*
+R_FindInterface
+~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function R_FindInterface(Text: String; SearchConst: Integer): TInterface;
+Returns the interface that contains the text.
+ @Text - EXACT text to search for(case-sensitive)
+ @SearchConst - SEARCH_NAME = Search Interface.GetName
+ SEARCH_TEXT = Search Interface.GetText
+ SEARCH_ACTION = Search Interface.GetActions
+
+.. note::
+
+ by mormonman
+
+*)
+function R_FindInterface(Text: String; SearchConst: Integer): TInterface;
+var
+ IntArr, ChildArr, CompArr: TIntegerArray;
+ Child: TInterface;
+ i, h, j: Integer;
+ Actions: TStringArray;
+ T: String;
+begin
+ IntArr := R_GetValidInterfaces;
+ if (High(IntArr) < 0) then Exit;
+ for i := 0 to High(IntArr) do
+ begin
+ ChildArr := R_GetValidChildren(IntArr[i]);
+ if (High(ChildArr) < 0) then Continue;
+ for h := 0 to High(ChildArr) do
+ begin
+ Child := R_GetInterface(IntArr[i], ChildArr[h]);
+ case SearchConst of
+ SEARCH_NAME : T := Interface_GetName(Child);
+ SEARCH_TEXT : T := Interface_GetText(Child);
+ SEARCH_ACTION :
+ begin
+ Actions := Interface_GetActions(Child);
+ if R_StrInArr(Text, Actions) then
+ begin
+ Result := Child;
+ Exit;
+ end;
+ end;
+ else Exit;
+ end;
+ if SearchConst < SEARCH_ACTION then
+ if (Pos(Text, T) > 0) then
+ begin
+ Result := Child;
+ Exit;
+ end;
+ Interface_Free(Child);
+ CompArr := R_GetValidComponents(IntArr[i], ChildArr[h]);
+ if (High(CompArr) < 0) then Continue;
+ for j := 0 to High(CompArr) do
+ begin
+ Child := R_GetInterfaceComponent(IntArr[i], ChildArr[h], CompArr[j]);
+ case SearchConst of
+ SEARCH_NAME : T := Interface_GetName(Child);
+ SEARCH_TEXT : T := Interface_GetText(Child);
+ SEARCH_ACTION :
+ begin
+ Actions := Interface_GetActions(Child);
+ if R_StrInArr(Text, Actions) then
+ begin
+ Result := Child;
+ Exit;
+ end;
+ end;
+ else Exit;
+ end;
+ if SearchConst < SEARCH_ACTION then
+ if (Pos(Text, T) > 0) then
+ begin
+ Result := Child;
+ Exit;
+ end;
+ Interface_Free(Child);
+ end;
+ end;
+ end;
+end;
+
+(*
+R_ClickInterface
+~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ procedure R_ClickInterface(Child: TInterface; ClickType: Integer);
+
+Moves the mouse to and (depending on the ClickType) will click the interface
+child/component. The ClickType follows the same rule as MouseBox:
+ 1/mouse_Left : Left Click
+ 2/mouse_Right : Right Click
+ 3/mouse_Move : No Click
+
+.. note::
+
+ by Drags111
+
+*)
+procedure R_ClickInterface(Child: TInterface; ClickType: Integer);
+var
+ Box: TBox;
+begin
+ Box := Interface_GetBounds(Child);
+ R_MouseBox(Box.X1, Box.Y1, Box.X2, Box.Y2, ClickType);
+end;
+
+(*
+R_ClickInterfaceMiddle
+~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ procedure R_ClickInterfaceMiddle(Child: TInterface; ClickType, Range: Integer);
+
+Moves the mouse to and (depending on the ClickType) will click the interface
+child/component in a RangexRange box of the middle point. The ClickType follows
+the same rule as MouseBox:
+ 1/mouse_Left : Left Click
+ 2/mouse_Right : Right Click
+ 3/mouse_Move : No Click
+
+.. note::
+
+ by mormonman
+
+*)
+procedure R_ClickInterfaceMiddle(Child: TInterface; ClickType, Range: Integer);
+var
+ P: TPoint;
+begin
+ P := R_MiddleBox(Interface_GetBounds(Child));
+ R_MouseBox(P.x - (Range/2), P.y - (Range/2), P.x + (Range/2), P.y + (Range/2), ClickType);
+end;
+
+(*
+R_ScrollTo
+~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function R_ScrollTo(Target, UpA, DnA: TInterfaceChild) : Boolean;
+
+Scrolls to the Target using the Up and Down arrows specified by ScrollBar.
+
+.. note::
+
+ by mormonman
+
+*)
+function R_ScrollTo(Target, ScrollBar: TInterface) : Boolean;
+var
+ T, I, x, y: Integer;
+ Bounds, InBox: TBox;
+ P1, P2: TPoint;
+ UpA, DnA, Box: TInterface;
+ Dir: String;
+begin
+ if (Interface_GetID(Target) < 1) then Exit;
+ try
+ UpA := Interface_Create(SmartGetFieldArrayObject(ScrollBar.Obj, hook_Interface_Children, SCROLLBAR_UP));
+ DnA := Interface_Create(SmartGetFieldArrayObject(ScrollBar.Obj, hook_Interface_Children, SCROLLBAR_DOWN));
+
+ Bounds := Interface_GetBounds(Target);
+ Box := R_GetInterfaceParent(ScrollBar);
+ InBox := Interface_GetBounds(Box);
+ P1 := Point(Bounds.X1, Bounds.Y1);
+ P2 := Point(Bounds.X2, Bounds.Y2);
+ Result := PointInBox(P1, InBox)
+ and PointInBox(P2, InBox)
+ and not Interface_IsHidden(Target);
+ if Result then
+ Exit;
+
+ for I := 1 to 2 do
+ begin
+ if(P1.y < InBox.Y1)then
+ Dir := 'up'
+ else if(P2.y > InBox.Y2)then
+ Dir := 'down';
+ if(dir = '')then
+ begin
+ R_Debug('Error getting destination direction.', 'R_ScrollTo');
+ Exit;
+ end;// else R_Debug('Dir: ' +Dir, 'R_ScrollTo');
+
+ case dir of
+ 'up': R_ClickInterface(UpA, 3);
+ 'down': R_ClickInterface(DnA, 3);
+ end;
+ GetMousePos(x, y);
+ HoldMouse(x, y, 1);
+ T := GetSystemTime + 10000;
+
+ while not(PointInBox(P1, InBox) and PointInBox(P2, InBox)) do
+ begin
+ if(GetSystemTime > T)then
+ break;
+ wait(100+Random(50));
+ Bounds := Interface_GetBounds(Target);
+ P1 := Point(Bounds.X1, Bounds.Y1);
+ P2 := Point(Bounds.X2, Bounds.Y2);
+ end;
+
+ ReleaseMouse(x, y, 1);
+ Wait(500+Random(100));
+ Result := PointInBox(P1, InBox) and PointInBox(P2, InBox);
+ if Result then
+ Continue;
+ end;
+ finally
+ Interface_Free(UpA);
+ Interface_Free(DnA);
+ Interface_Free(Box);
+ end;
+end;
View
65 Modules/Core/Mouse.simba
@@ -9,12 +9,12 @@ Mouse routines.
(*
-WindMouse
+R_WindMouse
~~~~~~~~~
.. code-block:: pascal
- procedure WindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, maxStep, targetArea: extended);
+ procedure R_WindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, maxStep, targetArea: extended);
.. note::
@@ -81,12 +81,12 @@ begin
end;
(*
-MMouse
+R_MMouse
~~~~~~
.. code-block:: pascal
- procedure MMouse(x, y, rx, ry: integer);
+ procedure R_MMouse(x, y, rx, ry: integer);
Moves the mouse.
@@ -161,22 +161,19 @@ begin
end;
(*
-MouseAction
+R_MouseAction
~~~~~~~~~~~
.. code-block:: pascal
- function MouseAction(left: boolean): integer;
+ function R_MouseAction(left: boolean): integer;
Converts the (SCAR) boolean for mouse button the the Simba integer for the button
.. note::
by Simba development
-.. note::
- This should probably be removed.
-
Example:
.. code-block:: pascal
@@ -191,12 +188,12 @@ begin
end;
(*
-ClickMouse2
+R_ClickMouse2
~~~~~~~~~~~
.. code-block:: pascal
- procedure ClickMouse2(left : boolean);
+ procedure R_ClickMouse2(left : boolean);
Clicks the mouse in a human way on the current mouse spot.
@@ -225,12 +222,12 @@ begin
end;
(*
-Mouse
+R_Mouse
~~~~~
.. code-block:: pascal
- procedure Mouse(mousex, mousey, ranx, rany: Integer; left: Boolean);
+ procedure R_Mouse(mousex, mousey, ranx, rany: Integer; left: Boolean);
Moves then clicks mouse.
@@ -252,12 +249,12 @@ begin
end;
(*
-MouseBox
+R_MouseBox
~~~~~~~~
.. code-block:: pascal
- procedure MouseBox(x1, y1, x2, y2: Integer; ClickType: Integer);
+ procedure R_MouseBox(x1, y1, x2, y2: Integer; ClickType: Integer);
Moves mouse into a random position in the box. Clicks if told to.
@@ -273,21 +270,21 @@ Example:
procedure R_MouseBox(x1, y1, x2, y2: Integer; ClickType: Integer);
begin
case ClickType of
- 1 : R_Mouse(RandomRange(x1, x2), RandomRange(y1, y2), 0, 0, True);
- 2 : R_Mouse(RandomRange(x1, x2), RandomRange(y1, y2), 0, 0, False);
- 3 : R_MMouse(RandomRange(x1, x2), RandomRange(y1, y2), 0, 0);
+ mouse_Left : R_Mouse(RandomRange(x1, x2), RandomRange(y1, y2), 0, 0, True);
+ mouse_Right : R_Mouse(RandomRange(x1, x2), RandomRange(y1, y2), 0, 0, False);
+ mouse_Move : R_MMouse(RandomRange(x1, x2), RandomRange(y1, y2), 0, 0);
else
R_Debug('ClickType is NOT a valid number!', 'MouseBox');
end;
end;
(*
-SleepAndMoveMouse
+R_SleepAndMoveMouse
~~~~~~~~~~~~~~~~~
.. code-block:: pascal
- procedure SleepAndMoveMouse(Time: Integer);
+ procedure R_SleepAndMoveMouse(Time: Integer);
Waits for specified time and moves mouse around like bored human would.
@@ -345,12 +342,12 @@ begin
end;
(*
-DragMouse
+R_DragMouse
~~~~~~~~~
.. code-block:: pascal
- procedure DragMouse(StartX, StartY, SRandX, SRandY, EndX, EndY, ERandX, ERandY: Integer);
+ procedure R_DragMouse(StartX, StartY, SRandX, SRandY, EndX, EndY, ERandX, ERandY: Integer);
Leftclicks StartX, StartY and drags mouse to EndX, EndY.
@@ -375,3 +372,27 @@ begin
GetMousePos(EndX, EndY);
ReleaseMouse(EndX, EndY, R_MouseAction(true));
end;
+
+(*
+R_MiddleBox
+~~~~~~~~~
+
+.. code-block:: pascal
+
+ function R_MiddleBox(b : TBox) : TPoint;
+
+Returns the middle of the box.
+
+.. note::
+
+ by Raym0nd
+
+Example:
+
+.. code-block:: pascal
+
+*)
+function R_MiddleBox(B : TBox) : TPoint;
+begin
+ result := Point((B.x2+B.x1) div 2,(B.y2+B.y1) div 2);
+end;
View
565 Wrappers/Interface.simba
@@ -22,15 +22,15 @@ begin
end;
(*
-R_GetInterfaceParentID
+Interface_GetParentID
~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: pascal
- function R_GetInterfaceParentID(Obj: Integer): Integer;
+ function Interface_GetParentID(IFace: TInterface): Integer;
-Gets the ID of the parent of the specified interface. Used for absolute
-positioning.
+Gets the ID of the parent of the specified interface. Used for any
+part of the interface information that relies on the parent.
.. note::
@@ -87,6 +87,22 @@ begin
end;
end;
+(*
+Interface_GetAbsolutePos
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetAbsolutePos(IFace: TInterface): TPoint;
+
+Gets the absolute position of the interface. Uses parent to account for
+scrollbar and the parent's location.
+
+.. note::
+
+ by Drags111
+
+*)
function Interface_GetAbsolutePos(IFace: TInterface): TPoint;
var
X, Y, ParentID, BoundIndex: Integer;
@@ -130,3 +146,544 @@ begin
end;
Result := Point(X, Y);
end;
+
+(*
+Interface_GetActions
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetActions(IFace: TInterface): TStringArray;
+
+Gets the actions of the IFace.
+
+.. note::
+
+ by Drags111
+
+*)
+function Interface_GetActions(IFace: TInterface): TStringArray;
+var
+ Length, C, i: Integer;
+ Action: String;
+begin
+ Length := SmartGetFieldArraySize(IFace.Obj, Hook_Interface_Actions, 1);
+ if (Length <= 0)then
+ Exit;
+
+ C := 0;
+ SetLength(Result, Length);
+
+ for i := 0 to Length-1 do
+ begin
+ Action := SmartGetFieldArrayString(IFace.Obj, hook_interface_Actions, i);
+ if(Action <> '')then
+ begin
+ Result[C] := Action;
+ Inc(C);
+ end;
+ end;
+ SetLength(Result, C);
+end;
+
+(*
+Interface_IsHidden
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_IsHidden(IFace: TInterface): Boolean;
+
+Gets Interface.IsHidden. Uses parent information
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_IsHidden(IFace: TInterface): Boolean;
+var
+ ParentID: Integer;
+ Parent: TInterface;
+begin
+ ParentID := Interface_GetParentID(IFace);
+ if(ParentID > 0)then
+ begin
+ try
+ Parent := Interface_Create(SmartGetFieldArray2DObject(0, hook_static_Interfaces, ParentID shr 16, ParentID and $FFFF));
+ Result := SmartGetFieldBoolean(Parent.Obj, hook_interface_IsHidden);
+ finally
+ Interface_Free(Parent);
+ end;
+ end else Result := SmartGetFieldBoolean(IFace.Obj, hook_interface_IsHidden);
+end;
+
+(*
+Interface_GetID
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetID(IFace: TInterface): Integer;
+
+Gets Interface.ID
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetID(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_ID);
+end;
+
+(*
+Interface_GetComponentID
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetComponentID(IFace: TInterface): Integer;
+
+Gets Interface.ComponentID
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetComponentID(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_ComponentID);
+end;
+
+(*
+Interface_GetStackSize
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetStackSize(IFace: TInterface): Integer;
+
+Gets Interface.ComponentStackSize
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetStackSize(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_ComponentStackSize);
+end;
+
+(*
+Interface_GetTextureID
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetTextureID(IFace: TInterface): Integer;
+
+Gets Interface.TextureID
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetTextureID(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_TextureID);
+end;
+
+(*
+Interface_GetModelID
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetModelID(IFace: TInterface): Integer;
+
+Gets Interface.ModelID
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetModelID(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_ModelID);
+end;
+
+(*
+Interface_GetModelZoom
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetModelZoom(IFace: TInterface): Integer;
+
+Gets Interface.ModelZoom
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetModelZoom(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_ModelZoom);
+end;
+
+(*
+Interface_GetRelativeX
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetRelativeX(IFace: TInterface): Integer;
+
+Gets Interface.X; It doesn't account for parent offsets.
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetRelativeX(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_X);
+end;
+
+(*
+Interface_GetRelativeY
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetRelativeY(IFace: TInterface): Integer;
+
+Gets Interface.Y; It doesn't account for parent offsets.
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetRelativeY(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_Y);
+end;
+
+(*
+Interface_GetWidth
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetWidth(IFace: TInterface): Integer;
+
+Gets Interface.Width
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetWidth(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_Width);
+end;
+
+(*
+Interface_GetHeight
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetHeight(IFace: TInterface): Integer;
+
+Gets Interface.Height
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetHeight(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_Height);
+end;
+
+(*
+Interface_GetText
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetText(IFace: TInterface): String;
+
+Gets Interface.Text
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetText(IFace: TInterface): String;
+begin
+ Result := SmartGetFieldString(IFace.Obj, hook_interface_Text);
+end;
+
+(*
+Interface_GetTextColor
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetTextColor(IFace: TInterface): Integer;
+
+Gets Interface.TextColor
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetTextColor(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_TextColor);
+end;
+
+(*
+Interface_GetName
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetName(IFace: TInterface): String;
+
+Gets Interface.Name
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetName(IFace: TInterface): String;
+begin
+ Result := SmartGetFieldString(IFace.Obj, hook_interface_ComponentName);
+end;
+
+(*
+Interface_GetVScrollSize
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetVScrollSize(IFace: TInterface): Integer;
+
+Gets Interface.VerticalScrollBarSize; Interface must be a vertical
+scrollbar
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetVScrollSize(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_VerticalScrollBarSize);
+end;
+
+(*
+Interface_GetVScrollPosition
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetVScrollPosition(IFace: TInterface): Integer;
+
+Gets Interface.VerticalScrollBarPosition; Interface must be a vertical
+scrollbar
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetVScrollPosition(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_VerticalScrollBarPosition);
+end;
+
+(*
+function Interface_GetVThumbSize(IFace: TInterface): Integer;
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetVThumbSize(IFace: TInterface): Integer;
+
+Gets Interface.VerticalScrollBarThumbSize; Interface must be a vertical
+scrollbar
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetVThumbSize(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_VerticalScrollBarThumbSize);
+end;
+
+(*
+Interface_GetHScrollSize
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetHScrollSize(IFace: TInterface): Integer;
+
+Gets Interface.HorizontalScrollBarSize; Interface must be a horizontal
+scrollbar
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetHScrollSize(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_HorizontalScrollBarSize);
+end;
+
+(*
+Interface_GetHScrollPosition
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetHScrollPosition(IFace: TInterface): Integer;
+
+Gets Interface.HorizontalScrollBarPosition; Interface must be a horizontal
+scrollbar
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetHScrollPosition(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_HorizontalScrollBarPosition);
+end;
+
+(*
+Interface_GetHThumbSize
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetHThumbSize(IFace: TInterface): Integer;
+
+Gets Interface.HorizontalScrollBarThumbSize; Interface must be a horizontal
+scrollbar
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetHThumbSize(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_HorizontalScrollBarThumbSize);
+end;
+
+(*
+Interface_GetBoundsArrayIndex
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetBoundsArrayIndex(IFace: TInterface): Integer;
+
+Gets Interface.BoundArrayIndex. Used for getting absolute position
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetBoundsArrayIndex(IFace: TInterface): Integer;
+begin
+ Result := SmartGetFieldInt(IFace.Obj, hook_interface_BoundsArrayIndex);
+end;
+
+(*
+Interface_GetX
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetX(IFace: TInterface): Integer;
+
+Gets Interface's onscreen x position
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetX(IFace: TInterface): Integer;
+begin
+ Result := Interface_GetAbsolutePos(IFace).x;
+end;
+
+(*
+Interface_GetY
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetY(IFace: TInterface): Integer;
+
+Gets Interface's onscreen y position
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetY(IFace: TInterface): Integer;
+begin
+ Result := Interface_GetAbsolutePos(IFace).y;
+end;
+
+(*
+Interface_GetBounds
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: pascal
+
+ function Interface_GetBounds(IFace: TInterface): TBox;
+
+Gets Interface's onscreen bounds
+
+.. note::
+
+ by mormonman
+
+*)
+function Interface_GetBounds(IFace: TInterface): TBox;
+var
+ P: TPoint;
+begin
+ P.x := Interface_GetX(IFace) + Interface_GetWidth(IFace);
+ P.y := Interface_Gety(IFace) + Interface_GetHeight(IFace);
+ Result := PointToBox(Interface_GetAbsolutePos(IFace), P);
+end;

0 comments on commit 668fdd2

Please sign in to comment.