Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function FindClan( strPlayer )
- {
- local
- D_DELIM = regexp(@"([\[(=^<{]+\w+[\])=^>}]+)"),// Checking for double delimiter like [TX],{TX},(TX),=TX=,^TX^,<TX>
- D_DELIM_SYM_2 = regexp(@"([\[(=^<{]+\w+[\.*-=]+\w+[\])=^>}]+)"), // Checking the presence of symbolic clan tag with 2 alphanumeric values like [T-X]Azazel [ Double Delimiter ]
- D_DELIM_SYM_3 = regexp(@"([\[(=^<{]+\w+[\.*-=]+\w+[\.*-=]+\w+[\])=^>}]+)"), // Checking the presence of symbolic clan tag with 3 alphanumeric values like [F.O.X]Sofia [ Double Delimiter ]
- S_DELIM = regexp(@"(\w.+[.*=]+)"), // Checking for single delimiter like VT. VT= VT*
- D_DELIM_res = D_DELIM.capture(strPlayer),// Capturing for the double delimiter expression in player.Name [ will return some array blocks of clan as [TX] < WITH THE CLAN TAG SYMBOL INCLUDED>]
- D_DELIM_SYM_2_res = D_DELIM_SYM_2.capture(strPlayer), // Capturing for T-X / T.X / T*X Type
- D_DELIM_SYM_3_res = D_DELIM_SYM_3.capture(strPlayer), // Capturing for F-O-X / F.O.X / F*O*X Type
- S_DELIM_res = S_DELIM.capture(strPlayer); // Capturing for the single delimiter expression in player.Name [ will return some array blocks as VT. < WITH THE CLAN TAG SYMBOL INCLUDED>]
- if ( D_DELIM_res != null ) // Are captured expressions true ? Do they physically exist in memory?
- {
- return strPlayer.slice( D_DELIM_res[ 0 ].begin + 1, D_DELIM_res[ 0 ].end - 1 ); // Slicing [TX] into TX by moving 1 step forward from beginning & same step backward from the end
- }
- else if ( D_DELIM_SYM_2_res != null )
- {
- local tag_sym_2 = strPlayer.slice( D_DELIM_SYM_2_res[ 0 ].begin + 1, D_DELIM_SYM_2_res[ 0 ].end - 1 ); // Slicing [T-X] into T-X by moving 1 step forward from beginning & same step backward from the end
- local amalgamate_2 = split(tag_sym_2, ".*-="); // Splitting T-X into 2 array blocks like a[0] = T, a[1] = X [ DEFINED BY SEPARATORS ]
- return (amalgamate_2[0]+amalgamate_2[1]); // Returning the Sum i.e. TX
- }
- else if ( D_DELIM_SYM_3_res != null ) // Are captured expressions true ? Do they physically exist in memory?
- {
- local tag_sym_3 = strPlayer.slice( D_DELIM_SYM_3_res[ 0 ].begin + 1, D_DELIM_SYM_3_res[ 0 ].end - 1 ); // Slicing [F.0.X] into F.O.X by moving 1 step forward from beginning & same step backward from the end
- local amalgamate_3 = split(tag_sym_3, ".*-="); // Splitting F.O.X into 3 array blocks like a[0] = F, a[1] = 0, a[2] = X [ DEFINED BY SEPARATORS ]
- return (amalgamate_3[0]+amalgamate_3[1]+amalgamate_3[2]); // Returning the Sum i.e. FOX
- }
- else if ( S_DELIM_res != null )
- {
- return strPlayer.slice( S_DELIM_res[ 0 ].begin, S_DELIM_res[ 0 ].end - 1 ); // Slicing VT. into VT by moving 1 step backward from the end
- }
- else return null; // No such expressions found? Probably player isn't in a clan. Let's return null !!!
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement