*** This script deselects the walls that are not the first walls of their sectors. The script must be executed in WALL selecting mode.

mov r00 -1
for each selected wall r00
  getwallsectnum r00 r01
  getsector r01 wallptr r02
  if r02 != r00
    selectwall r00 0
  endif
continue