Checking Inventory Setting

Arakasi

New member
I've been messing around with this for an hour. I'm hoping I'm missing something obvious and someone can point out my stupidity. I'm trying to check if INV images are on/off.

Code:
debugalways(visit_url("account.php?tab=inventory"));
//ON: <input type="checkbox" value="1" checked="checked" name="flag_invimages"/>
//OFF: <input type="checkbox" value="1" name="flag_invimages"/>
if (index_of(visit_url("account.php?tab=inventory"), "value=\"1\" name=\"flag_invimages\"/>") > 0) {
	debugalways("Inventory Images are Hidden.");
} else {
	debugalways("Inventory Images are not Hidden.");
}

This always falls into "Not Hidden". What stupid thing am I overlooking? Thanks!
 

Theraze

Active member
Do you need to escape the /> as well? I probably would... \/\>. Or just stop after the flag_invimages text. For that matter, I'd probably look for:
checked\" name=\"flag_invimages
instead. Less escaping needed.
 

lostcalpolydude

Developer
Staff member
Your commented page source is wrong. KoL includes multiple spaces between those parts, and you need to match that nonsensical number of spaces.
 

Arakasi

New member
Do you need to escape the /> as well? I probably would... \/\>. Or just stop after the flag_invimages text. For that matter, I'd probably look for:
checked\" name=\"flag_invimages
instead. Less escaping needed.

No I don't need to escape .. it finds "name=\"flag_invimages\"/>" with no problem. As soon as I look for anything before 'name' though is when it doesn't scan properly. So even "\" name=\"flag_invimages\"/>" no longer works. There must be something other than a space before 'name' even though when you look at it it looks like one. I'll check tab.
 

Arakasi

New member
Your commented page source is wrong. KoL includes multiple spaces between those parts, and you need to match that nonsensical number of spaces.

Stupid HTML fixing debuggers. Both FireBug and displaying out the page source via the CLI showed a single space :-( Thanks for finding the/my stupidity!
 
Top