September 15, 201510 yr public void process(main script) { GroundItem salmon = script.getGroundItems().closest("Raw salmon"); script.log(salmon.isVisible()); if(salmon != null && salmon.isVisible()) { salmon.interact("Take"); } else { GroundItem trout = script.getGroundItems().closest("Raw trout"); script.log(trout.isVisible()); if(trout != null && trout.isVisible()) { trout.interact("Take"); } } } }, What am I doing wrong? you're logging if it is visible before you null check it. you must null check before using it at all
September 15, 201510 yr Author you're logging if it is visible before you null check it. you must null check before using it at all tried that, didn't work tho.
September 15, 201510 yr you're logging if it is visible before you null check it. you must null check before using it at all
Create an account or sign in to comment