ValvePython / csgo

🔫 Python package for interacting with CS:GO Game Coordinator

Home Page:http://csgo.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Help

AlexaCarra opened this issue · comments

im try start this code but im got error
CODE:

`from csgo import features

def get_float(self):
print(i.request_preview_data_block(s=0, a=19977124525, d=16898216808610796173, m=3298286890797738270))

if name == 'main':
i = features.Items()
get_float()`

ERROR:
self.on(ECsgoGCMsg.EMsgGCCStrike15_v2_Client2GCEconPreviewDataBlockResponse, self.__handle_preview_data_block)
AttributeError: 'Items' object has no attribute 'on'

You need to call request_preview_data_block() method on initialized and connected CSGOClient instance.

See https://csgo.readthedocs.io/en/stable/user_guide.html#initialization

For example, you can replace gc_ready():

def gc_read():
  cs.request_preview_data_block(s=0, a=19977124525, d=16898216808610796173, m=3298286890797738270)
  resp = cs.wait_msg("item_data_block", timeout=10, raises=True)
  print(resp)