YoloWingPixie / lsobot

A log scrapper for DCS World that checks for new carrier landing grades made by humans and sends them to Discord.
MIT License
11 stars 8 forks source link

AI LSO sometimes writes comments out of order, need to correct. #2

Closed YoloWingPixie closed 3 years ago

YoloWingPixie commented 3 years ago

Wire in middle:

Pilot: Maverick Grade: C (CUT): LULX FX TMRDIC WIRE# 1 (NX) DRIC LOIC LOAR

LURIM:

Pilot: Maverick Grade: C CUT: : LURX LOIM LOIC PIC PPPIC (LURIM) LOAR LNFIW WIRE# 4

YoloWingPixie commented 3 years ago

Function added to dev build

    $xGrade = $Grade.Split()
    $yGrade = ($Grade -split '(?=:)')[0] + ":"
    $xX  = $xGrade | Where-Object {$_ -match "\w*X(_|\))?\b"}
    $xIM = $xGrade | Where-Object {$_ -match "\w*IM(_|\))?\b"} 
    $xIC = $xGrade | Where-Object {$_ -match "\w*IC(_|\))?\b"} 
    $xAR = $xGrade | Where-Object {$_ -match "\w*AR(_|\))?\b"} 
    $xIW = $xGrade | Where-Object {$_ -match "\w*IW(_|\))?\b"} 
    $xWIRE = ($xGrade | Where-Object {$_ -match "(?:WIRE#)"}) + " " + ($xGrade | Where-Object {$_ -match "\d(?!PTS)"})

    if ($xX)    { $xX = [String]::Join(" ",$xX)   }
    if ($xIM)   { $xIM = [String]::Join(" ",$xIM) }
    if ($xIC)   { $xIC = [String]::Join(" ",$xIC) }
    if ($xAR)   { $xAR = [String]::Join(" ",$xAR) }
    if ($xIW)   { $xIW = [String]::Join(" ",$xIW) }

    $Grade = $yGrade + " " + $xX + " " + $xIM + " " + $xIC + " " + $xAR + " " + $xIW + " " + $xWIRE
YoloWingPixie commented 3 years ago

Released on main