Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sendMsg(userId, username)
- {
- $.post("http://www.roblox.com/messages/send",{
- subject : "subjekt of pm here ",
- body : " body of pm here.",
- recipientid : userId,
- cacheBuster : new Date().getTime()
- }).complete(function(){
- console.log('Sent message to ' + username + '.')
- })
- }
- function getPlayers()
- {
- var ids = []
- var sel = $('#ctl00_cphRoblox_TabbedInfo_GamesTab_RunningGamesList_RunningGamesContainer');
- sel = $(sel).find('a')
- for(i=0;i<sel.length;i++) {
- if(sel[i].href.toLowerCase().substring(0,'http://www.roblox.com/User.aspx?id='.length) == 'http://www.roblox.com/User.aspx?id='.toLowerCase()) {
- ids.push(sel[i].href.substring('http://www.roblox.com/User.aspx?id='.length))
- }
- }
- return ids
- }
- function getUsernames()
- {
- var ids = []
- var sel = $('#ctl00_cphRoblox_TabbedInfo_GamesTab_RunningGamesList_RunningGamesContainer');
- sel = $(sel).find('a')
- for(i=0;i<sel.length;i++) {
- if(sel[i].href.toLowerCase().substring(0,'http://www.roblox.com/User.aspx?id='.length) == 'http://www.roblox.com/User.aspx?id='.toLowerCase()) {
- ids.push(sel[i].title)
- }
- }
- return ids
- }
- var players = getPlayers()
- var users = getUsernames()
- var i=0;
- function Loop()
- {
- setTimeout(function () {
- sendMsg(players[i],users[i])
- i++;
- if (i < players.length) {
- Loop();
- } else {
- alert('Done!')
- }
- }, 10000)
- }
- Loop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement