SphereCommunity
if same tags? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: if same tags? (/Thread-if-same-tags)



if same tags? - x77x - 10-23-2015 09:09 PM

comparing tags
whats the right way to do this?

Code:
ON=@CLICK
IF <src.tag.army> == <i.tag.army>
TAG.NAME.HUE 03f//FRIEND
//RETURN 0
ELSE
IF !<src.tag.army> == <i.tag.army>
TAG.NAME.HUE 090//ENEMY
ATTACK

the tag.army is TEXT


RE: if same tags? - Extreme - 10-23-2015 09:40 PM

IF STRMATCH("<SRC.TAG.X>","<TAG.X>")
// EQUAL
ELSE
//NOT EQUAL
ENDIF


RE: if same tags? - Coruja - 10-25-2015 02:05 AM

if the tag is numeric you can compare it directly using
IF (<TAG0.A> == <TAG0.B>)

but if it's a string (text) you must use STRCMP, STRCMPI or STRMATCH
IF !STRCMP("<TAG.A>", "<TAG.B>")
IF !STRCMPI("<TAG.A>", "<TAG.B>")
IF STRMATCH("<TAG.A>", "<TAG.B>")