Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var pageloadtime = 5
- var msgwaittime = 1
- function gogogo()
- {
- var players = 0
- var users = 0
- function sendMsg(userId, username)
- {
- $.post("http://www.roblox.com/friends/sendfriendrequest",{
- targetUserID : userId
- }).complete(function(){
- console.log('Sent request 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;
- var time
- function Loop()
- {
- setTimeout(function () {
- sendMsg(players[i],users[i])
- i++;
- if (i < players.length-1) {
- Loop();
- } else {
- __doPostBack('ctl00$cphRoblox$TabbedInfo$GamesTab$RunningGamesList$NextPageButton', '');
- setTimeout(function () {gogogo()},pageloadtime*1000)
- }
- }, msgwaittime*1000)
- }
- Loop()
- }
- gogogo()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement