Server Invite system for bot

By blackvenomm666 on Jun 15, 2011

Ok this was requested of me so i figured id give it a go. Anyways this is meant for a bot that is admin and is for sites that allow people to create a room only after a certain ammount of invites. Load into a new remote file on your bot. Then go into the Menubar or Nicklist to access the user access and invite ammount settings set your nick as safelisted then set the ammount of invites you want a person to get before they can get a room. After that its up to your users. When someon comes on and is invited by someone they do !invitedby nickhere it will write both the nick that invited them +1, and their ip to the file so they cannot do it again. Once a nick has reached the set ammount of invites it will send a global notice to the admins saying so and move them down to the roomok list meaning they can get a room. You can do !roomok nickhere to check and see if they can get a room yet. after they get a room if you want them to be able to get another do !roommade nickhere and it will remove em else they will stay there and not get anymore invites for that nick. If someone messes up you can do !reminviter nickhere and !reminvitee nickhere this will reset the messup.

menu menubar,nicklist, {
  .User Access
  ..SafeList Nick:auser InviteControlSafe $$?="SafeList What Nick?"
  ..UnSafeList Nick:ruser InviteControlSafe $$?"UnSafeList What Nick?"
.Invite ammount
..set: { .set %roomok $$?"Enter number of invites before they can get a room?" }
}
on $*:TEXT:/^(!invitedby)/Si:#:{
  if ($readini(invite.ini, roomok,$2)) {
    msg $nick $2 has reached their invite ammount please wait until they get a room to log yourself as being invited by them
  }
  elseif ($readini(invite.ini, invitee,$address($nick,4))) {
    msg $chan $nick you have already logged an inviter nickname $readini(invite.ini, invitee,$address($nick,4)))
  }
  else { writeini invite.ini inviter $2 $calc($readini(invite.ini, inviter,$2) + 1)
    writeini invite.ini invitee $address($nick,4) $2
  }
  if ($readini(invite.ini, inviter,$2) == %roomok) {
    remini invite.ini inviter $2
    writeini invite.ini roomok $2 %roomok
    .globops $2 has %roomok invites and may now get a room
  }
}
on $*:TEXT:/^(!roomok)/Si:#:{
  if ($readini(invite.ini, roomok,$2)) {
    .msg $nick has %roomok invites and may now get a room.
  }
}
on $*:TEXT:/^(!roommade)/Si:#:{
  if ($level($nick) = InviteControlSafe) {
    if ($readini(invite.ini, roomok,$2)) {
      remini invite.ini roomok $2
echo -a $2 $+ 's room has been made and has now been removed from the roomok list
.notice $2 $+ 's room has been made and has now been removed from the roomok list
    }
  }
}
on $*:TEXT:/^(!reminviter)/Si:#:{
  if ($level($nick) = InviteControlSafe) {
    if ($readini(invite.ini, inviter,$2)) {
      remini invite.ini inviter $2
echo -a $2 has been removed from the invitee list
.notice $nick $2 has been removed from the invitee list
    }
  }
}
on $*:TEXT:/^(!reminvitee)/Si:#:{
  if ($level($nick) = InviteControlSafe) {
    if ($readini(invite.ini, inviter,$address($2,4))) {
      remini invite.ini invitee $address($2,4)
echo -a $address($2,4) $2 has been removed from the invitee list
.notice $nick $address($2,4) $2 has been removed from the invitee list
    }
  }
}

Comments

Sign in to comment.
blackvenomm666   -  Jun 15, 2011

yea i havent learned how to combine the regex on text events all in one yet haha

 Respond  
Jethro   -  Jun 15, 2011

You have a way of using the on text regex, and many of them. :P Just remember that not all characters will be accepted; some need to be escaped, especially for the colon character.

Nice, effort you've put into this script...keep at it.

 Respond  
PuNkTuReD   -  Jun 15, 2011

looks good mate, i am sure you made it how it was asked for...
but, it would be nice to have some echos, in there for when you set the original number of invites,
and other echos for things like "Removed Invitee successfully"...
thats just a suggestion.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.