(* Lodestone ========= The lodestone file contains various methods for interacting with the lodestone interface. The source for this file can be found `here `_. *) (* tLodestone.clickTeleport() ~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: pascal function tLodestone.clickTeleport(funcTeleport:string):boolean; Description: Clicks the desired teleport on the lodestone interface. Information: * Returns true if successful. * Uses the mouse. .. note:: - by Obscurity - Last Updated: 2015-07-30 Example: .. code-block:: pascal if lodestone.hasLodestone() then lodestone.clickTeleport('ardougne'); *) function tLodestone.clickTeleport(funcTeleport:string):boolean; var funcColourID, funcID:int32; funcPointer:^glTexture; funcPointerSize:uInt32; funcPoint: TPoint; begin funcTeleport:=replaceRegExpr('(\W|_)*',lowercase(funcTeleport),'',false); case funcTeleport of 'alkharid': begin funcColourID:=4663319; funcID:=118468; end; 'ardougne': begin funcColourID:=4470070; funcID:=109112; end; 'ashdale': begin funcColourID:=4213320; funcID:=139612; end; 'banditcamp': begin funcColourID:=4340541; funcID:=118532; end; 'burthorpe': begin funcColourID:=7029815; funcID:=108202; end; 'canifis': begin funcColourID:=5524281; funcID:=106931; end; 'catherby': begin funcColourID:=3163986; funcID:=112034; end; 'draynorvillage': begin funcColourID:=3546643; funcID:=100294; end; 'eaglespeak': begin funcColourID:=4012080; funcID:=104284; end; 'edgeville': begin funcColourID:=3356215; funcID:=112034; end; 'falador': begin funcColourID:=3293009; funcID:=109112; end; 'fremennikprovince': begin funcColourID:=5192232; funcID:=132336; end; 'karamja': begin funcColourID:=4477241; funcID:=132336; end; 'lumbridge': begin funcColourID:=4343371; funcID:=109112; end; 'lunarisle': begin funcColourID:=3620933; funcID:=133868; end; 'ooglog': begin funcColourID:=3616056; funcID:=111093; end; 'portsarim': begin funcColourID:=7697780; funcID:=144930; end; 'prifddinas': begin funcColourID:=2182716; funcID:=126900; end; 'seersvillage': begin funcColourID:=4013122; funcID:=100532; end; 'taverley': begin funcColourID:=2831683; funcID:=112804; end; 'tirannwn': begin funcColourID:=3291177; funcID:=103929; end; 'varrock': begin funcColourID:=6310183; funcID:=109112; end; 'wildernessvolcano': begin funcColourID:=3879202; funcID:=103415; end; 'yanille': begin funcColourID:=4274729; funcID:=112276; end; end; if funcID then begin funcPointer:=glTextures(funcPointerSize)+(oglTextureSize*(funcPointerSize-1)); for 0 to funcPointerSize-1 do begin if (funcPointer^.id=funcID) and similarColors(funcPointer^.colourID,funcColourID,oglColourTolerance) then begin funcPoint:=funcPointer^.bounds.normalizePoint(); clickMouse(funcPoint.x, funcPoint.y, 1); result:=true; break; end; funcPointer-=oglTextureSize; end; end; exit(result); end; (* tLodestone.hasLodestone() ~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: pascal function tLodestone.hasLodestone():boolean; Description: Retrieves if the lodestone interface exists. Information: * Returns false or true, relative to the state of the lodestone interface. .. note:: - by Obscurity - Last Updated: 2015-07-30 Example: .. code-block:: pascal if not lodestone.hasLodestone() then minimap.clickHomeTeleport(); *) function tLodestone.hasLodestone():boolean; var funcPointer:^glTexture; funcPointerSize:uInt32; begin funcPointer:=glTextures(funcPointerSize)+(oglTextureSize*(funcPointerSize-1)); for 0 to funcPointerSize-1 do begin if funcPointer^.id=35667360 then begin result:=true; break; end; funcPointer-=oglTextureSize; end; exit(result); end; (* tLodestone.isTeleporting() ~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: pascal function tLodestone.isTeleporting():boolean; Description: Retrieves if the player is teleporting. If the standard teleport animation is overriden, the method will return false. Information: * Returns false or true, relative to the teleportation animation. .. note:: - by Obscurity - Last Updated: 2015-07-30 Example: .. code-block:: pascal if not lodestone.isTeleporting() then minimap.clickHomeTeleport(); *) function tLodestone.isTeleporting():boolean; var funcPointer:^glModel; funcPointerSize:uInt32; begin funcPointer:=glModels(funcPointerSize)+(oglModelSize*(funcPointerSize-1)); for 0 to funcPointerSize-1 do begin if funcPointer^.id=582831184 then begin result:=true; break; end; funcPointer-=oglModelSize; end; exit(result); end;