HOW TO USE IF STATEMENT IN OPENBULLET 2?

Hi, Thanks for your time.
I just wanna know how to write this correctly ( BTW views is a block )

IF views MoreThan 101
“use just 100 instead”

ELSE “keep it as it is”

I guess may be it will wrong but I tried.

IF STRINGKEY @VIEWS Contains 101

VAR @VIEWS = 100

ELSE

return;

END

Thanks for your time bro but still not working

It’s case sensitive, and the code you posted is incorrect

IF INTKEY @views GreaterThan 100
views = 100;
END

This is assuming that views is an integer, otherwise if it’s a string you can do this

IF INTKEY @views GreaterThan 100
views = "100";
END

I will add blocks to take the min and max so this will be easier to do

2 Likes