Hishutup

Untitled

Aug 27th, 2015
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.45 KB | None | 0 0
  1. function GetCoOrdinates(e: IInterface): string;
  2. var
  3.   sName, sGrid: string;
  4.   iWrldPos: Integer;
  5. begin
  6.   sName := Name(e);
  7.   iWrldPos := Pos('[WRLD:', sName);
  8.   if iWrldPos <> 0 then sGrid := Copy(sName, iWrldPos+Length('[WRLD:00000000] at ')+1, Length(sName)-(iWrldPos+Length('[WRLD:00000000] at ')+1));
  9.   Result := sGrid;
  10. end;
  11.  
  12. function StrBeginsWith(s, delimiter: string): string;
  13. var
  14.     sTempString: string;
  15.     iCharCount: int;
  16. begin
  17.     iCharCount := Pred(Pos(delimiter, s));
  18.     if iCharCount <> 0 then begin
  19.         sTempString := Copy(s,0,iCharCount);
  20.     end;
  21.     Result := sTempString;
  22. end;
  23.  
  24. function StrToBool(s: string): Boolean;
  25. begin
  26.   result := (LowerCase(s) = 'true') OR (s = '1');
  27. end;
  28.  
  29. function IsStatic(e: IInterface): Boolean;
  30. begin
  31.   Result := (Pos('STAT:',Name(e)) <> 0);
  32. end;
  33.  
  34. //Function to retrieve the FormID string of a Cell that is linked via XTEL\DOOR
  35. function GetLinkedCellFormID(e: IInterface): string;
  36. var
  37.   sFormID, sTemp: string;
  38. begin
  39.   sTemp := geev(e, 'XTEL\Door');
  40.   //Search for CELL: in the string, appears to be the only Identifing trait of the geev
  41.   sFormID := Copy(sTemp,Pos('CELL:',sTemp)+5,8);
  42.   //Returns full LinkedFormID
  43.   Result := sFormID;
  44. end;
  45.  
  46. //Function to get the EDID of a Cell via the XTEL\DOOR
  47. function GetLinkedCellEDID(e: IInterface): string;
  48. var
  49.   sFormID: string;
  50. begin
  51.   sFormID := GetLinkedCellFormID(e);
  52.   //AddMessage(sFormID);
  53.   Result := geev(RecordByHexFormID(sFormID),'EDID');
  54. end;
Advertisement
Add Comment
Please, Sign In to add comment