Last active
June 1, 2016 02:38
-
-
Save XMPPwocky/10a8151bacb47574a9b365b588e73a2c to your computer and use it in GitHub Desktop.
now i am become death, destroyer of steams
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sendMessage(target, text) { | |
var rgParams = { | |
umqid: Chat.m_umqid, | |
type: 'saytext', | |
steamid_dst: target, | |
text: text | |
}; | |
return Chat.m_WebAPI.ExecJSONP( 'ISteamWebUserPresenceOAuth', 'Message', rgParams, true ); | |
} | |
function spam(message) { | |
var alreadySent = {} | |
Chat.m_rgFriendLists.forEach(function(list) { | |
function vis(friend) { | |
if (friend != null) { | |
var friendID = friend.m_Friend.m_ulSteamID; | |
if (alreadySent[friendID] != 1) { | |
alreadySent[friendID] = 1; | |
sendMessage(friendID, message).done( | |
function() { vis(friend.m_next) } | |
).fail(console.error); | |
} else { | |
vis(friend.m_next); | |
} | |
} | |
} | |
vis(list.m_Head); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment