kRPC: Control the game using C#, C++, Java, Lua, Python...

kRPC: Control the game using C#, C++, Java, Lua, Python...

7.8k Downloads

krpc.types.Resources to int

CSutter5 opened this issue ยท 4 comments

commented

How can I turn a krpc.types.Resources variable into an int using python. doing

speed = conn.add_stream(getattr, self.vessel.flight(), 'velocity')
intSpeed = int(speed)

does not work

    intSpeed  =  int(speed)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'Resources'
commented

Try int( speed() ). Notice I'm calling speed as a function

commented

now im getting

TypeError: int() argument must be a string, a bytes-like object or a number, not 'tuple'
commented
commented

Thanks you