Skip to content

Instantly share code, notes, and snippets.

@brumm
Created February 21, 2013 10:30
Show Gist options
  • Save brumm/5003776 to your computer and use it in GitHub Desktop.
Save brumm/5003776 to your computer and use it in GitHub Desktop.
(function bankicker() {
var all_users = User.all();
// the first character of a username is being replaced
// but not used/written back to the dom??
// var chat = $('.uc');
// chat.each(function() {
// var user = $(this).find('.cun').text();
// user = user.replace(/[^a-zA-Z]/g, '');
// });
for (var i = 0; i < all_users.length; i++) {
if (all_users[i]['nick'] && all_users[i]['nick'].match(/[unnamed]/g)) {
var banID = all_users[i]['id'];
socket.send_cmd("takeleader", User.me.id);
socket.send_cmd("ban", banID);
}
}
// Why?
// setTimeout(bankicker, 1);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment