-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathidk.ps1
67 lines (40 loc) · 1.53 KB
/
idk.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
$wxnow = (get-content J:\WeatherForecast\WXNOW.TXT)[1]
$wdir = $wxnow.Substring(0,$wxnow.IndexOf("/"))
$pos = $wdir.length+1
$wspeed = $wxnow.Substring($pos,$wxnow.IndexOf("g")-$pos)
$pos = $pos + $wspeed.length+1
$wgust = $wxnow.Substring($pos,$wxnow.IndexOf("t")-$pos)
$pos = $pos + $wgust.length+1
$ctemp = $wxnow.Substring($pos,$wxnow.IndexOf("r")-$pos)
$pos = $pos + $ctemp.length+1
$rainlh = $wxnow.Substring($pos,$wxnow.IndexOf("p")-$pos)
$pos = $pos + $rainlh.length+1
$raintd = $wxnow.Substring($pos,$wxnow.IndexOf("P")-$pos)
$pos = $pos + $raintd.length+1
$raintf = $wxnow.Substring($pos,$wxnow.IndexOf("h")-$pos)
$pos = $pos + $raintf.length+1
$humid = $wxnow.Substring($pos,$wxnow.IndexOf("b")-$pos)
$pos = $pos + $humid.length+1
$baro = $wxnow.Substring($pos,$wxnow.length-1-$pos)
$baro = $baro/338.64
$barotrend = $wxnow.Substring($wxnow.length-1,1)
if (($baro -ge 30.10) -and ($baro -lt 30.20)) {
if ($barotrend -eq "-") {
}
write-host "We cool"
} else if ($baro -ge 30.20) {
} else if ($baro -ge 30.10) {
} else if ($baro -lt 29.80) {
} else if ($baro -lt 30.10) {
} else {
write-host "Something didn't match"
}
if (($wdir -ge 0) -and ($wdir -le 90)) {
} else if (($wdir -ge 45) -and ($wdir -le 90)) {
} else if (($wdir -ge 45) -and ($wdir -le 135)) {
} else if (($wdir -ge 135) -and ($wdir -le 180)) {
} else if (($wdir -ge 180) -and ($wdir -le 225)) {
} else if (($wdir -ge 90) -and ($wdir -le 180)) {
} else if (($wdir -ge 255) -and ($wdir -le 285)) {
} else if (($wdir -ge 225) -and ($wdir -le 315)) { #SW - NW
}