I changed it a bit more, now if you dont specify a card number it will return a message with a list of cards.

Some examples ways to call the function and have the results pop up in a message...

$bssid = GetBSSID()
$null = MessageBox($bssid,"BSSID",0)

$bssid = GetBSSID(1)
$null = MessageBox($bssid,"BSSID",0)

$bssid = GetBSSID(1,@WkSta)
$null = MessageBox($bssid,"BSSID",0)

 Code:
FUNCTION GetBSSID(optional $device, optional $machine)
   $strComputer = IIF (VarType($machine)<2, @Wksta, $Machine)
   $objSWbemServices = GetObject("winmgmts:\\"+ $strComputer + "\root\wmi")
   $colInstances = $objSwbemServices.ExecQuery("SELECT * FROM MSNdis_80211_ReceivedSignalStrength WHERE Active=True")
   if $device<1
      $card_no=1
      $cards = "Please specify one of these devices to obtain it's BSSID :"
      for each $objInstance in $colInstances
         $cards = $cards+@CRLF+"Card "+$card_no+" = "+$objInstance.InstanceName
         $card_no=$card_no +1
      next
      $GetBSSID = $cards
      Return
   endIf
   $card_no=$device
   $x=1
   for each $objInstance in $colInstances
      if $x = $card_no
         $wifiAdapter = $objInstance.InstanceName
         $x = $x + 1
      endif
   next
   $last_signal = 0
   $bssid = ""
   $colInstances = $objSwbemServices.ExecQuery('SELECT * FROM MSNdis_80211_BaseServiceSetIdentifier WHERE Active = True AND InstanceName ="'+$wifiAdapter+'"')
   for each $objInstance in $colInstances
      $macbyte = 0
      for each $decval in $objInstance.Ndis80211MacAddress
         if $decval<17
            $bssid = $bssid + "0"
         endif
         $bssid = $bssid + DecToHex($decval)
         if $macbyte < 5
            $bssid = $bssid + ":"
            $macbyte = $macbyte + 1
         endif
      next
   next
   $colInstances = $objSwbemServices.ExecQuery ("SELECT * FROM MSNdis_80211_ReceivedSignalStrength WHERE Active = True AND InstanceName ='" + $wifiAdapter + "'")
   for each $objInstance in $colInstances
      $sigraw = $objInstance.Ndis80211ReceivedSignalStrength
      $signal = $sigraw + "dB"
   next
   $last_signal = $sigraw
   $GetBSSID = $bssid
ENDFUNCTION