Advertisement
Guest User

yaea

a guest
Mar 27th, 2015
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. function sendMsg(userId, username)
  2. {
  3. $.post("http://www.roblox.com/messages/send",{
  4. subject : "subjekt of pm here ",
  5. body : " body of pm here.",
  6.  
  7. recipientid : userId,
  8. cacheBuster : new Date().getTime()
  9. }).complete(function(){
  10. console.log('Sent message to ' + username + '.')
  11. })
  12. }
  13.  
  14. function getPlayers()
  15. {
  16. var ids = []
  17. var sel = $('#ctl00_cphRoblox_TabbedInfo_GamesTab_RunningGamesList_RunningGamesContainer');
  18. sel = $(sel).find('a')
  19. for(i=0;i<sel.length;i++) {
  20. if(sel[i].href.toLowerCase().substring(0,'http://www.roblox.com/User.aspx?id='.length) == 'http://www.roblox.com/User.aspx?id='.toLowerCase()) {
  21. ids.push(sel[i].href.substring('http://www.roblox.com/User.aspx?id='.length))
  22. }
  23. }
  24. return ids
  25. }
  26.  
  27. function getUsernames()
  28. {
  29. var ids = []
  30. var sel = $('#ctl00_cphRoblox_TabbedInfo_GamesTab_RunningGamesList_RunningGamesContainer');
  31. sel = $(sel).find('a')
  32. for(i=0;i<sel.length;i++) {
  33. if(sel[i].href.toLowerCase().substring(0,'http://www.roblox.com/User.aspx?id='.length) == 'http://www.roblox.com/User.aspx?id='.toLowerCase()) {
  34. ids.push(sel[i].title)
  35. }
  36. }
  37. return ids
  38. }
  39.  
  40. var players = getPlayers()
  41. var users = getUsernames()
  42.  
  43. var i=0;
  44. function Loop()
  45. {
  46. setTimeout(function () {
  47. sendMsg(players[i],users[i])
  48. i++;
  49. if (i < players.length) {
  50. Loop();
  51. } else {
  52. alert('Done!')
  53. }
  54. }, 10000)
  55. }
  56.  
  57. Loop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement