lol

Yes you can. It's called:

unit_set_current_flashlight_state (unit (list_get (ai_actors louis) 0)) true

louis = AI name.

To get a flashlight state, do the following:

if (= (unit_get_current_flashlight_state (unit (list_get (ai_actors louis) 0)))true

true could be false but it needs to be in an if statement.

I find this ammusing how people seem to neglect the basics and overcomplicate things. Then again, I am just as guilty in my own way, so what the hell?

But yes, you can use unit commands with AI. Just reference ai_actors ainame, rather than players and playernumber.