Jump to content
McKay Development

SunriseM

Member
  • Posts

    46
  • Joined

  • Last visited

Community Answers

  1. SunriseM's post in Callback function for accepting offer called, offer not accepted was marked as the answer   
    If you started the confirmation correctly, offer should be accepted. Also is recommended that you use acceptConfirmationObject instead of starConfirmationChecker. You can read more about it in the steam-community wiki
  2. SunriseM's post in Setting expire time for individual offers? was marked as the answer   
    Read this. Remember you need to have enabled time polling
  3. SunriseM's post in Bot only plays 1 game was marked as the answer   
    Try with client.gamesPlayed(["Custom message", 440]);
  4. SunriseM's post in Send offers for specified amount of items was marked as the answer   
    https://www.w3schools.com/jsref/jsref_splice.asp
  5. SunriseM's post in Possible to add getInventoryContents into function? was marked as the answer   
    Are you logged in the bot steam account before the function is called?
  6. SunriseM's post in Read numbers and/or words from Chat Messages? was marked as the answer   
    You can use "split" to convert the string to array and get the part you want. Example:
    client.on('friendOrChatMessage', (senderID, message) => { //Example Message: /bet 45 var arrmsg = message.split(" ") //arrmsg = ["/bet","45"] var userNumber = arrmsg[1] if (message.indexOf("/bet") == 0){ client.chatMessage(senderID, 'Your bet is: ' + userNumber); } });
  7. SunriseM's post in How can I get data from the user? was marked as the answer   
    You can use "split" to convert the string to array and get the part you want. Example:
    client.on('friendOrChatMessage', (senderID, message) => { //Example Message: /bet 45 var arrmsg = message.split(" ") //arrmsg = ["/bet","45"] var userNumber = arrmsg[1] if (message.indexOf("/bet") == 0){ client.chatMessage(senderID, 'Your bet is: ' + userNumber); } }); You will have to add other things like be sure that input has /bet [number],  verify the number can be used, etc
  8. SunriseM's post in Is it possible to get item description from trade offer? was marked as the answer   
    Because match is used in Strings and items.descriptions is an array.
     
    You can use find().
    function matchDescription(description) { return description === 'my description match'; } (this is the 388th line) if (item.appid == "my app ID" && item.type.match("My match")) { if(item.descriptions.find(matchDescription)){ return } )
  9. SunriseM's post in get assetIDs by calling getInventoryContents? was marked as the answer   
    You should use a loop (for, foreach, while, etc) to iterate all the inventory callback, you can create an array called items, and in each iteration you push a object like this one:
    var item = { "assetid": inventory[i].id, "name": inventory[i].market_hash_name } if you need to make an asynchronous operation with that info and know when all iterations are finished, you can use async module. 
×
×
  • Create New...