Lonster_Mosnter
-
Posts
4 -
Joined
-
Last visited
Posts posted by Lonster_Mosnter
-
-
Hi i am creating my own steam trade bot am i have got a comments section and wandering how to have it the way it will not comment on my profile Only. Here is what i got so far
if (config.Comments == "Enable") {
if (steamID === 76561198076819824) {
if (CreatorComs === 0){
} else {
manager.on('receivedOfferChanged', (offer)=>{
if(offer.state === 3){
community.postUserComment(offer.partner.toString(), "Comment", (err)=>{
if(err) throw err.message
community.postUserComment(offer.partner.toString(), math.pickRandom([Comments.comments0, Comments.comments1, Comments.comments2, Comments.comments3, Comments.comments4, Comments.comments5]));
});
}
})
}}
} else{
console.log('\x1b[33m WARNING\x1b[37m: Cannot comment on user profiles becasue config.Comments is set to false. ');
}when i run the bot it says line 284 steamID is not defined but i have the steam , SteamTotp, SteamUser, TradeOfferManager and SteamCommunity modules and steamID should be defined because of the i think Steamcommunity module
-
manager.on('receivedOfferChanged', (offer) => {
community.postUserComment(offer.partner.toString(), math.pickRandom([Comments.comments0, Comments.comments1, Comments.comments2, Comments.comments3, Comments.comments4, Comments.comments5]))});Is the code the only thing i cannot figure out is how to make it comment only when it accepts an trade offer
I tried putting it like this
if (ourValue <= theirValue) {
acceptOffer(offer);
manager.on('receivedOfferChanged', (offer) => {
community.postUserComment(offer.partner.toString(), math.pickRandom([Comments.comments0, Comments.comments1, Comments.comments2, Comments.comments3, Comments.comments4, Comments.comments5]))});
} else {
declineOffer(offer);
};but it didnt even comment like that
And also tried
function acceptOffer(offer) {
offer.accept((err) => {
manager.on('receivedOfferChanged', (offer) => {
community.postUserComment(offer.partner.toString(), math.pickRandom([Comments.comments0, Comments.comments1, Comments.comments2, Comments.comments3, Comments.comments4, Comments.comments5]))});
community.checkConfirmations();
console.log("We Accepted an offer");
if (err) console.log("There was an error accepting the offer.");
});
};and nothing am i doing something wrong?
How to set separate commands for certain steam users
in node-steam-user
Posted
I got it i used
if (config.Comments == "Enable") {
manager.on('receivedOfferChanged', (offer)=>{
if(offer.state === 3){
if (community.postUserComment(offer.partner.toString())) {
if (offer.partner.toString() === 76561198076819824){
if (CreatorComs.Comments === 0){
}
}
}} else {
if (community.postUserComment(offer.partner.toString(), "Comment")) {
community.postUserComment(offer.partner.toString(), "Comment", (err)=>{
if(err) throw err.message
community.postUserComment(offer.partner.toString(), math.pickRandom([Comments.comments0, Comments.comments1, Comments.comments2, Comments.comments3, Comments.comments4, Comments.comments5]));
});
} else {
console.log('\x1b[33m WARNING\x1b[37m: Cannot comment on user profiles becasue config.Comments is set to false. ');
}
}
})
}