The online racing simulator
Ah ok, I use my version a lot and it works well but it's true that I never used the autocross objects (so probably not good for me either)
Hell yeah! That's what i need Smile
Need a hand with the pyinsim library, I am just playing around with insim to check live chat of servers, something simple, I know that I need to use "ISP_MSO" packet to get that.
I have this small snippet just for printing in console the chat, but I receive always the error "struct.error: unpack requires a buffer of 12 bytes", sometimes is "buffer of 4 bytes" or "buffer of 2 bytes", whenever a message is on LFS (for user/insim/or lfs itself)

This is my code snippet:

import pyinsim


def req_conns(insim):
insim.send(pyinsim.ISP_TINY, ReqI=1, SubT=pyinsim.TINY_NCN)
insim.send(pyinsim.ISP_TINY, ReqI=1, SubT=pyinsim.TINY_NPL)


def textChat(insim, mso):
print(mso.Msg)


insim = pyinsim.insim('127.0.0.1', 29999, Flags=pyinsim.ISP_MCI | pyinsim.ISP_NPL |
pyinsim.ISF_LOCAL | pyinsim.ISP_MSO, Interval=100, IName=b'Testing')

insim.bind(pyinsim.ISP_MSO, textChat)

req_conns(insim)

pyinsim.run()

This is the whole error printed on console:

Traceback (most recent call last):
File "C:\Program Files (x86)\Python39-32\lib\asyncore.py", line 83, in read
obj.handle_read_event()
File "C:\Program Files (x86)\Python39-32\lib\asyncore.py", line 420, in handle_read_event
self.handle_read()
File "c:\Users\User\Desktop\PyInsim\pyinsim\core.py", line 354, in handle_read
self._dispatch_to._handle_tcp_read()
File "c:\Users\User\Desktop\PyInsim\pyinsim\core.py", line 561, in _handle_tcp_read
self._handle_insim_packet(data)
File "c:\Users\User\Desktop\PyInsim\pyinsim\core.py", line 598, in _handle_insim_packet
packet = _PACKET_MAP[ptype]().unpack(data)
File "c:\Users\User\Desktop\PyInsim\pyinsim\insim.py", line 681, in unpack
self.Msg = struct.unpack('%dsx' % int(self.Size - 9), data[8:])[0]
struct.error: unpack requires a buffer of 12 bytes

I am doing wrong the call of the ISP_MSO? Or is something wrong with the pyinsim library? Using py3 to run it
Sorry juanann, I have fix it some week ago but haven't commit... (done now)
so you can download again or just change :
in insim.py file :
in class IS_MSO(object):

replace :
#self.Msg = struct.unpack('%dsx' % int(self.Size - 9), data[8:])
by :
self.Msg = data[8:].split(b'\x00')[0]
Quote from KingOfIce :Sorry juanann, I have fix it some week ago but haven't commit... (done now)
so you can download again or just change :
in insim.py file :
in class IS_MSO(object):

replace :
#self.Msg = struct.unpack('%dsx' % int(self.Size - 9), data[8:])
by :
self.Msg = data[8:].split(b'\x00')[0]

Thanks! that did it SmileThumbs up
It's pretty late but can you help me I can't find the module I'm going crazy please help me
-
(ahecobankaya32) DELETED by Flame CZE : One post is enough
-
(ahecobankaya32) DELETED by Flame CZE : One post is enough
-
(ahecobankaya32) DELETED by Flame CZE : One post is enough
Quote from ahecobankaya32 :It's pretty late but can you help me I can't find the module I'm going crazy please help me

We can help you but you have to describe your problem in more detail.
Quote from Flame CZE :We can help you but you have to describe your problem in more detail.

can you show on discord _32eren32_
Quote from Flame CZE :We can help you but you have to describe your problem in more detail.

İleti=No module named 'core'
Kaynak=C:\Users\PC\source\repos\insim\insim.py
StackTrace:
File "C:\Users\PC\source\repos\insim\insim.py", line 1, in <module> (Current frame)
import pyinsim
ModuleNotFoundError: No module named 'core'
Hello ahecobankaya32,
Which IDE do you use?
Personally, I use PyCharm and I've defined my pyinsim directory as a ‘package’ so that I can then use it via ‘import pyinsim’.
Attached images
pyinsim.png
Quote from KingOfIce :Hello ahecobankaya32...

deneyeceği̇m
Quote from KingOfIce :Hello ahecobankaya32...

Can I run it in Visual Studio and install pyinsim? step by step

FGED GREDG RDFGDR GSFDG