/localinfo -h
//echo -a $ip
/localinfo -u
Might need a delay in there for it to work, but that's the general idea.
It gets a lot more complex than this though, since you may have multiple adapters with separate ips, so there's generally no easy way to get your "LAN ip".