is_unrestricted

Pazleysox

Member
Not sure how long it's been broken...
But, this doesn't work.
Code:
    string body;
    body = visit_url("clan_viplounge.php?whichfloor=2");
if(is_unrestricted(contains_text(body,"aprilshower.gif") && get_property("_aprilShower") == "false")) { cli_execute("Shower cold"); }

This does work though.
Code:
    string body;
    body = visit_url("clan_viplounge.php?whichfloor=2");
if(contains_text(body,"aprilshower.gif") && get_property("_aprilShower") == "false") { cli_execute("Shower cold"); }

Did something change, or was my code always wrong?
 

Veracity

Developer
Staff member
Assuming (contains_text(body,"aprilshower.gif") && get_property("_aprilShower") == "false") is true, you are asking for

is_unrestricted(true)

What are you expecting that to return?
 

Pazleysox

Member
When I wrote the script I was trying to tell the script if the shower was available, use the shower. I figured out what I had done wrong, by going back and looking at the is_unrestricted reference page.
I thought I had posted my correction.

if(is_unrestricted("april shower") && get_property("_aprilShower") == "false") { cli_execute("Shower cold"); }

works properly now. I'm updating my script.
 

ckb

Minion
Staff member
I don't think that will work the way you expect it to, since there really isn't a thing called "april shower".
Also, is_unrestricted("some random text") = true

Try this:
Code:
if (is_unrestricted($item[Clan shower]) && !to_boolean(get_property("_aprilShower"))) { cli_execute("Shower cold"); }
 
Top