Hi Kyle, glad to see you're still knocking about
I have no idea why my post count is shrinking haha!
I am aware there are newer ways to do this, such as your advice in
this thread. Regardless, I thought it would be a fun little project to try my hand at. Turns out it wasn't too fun, but I've got a (terribly unrefined) purely powershell script that does work.
Also delinquent, I already went ahead and didn't take your advice
but at least I learned stuff. I do appreciate the input though, in the future I will take the sensible path!
Just in case it ends up helping, I've included a snippet of what I eventually came up with. The first step involves running the following as a background job. Wildlog.txt is referenced in my first post.
Code: Select all
$myjob=Start-Job -ScriptBlock {Get-Content "...\tron\sylla\log\wildlog.txt" -tail 1 -wait}
You can check if it is running using
Then when this is in the background you run a looping while script. It has recursive elements for each round since I'm dumb and don't know any better:
Code: Select all
while ($true) {
$line = (Get-Job | Receive-Job)
if (($line -like '*Go (round 1 o*') -and ($line -notlike '*Go (rou* `*') -and ($line -notlike '*:* Go rou*')) {
write-output "round one"
$maprannum = Get-Random -maximum 3
Write-Output $maprannum
if ($maprannum -eq 0) {
set-content -path "...\tron\sylla\var\everytime.cfg" -value 'MAP_FILE ed/fortress/minefield-0.0.7.aamap.xml
ROUND_CENTER_MESSAGE Round 2 - Minefield'
}elseif ($maprannum -eq 1) {
set-content -path "...\tron\sylla\var\everytime.cfg" -value 'MAP_FILE ed/fortress/minepillars-0.0.3.aamap.xml
ROUND_CENTER_MESSAGE Round 2 - Mine Pillars '
}elseif ($maprannum -eq 2) {
set-content -path "...\tron\sylla\var\everytime.cfg" -value 'MAP_FILE ed/fortress/hairbrush-0.0.2.aamap.xml
ROUND_CENTER_MESSAGE Round 2 - HairBrush'
}
}
This is followed by an elseif for each round which has maps for the following round:
Code: Select all
elseif (($line -like '*Go (round 2 o*') -and ($line -notlike '*Go (rou* `*') -and ($line -notlike '*:* Go rou*')) {
write-output "round two"
$maprannum = Get-Random -maximum 4
Write-Output $maprannum
if ($maprannum -eq 0) {
set-content -path "...\tron\sylla\var\everytime.cfg" -value 'MAP_FILE ed/fortress/octazigzag-0.0.3.aamap.xml
ROUND_CENTER_MESSAGE Round 3 - Octagon Wiggle'
}elseif ($maprannum -eq 1) {
set-content -path "...\tron\sylla\var\everytime.cfg" -value 'MAP_FILE ed/fortress/octagon-0.0.2.aamap.xml
ROUND_CENTER_MESSAGE Round 3 - Octagon Fortress'
}elseif ($maprannum -eq 2) {
set-content -path "...\tron\sylla\var\everytime.cfg" -value 'MAP_FILE ed/fortress/octagoneloopy-0.0.1.aamap.xml
ROUND_CENTER_MESSAGE Round 3 - Octa Gone Loopy'
}elseif ($maprannum -eq 3) {
set-content -path "...\tron\sylla\var\everytime.cfg" -value 'MAP_FILE ed/fortress/octagon_weasel-0.0.1.aamap.xml
ROUND_CENTER_MESSAGE Round 3 - Octagon Weasel'
}
}
After completing every elseif for the number of rounds you want, you'll need to close }. And that's it.
The Halley's comet of Armagetron.
ps I'm not tokoyami