Filter with "Like" or "Contains"?

Designing a filter? Get tips and advice from other users. Suggest new filter features here too.

Moderators: Moderators, Support

Filter with "Like" or "Contains"?

Postby odie3 » Tue Feb 17, 2009 12:36 pm

Hi Ron,

How do you do a rule where you want to find servers with a Like or Contains?

Say you have a server Title, "I am Server running This and That". Then I want to create a filter where it shows all servers that have "This" in the title.

Does this make sense?
Image

Image
User avatar
odie3
Qtracker Registered Owner
Qtracker Registered Owner
 
Posts: 430
Joined: Sun May 28, 2006 1:08 pm
Location: Kyle, TX

Re: Filter with "Like" or "Contains"?

Postby ron.mercer » Tue Feb 17, 2009 5:12 pm

odie3 wrote:Hi Ron,

How do you do a rule where you want to find servers with a Like or Contains?

Say you have a server Title, "I am Server running This and That". Then I want to create a filter where it shows all servers that have "This" in the title.

Does this make sense?

That's an easy one:
Code: Select all
if find([$server_name], "this", 0) != -1
Ron Mercer
Qtracker

Image
User avatar
ron.mercer
Site Admin
 
Posts: 3196
Joined: Tue Dec 09, 2003 5:01 pm
Location: Ohio, USA

Re: Filter with "Like" or "Contains"?

Postby odie3 » Tue Feb 17, 2009 6:12 pm

Okay, got that to work for title but then thought I rather do MOD instead.

So, here is an example for MODs: if rule("mod") == "CA;DBE1;beta;@ACE;@ACE-Islands;@opx"

I wanted to pick out ACE - but went I try to make it, it just does not work. :(
Image

Image
User avatar
odie3
Qtracker Registered Owner
Qtracker Registered Owner
 
Posts: 430
Joined: Sun May 28, 2006 1:08 pm
Location: Kyle, TX

Re: Filter with "Like" or "Contains"?

Postby ron.mercer » Tue Feb 17, 2009 8:04 pm

odie3 wrote:Okay, got that to work for title but then thought I rather do MOD instead.

So, here is an example for MODs: if rule("mod") == "CA;DBE1;beta;@ACE;@ACE-Islands;@opx"

I wanted to pick out ACE - but went I try to make it, it just does not work. :(

What's rule "mod"? Does that exist on the server?

If you meant the server modification, then try this:

Code: Select all
if find([$server_modification], "ACE", 0) != -1


Or if you really wanted to test the rule "mod":

Code: Select all
if find(rule("mod"), "ACE", 0) != -1


Or even:

Code: Select all
if find(rule("mod"), "@ACE;", 0) != -1
Ron Mercer
Qtracker

Image
User avatar
ron.mercer
Site Admin
 
Posts: 3196
Joined: Tue Dec 09, 2003 5:01 pm
Location: Ohio, USA

Re: Filter with "Like" or "Contains"?

Postby odie3 » Tue Feb 17, 2009 8:37 pm

This is for ArmA, which has MODs (kind of like mutators in UT).

Your second one works like charm - thanks!!!!
Image

Image
User avatar
odie3
Qtracker Registered Owner
Qtracker Registered Owner
 
Posts: 430
Joined: Sun May 28, 2006 1:08 pm
Location: Kyle, TX


Return to Filters

Who is online

Users browsing this forum: No registered users and 1 guest

cron