Advertisement
Guest User

Untitled

a guest
Mar 29th, 2015
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. function sendMsg(userId, username)
  2. {
  3. $.post("http://www.roblox.com/messages/send",{
  4. subject : "AVEX Recruit!",
  5. body : "Hello, " + username + "!\n\nWe think you should join AVEX.\nA new power clan, soon to be active and great skill and great technology being made we would like for you to join and help reach our goal of 100 members. We do hope you do decide to join and join our ranks! and Here is our group and Codex http://www.roblox.com/Forum/ShowPost.aspx?PostID=158857076\nhttp://www.roblox.com/My/Groups.aspx?gid=2538383",
  6. recipientid : userId,
  7. cacheBuster : new Date().getTime()
  8. }).complete(function(){
  9. console.log('Sent message to ' + username + '.')
  10. })
  11. }
  12.  
  13. function getPlayers()
  14. {
  15. var ids = []
  16. var sel = $('#ctl00_cphRoblox_TabbedInfo_GamesTab_RunningGamesList_RunningGamesContainer');
  17. sel = $(sel).find('a')
  18. for(i=0;i<sel.length;i++) {
  19. if(sel[i].href.toLowerCase().substring(0,'http://www.roblox.com/User.aspx?id='.length) == 'http://www.roblox.com/User.aspx?id='.toLowerCase()) {
  20. ids.push(sel[i].href.substring('http://www.roblox.com/User.aspx?id='.length))
  21. }
  22. }
  23. return ids
  24. }
  25.  
  26. function getUsernames()
  27. {
  28. var ids = []
  29. var sel = $('#ctl00_cphRoblox_TabbedInfo_GamesTab_RunningGamesList_RunningGamesContainer');
  30. sel = $(sel).find('a')
  31. for(i=0;i<sel.length;i++) {
  32. if(sel[i].href.toLowerCase().substring(0,'http://www.roblox.com/User.aspx?id='.length) == 'http://www.roblox.com/User.aspx?id='.toLowerCase()) {
  33. ids.push(sel[i].title)
  34. }
  35. }
  36. return ids
  37. }
  38.  
  39. var players = getPlayers()
  40. var users = getUsernames()
  41.  
  42. var i=0;
  43. function Loop()
  44. {
  45. setTimeout(function () {
  46. sendMsg(players[i],users[i])
  47. i++;
  48. if (i < players.length) {
  49. Loop();
  50. } else {
  51. alert('Done!')
  52. }
  53. }, 10000)
  54. }
  55.  
  56. Loop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement