csgo icon indicating copy to clipboard operation
csgo copied to clipboard

difficulties with items

Open D1abll0 opened this issue 2 years ago • 1 comments

Hi guys. i have a couple questions. First. when I inspect the item's paintwear, it's an integer. Why? in game, this is a float value. example

    inspect_params = {'param_a': 15145586192, 'param_d': 16595344889481721483, 'param_s': 76561198282463169}
    cs.send(ECsgoGCMsg.EMsgGCCStrike15_v2_Client2GCEconPreviewDataBlockRequest, inspect_params)
    response = cs.wait_event(ECsgoGCMsg.EMsgGCCStrike15_v2_Client2GCEconPreviewDataBlockResponse, timeout=10)
{
  itemid: 15145586192
  defindex: 9
  paintindex: 279
  rarity: 6
  quality: 4
  **paintwear: 1049016027**
  paintseed: 492
  stickers {
    slot: 3
    sticker_id: 3171
  }
  inventory: 51
  origin: 4
}

Second. is it possible to send a list of items to the server and get a response with the data of all the items instead of doing it one by one? more or less like this:

cs.send( ECsgoGCMsg.EMsgGCCStrike15_v2_Client2GCEconPreviewDataBlockRequest,
[ 
    'itemLink1', 
    'itemLink2', 
    'itemLinkN', 
] )

D1abll0 avatar May 28 '22 22:05 D1abll0

  1. Just call send multiple times, it queues the message until you yield to the event loop
  2. You have to convert it to float, as they store it as integer
>>> struct.unpack('<f', struct.pack('<I', 1049016027))[0]
0.2631138265132904

rossengeorgiev avatar May 29 '22 13:05 rossengeorgiev