I like the changes so far. pyinsim is easier to use than ever
Has anyone tried adding autocross objects? I just got wall of text that ended with this:
[COLOR="Red"]Traceback (most recent call last):
File "C:\Python32\lib\asyncore.py", line 83, in read
obj.handle_read_event()
File "C:\Python32\lib\asyncore.py", line 444, in handle_read_event
self.handle_read()
File "C:\Python32\lib\site-packages\pyinsim\core.py", line 312, in handle_read
self.dispatch_to.handle_read(self, data)
File "C:\Python32\lib\site-packages\pyinsim\core.py", line 480, in handle_read
self.raise_packet_event(packet_type, data)
File "C:\Python32\lib\site-packages\pyinsim\core.py", line 401, in raise_packet_event
[c(self, packet) for c in callbacks]
File "C:\Python32\lib\site-packages\pyinsim\core.py", line 401, in <listcomp>
[c(self, packet) for c in callbacks]
File "C:\Users\Kevin\projects\Live For Speed\testing\place_point.py", line 72, in Multi_car_info
Place_cone(h.X, h.Y, h.Z, h.Heading, players[h.PLID].UCID)
File "C:\Users\Kevin\projects\Live For Speed\testing\place_point.py", line 66, in Place_cone
insim.send_packet(pyinsim.IS_AXM(UCID = UCID, PMOAction=1, Info=[oi]))
File "C:\Python32\lib\site-packages\pyinsim\core.py", line 436, in send_packet
self.tcp_socket.send(packet.pack())
File "C:\Python32\lib\site-packages\pyinsim\insim.py", line 1254, in pack
return self.s.pack(self.Size + (self.NumO * 8), self.Type, self.ReqI, self.NumO, self.UCID, self.PMOAction, self.PMOFlags) + b''.join([info.pack() for info in self.Info])
File "C:\Python32\lib\site-packages\pyinsim\insim.py", line 1254, in <listcomp>
return self.s.pack(self.Size + (self.NumO * 8), self.Type, self.ReqI, self.NumO, self.UCID, self.PMOAction, self.PMOFlags) + b''.join([info.pack() for info in self.Info])
File "C:\Python32\lib\site-packages\pyinsim\insim.py", line 1230, in pack
return self.s.pack(self.X, self.Y, self.Zchar, self.Flags, self.Index, self.Heading)
struct.error: short format requires SHRT_MIN <= number <= SHRT_MAX[/COLOR]
Here's what I did to get that:
def Place_cone(x, y, z, heading, UCID):
oi = pyinsim.ObjectInfo(x, y, 4, 0, 20, 0)
insim.send_packet(pyinsim.IS_AXM(UCID = UCID, PMOAction=1, Info=[oi]))
print('sent an axm')
def Multi_car_info(insim, MCI):
if MCI.ReqI == 17:
h = MCI.Info[0]
Place_cone(h.X, h.Y, h.Z, h.Heading, players[h.PLID].UCID)
print('sent packet')
else:
print('mci')