The online racing simulator
Outgauge with python
(4 posts, started )
Outgauge with python
EDIT: I got it working! Now I will try to make a program which lets you use multiple OutGuage apps.

Is it possible? Python can recive UDP data. I already know how to do this in python. Does tha mean that it can recieve data from outgauge data from LFS?

EDIT: IT WORKS! Python actually recieves the data. I just don't know how to parse this data lol This the data that is outputted:
2P UFR ☺ ïo:F ☼ö■> Ç? Ç? 5Fuel 29.8 Brake Bal F 85%

Hmm, I figured out how to separate them, but unfortunatly I cant. I am using the "struct" feature to split the string from outguage, and the "word" format doesnt exist in python. Unless it is the same as a double or something. THere doesnt seem to be any "byte" either. Here is a page with the documentation for python, maybe I'm reading it wrong.
http://docs.python.org/lib/module-struct.html

EDIT again, is a word made of 10 chars?
#2 - filur
Quote from wheel4hummer :is a word made of 10 chars?

Probably not, the insim docs specify word as a 2-byte unsigned integer, i unpack words in PHP using the S format, which looks similar to the H format on that python manual page.

unsigned short (always 16 bit, machine byte order)

http://en.wikipedia.org/wiki/Word_(computer_science)
I think I'll just use PHP instead of python then. Python is easier. BUt, I still cannot get it to work, the struct that is. I just get an error because I didnt get the format correct. I don't know how to get a "Byte".

Traceback (most recent call last):
File "G:\LFS\server.py", line 36, in ?
print struct.unpack('IcHBBffffffffffffcci', data)
struct.error: unpack str size does not match format

NEVER MIND! I fixed it now. I made a shift-beeper!
If you're using Python, you might be interested in Race Manage: http://lfs.marcoz.org , which is Insim only, but you can probably inspire yourself with it, especially structs and stuff.

Outgauge with python
(4 posts, started )
FGED GREDG RDFGDR GSFDG