Like this? Apologies for the mess in the preview pic, I forgot how to press ctrl+s... fp
Here's a simple way you could do it with pyinsim
import pyinsim
import threading
def blue_flag():
insim.send(pyinsim.ISP_BTN,
ReqI=255,
ClickID=61,
BStyle=pyinsim.ISB_DARK | 6,
T=165,
L=168,
W=30,
H=10,
Text="BLUE FLAG!!!")
threading.Timer(7.0, clear_buttons).start()
def yellow_flag():
insim.send(pyinsim.ISP_BTN,
ReqI=255,
ClickID=61,
BStyle=pyinsim.ISB_DARK | 1,
T=165,
L=168,
W=30,
H=10,
Text="YELLOW FLAG!!!")
threading.Timer(7.0, clear_buttons).start()
def clear_buttons():
insim.send(pyinsim.ISP_BFN, ClickID=61)
def flag_detection(insim, flg):
if flg.Flag == 1: ## BLUE
blue_flag()
elif flg.Flag == 2: ## YELLOW
yellow_flag()
insim = pyinsim.insim('127.0.0.1', 29999, Admin='', Flags=pyinsim.ISF_LOCAL)
insim.bind(pyinsim.ISP_FLG, flag_detection)
pyinsim.run()