Hi,
Trying to create a little python app. Basic features run perfect in a python editor.
However as soon as I add the 'ac' components, the app does seem to execute in the Assetto Corsa environment.
If someone could have a look and tell me what I'm doing wrong, that would be apricated.
Thanks
Jarqus
confiig file
APP
Trying to create a little python app. Basic features run perfect in a python editor.
However as soon as I add the 'ac' components, the app does seem to execute in the Assetto Corsa environment.
If someone could have a look and tell me what I'm doing wrong, that would be apricated.
Thanks
Jarqus
confiig file
[vcall]
out_puta = 10, 15
out_putb = 1, 5
APP
import ac
import sys
import acsys
import time
import random
import configparser
def acMain(ac_version):
appWindow = ac.newApp("app")
return "app"
### change (Percantage_chance) to increase or decrease likelyhood ###
### reduce number to reduce the likelyhood ###
### Range is from 0.0 to 1.0 ###
percentage_chance = 0.9
rand = random.random()
if rand <= percentage_chance:
IN_settings = configparser.ConfigParser()
IN_settings.read('config.ini')
range_str = IN_settings['vcall'].get('out_puta')
range_ints = [int(x) for x in range_str.split(',')]
random_int = random.randint(range_ints[0], range_ints[1])
time.sleep(random_int)
ac.console("Test1234")
ac.sendChatMessage("Test1234")
range_str = IN_settings['vcall'].get('out_putb')
range_ints = [int(x) for x in range_str.split(',')]
random_int = random.randint(range_ints[0], range_ints[1])
time.sleep(random_int)
ac.console("4321Test")
ac.sendChatMessage("4321Test")
else
exit()