q3rcon-ps/README.md

54 lines
949 B
Markdown
Raw Permalink Normal View History

2023-11-29 16:18:03 +00:00
# Q3 Rcon client for Powershell
Send Rcon commands to your Quake-3 Engine server from Powershell!
## Tested against
Currently only tested on COD servers (2, 4 and 5).
## Requirements
- Powershell 7.2+
## Installation
`Install-Module -Name Q3Rcon -Scope CurrentUser`
## Use
```powershell
Import-Module Q3Rcon
try {
$rcon = Connect-Rcon -hostname "hostname.server" -port 28960 -passwd "strongrconpassword"
$rcon.Map()
"Rotating the map..."
$rcon.MapRotate()
Start-Sleep -Milliseconds 3000 # wait for map to rotate
$rcon.Map()
}
finally {
Disconnect-Rcon -rcon $rcon
}
```
2023-11-30 22:38:05 +00:00
## Rcon Class
2023-11-30 22:43:32 +00:00
#### `Send($cmd) | Send($cmd, $timeout)`
2023-11-30 22:38:05 +00:00
```powershell
$rcon.Send("mapname")
$rcon.Send("g_gametype dm")
$rcon.Send("map_rotate", 2000)
```
If the command returns a response it will be printed to the console.
Pass an optional timeout (ms) for commands that return responses in fragments. (status, map_rotate etc...)