Tasker profile that enables/disables wi-fi How can make it so wi-fi gets disabled automatically when screen gets locked, if possible after 1 minute or so? Then enabled automatically when screen gets unlocked.
My screen is set to lock after 30 seconds or so

also, is it possible to turn off wifi when there's no network in range? I think it takes a lot of battery searching for networks. Or maybe increase the search interval somehow
So I combined what you asked for into a single task. You'll first create a profile which triggers when a state changes. You'll select Display State and chose off. Tasker can't actually able to tell if your screen is locked, only on or off but we can get around that as long as we know the time it take for the screen to lock.The task is as follows:


Wait Until
    Seconds: 60
    Until: %SCREEN Matches ON
IF
    %SCREEN Matches ON
Wifi
    Set: ON
STOP
END IF
IF
    %SCREEN Matches OFF
Wifi
    Set: OFF
GOTO 
    TYPE: ACTION NUMBER
    NUMBER: 1
END IF




Explanation of Task:
1. This causes the task to wait before continuing unless the condition is met. The total wait time should be the screen time until lock plus the time you want to wait until the wifi turns off
2. If the screen Turns on goto 3
3. Turn on wifi 
4. Stops task
5. Ends if Statement
6. If the screen is off on goto 7
7. Turn off wifi
8. Cause a loop to keep checking the screen status. 



Note 1: This task assumes that wifi is already on to start with. 

Note 2: As the task stands now it will check every minute. If after the first min you want to change the time it waits to reduce battery usage you'll add this take to beginning.

1.SET VARIABLE
    NAME:%DUR
    VALUE: 60
2.WAIT UNTIL  
    SECONDS: %DUR  
    Until: %SCREEN Matches ON


And add in between 7 &amp; 8:

SET VARIABLE
    NAME:%DUR
    VALUE: WHATEVER TIME


LAST NOTE: If you don't want to wait seconds every time you can use a variable for mins or hours like with seconds. You'll set the variables for min or hour as zero  at the beginning and then change them before you start the loop. To use variables instead of static numbers you touch the symbol of 2 arrows crossing opposite of Min/Hr/Sec.

If you have any question please feel free to ask. Also since I'm new please don't forget to mark mine as the answer if it solves your problem and to upvote the answer