changez
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@ venv3/
|
|||||||
*.log
|
*.log
|
||||||
cvarlist.txt
|
cvarlist.txt
|
||||||
curztest.py
|
curztest.py
|
||||||
|
rconpw.txt
|
||||||
|
|||||||
15
parser.py
15
parser.py
@ -223,7 +223,20 @@ class EventParser:
|
|||||||
weapon = killer.get('WEAPON', 'UNKNOWN')
|
weapon = killer.get('WEAPON', 'UNKNOWN')
|
||||||
weapon_name = WEAPON_KILL_NAMES.get(weapon, f'the {weapon}')
|
weapon_name = WEAPON_KILL_NAMES.get(weapon, f'the {weapon}')
|
||||||
|
|
||||||
return f"{score_prefix}{killer_prefix}^8{killer_name}^0 ^7fragged^7 {victim_prefix}^8{victim_name}^0 ^7with {weapon_name}{warmup}\n"
|
hp_left = killer.get('HEALTH', '0 HP')
|
||||||
|
hp_left_colored = ""
|
||||||
|
if hp_left <= 0: # from the grave
|
||||||
|
hp_left_colored = f"^8^5From the Grave^0"
|
||||||
|
elif hp_left < 25: # red
|
||||||
|
hp_left_colored = f"^8^1{hp_left}^0 ^7HP"
|
||||||
|
elif hp_left < 80: # yellow
|
||||||
|
hp_left_colored = f"^8^3{hp_left}^0 ^7HP"
|
||||||
|
elif hp_left < 126: # white
|
||||||
|
hp_left_colored = f"^8^7{hp_left}^0 ^7HP"
|
||||||
|
else: # green
|
||||||
|
hp_left_colored = f"^8^2{hp_left}^0 ^7HP"
|
||||||
|
|
||||||
|
return f"{score_prefix}{killer_prefix}^8{killer_name}^0 ^7fragged^7 {victim_prefix}^8{victim_name}^0 ^7with {weapon_name}^0 ^7({hp_left_colored}^7){warmup}\n"
|
||||||
|
|
||||||
def _handle_round_over(self, data):
|
def _handle_round_over(self, data):
|
||||||
"""Handle ROUND_OVER events for CA"""
|
"""Handle ROUND_OVER events for CA"""
|
||||||
|
|||||||
44
qlpycon.bash
Executable file
44
qlpycon.bash
Executable file
@ -0,0 +1,44 @@
|
|||||||
|
#/usr/bin/env bash
|
||||||
|
#
|
||||||
|
|
||||||
|
workdir="/home/xbl/gits/qlpycon"
|
||||||
|
password="$(cat $workdir/rconpw.txt)"
|
||||||
|
serverip="10.13.12.93"
|
||||||
|
|
||||||
|
cd "$workdir"
|
||||||
|
source venv/bin/activate
|
||||||
|
|
||||||
|
if [ "$1" == "ffa" ]; then
|
||||||
|
python3 main.py --host tcp://"$serverip":28960 --password "$password"
|
||||||
|
|
||||||
|
elif [ "$1" == "duel" ]; then
|
||||||
|
python3 main.py --host tcp://"$serverip":28961 --password "$password"
|
||||||
|
|
||||||
|
elif [ "$1" == "rcpma" ]; then
|
||||||
|
python3 main.py --host tcp://"$serverip":28962 --password "$password"
|
||||||
|
|
||||||
|
elif [ "$1" == "iffa" ]; then
|
||||||
|
python3 main.py --host tcp://"$serverip":28963 --password "$password"
|
||||||
|
|
||||||
|
elif [ "$1" == "ca" ]; then
|
||||||
|
python3 main.py --host tcp://"$serverip":28964 --password "$password"
|
||||||
|
|
||||||
|
elif [ "$1" == "ctf" ]; then
|
||||||
|
python3 main.py --host tcp://"$serverip":28965 --password "$password"
|
||||||
|
|
||||||
|
elif [ "$1" == "rcvq3" ]; then
|
||||||
|
python3 main.py --host tcp://"$serverip":28966 --password "$password"
|
||||||
|
|
||||||
|
elif [ "$1" == "test" ]; then
|
||||||
|
python3 main.py --host tcp://"$serverip":28967 --password "$password"
|
||||||
|
|
||||||
|
elif [ "$1" == "ft" ]; then
|
||||||
|
python3 main.py --host tcp://"$serverip":28968 --password "$password"
|
||||||
|
|
||||||
|
elif [ "$1" == "leduel" ]; then
|
||||||
|
python3 main.py --host tcp://"$serverip":28969 --password "$password"
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "[ ffa (27960), duel (27961), rcpma (27962), iffa (27963), ca (27964), ctf (27965), rcvq3 (27966), test (27967), ft (27968), leduel (27969) ]"
|
||||||
|
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user