Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var min_level = 2;
- var whitelist = [];
- $.getJSON('/all_online_users', function(users) {
- $.each(users, function(idx, usr) {
- if ((usr.tag === 'initiate') && (usr.level < min_level)){
- whitelist.push(usr.username);
- }
- })
- });
- console.log(whitelist);
- function banhammer() {
- window.setInterval(function() {
- $.getJSON('/all_online_users', function(users) {
- $.each(users, function(idx, usr) {
- if ((usr.tag === 'initiate') && (usr.level < min_level) && ($.inArray(usr.username, whitelist) == -1)){
- console.log('Banning ' + usr.username);
- whitelist.push(usr.username);
- $.post('/ban_ip', {'username': usr.username, 'comment': 'spam'});
- };
- })
- })
- }, 4000)
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement