Page 1 of 1

[HL2:DM] BotPing

Posted: Mon Apr 11, 2016 1:36 pm
by Painkiller
Creating a Bot Ping?

Posted: Mon Apr 11, 2016 4:09 pm
by satoon101
Try this (untested):

Syntax: Select all

from random import randint

from entities.entity import Entity
from filters.players import PlayerIter
from listeners.tick import TickRepeat

# =================== #
# >> CONFIGURATION << #
# =================== #
LOW_PING = 30
HIGH_PING = 80
DELAY = 3

# ======================= #
# >> END CONFIGURATION << #
# ======================= #

bot_players = PlayerIter('bot')


@TickRepeat
def set_bot_ping():
player_manager = Entity.find('player_manager')
for bot in bot_players:
player_manager.set_property_int('m_iPing.%03d' % bot.index, randint(LOW_PING, HIGH_PING))

set_bot_ping.start(DELAY, 0)

Posted: Tue Apr 12, 2016 4:45 pm
by Painkiller
Work good THX.