party line bot

By PuNkTuReD on Dec 29, 2008

can be used in channel only by bot master only
!startparty
!stopparty

can be used in channel or the party line
!joinparty
!partparty

can be used by party host in party line only
!kick (nick)
!ban (nick) (reason)

based on the old dcc party line bots
this one just works with query

so keep your partys small or youll lag the bot

only botmasters can start the party
to add yourself as bot master
bring the bot online, into the channel you are on
then IN THE BOTS MIRC type

/owner YOUR_NICK

edited:
there was a ini file problem
edited:
added
!kick nick
!ban nick reason

/*
can be used in channel only by bot masters only
!startparty
!stopparty

can be used in channel or the party line
!joinparty
!partparty

can be used by party host in party line only
!kick (nick)
!ban (nick) (reason)
*/
on *:text:*:#: {
  if ($address($nick,2) == $gettok($readini(users.ini,botmaster,$nick),2,32)) {
    if ($strip($1) == !startparty) { 
      if (!%party) { startparty } 
      else { .msg $chan There is already a party in progress. }
    }
    if ($strip($1) == !stopparty) { 
      if (%party) { 
        if ($nick == %partyhost) { stopparty }
        else { .msg $chan You may not stop this party. } 
      }
      else { .msg $chan There is no party in progress. }
  } }
  if ($strip($1) == !joinparty) { 
    if (%party) { 
      if ($nick isin %partygoers) { .query $nick You are already at the party. }
      else {
        if ($readini(partybans.ini,%partyhost,$address($nick,2)) == $true) { .query $nick You are banned from this party. }
        else { joinparty }
    } }
    else { .msg $chan There is no party in progress. }
  }
  if ($strip($1) == !partparty) { 
    if (%party) { 
      if ($nick isin %partygoers) { partparty }
      else { .query $nick You cant leave a party your not at. }
    }
    else { .msg $chan There is no party in progress. }
} }
on *:text:*:?: {
  if ($nick == %partyhost) {
    if ($strip($1) == !kick) { set -u5 %partynick2kick $2 | kickpartygoer } 
    if ($strip($1) == !ban) { set -u5 %partynick2ban $2 | set -u5 %reason $3- | banpartygoer } 
  }
  if ($nick isin %partygoers) { set %partymsg $1- | msgallparty }
  if ($strip($1) == !joinparty) { 
    if (%party) { 
      if ($nick isin %partygoers) { .query $nick You are already at the party. }
      else {
        if ($readini(partybans.ini,%partyhost,$address($nick,2)) == $true) { .query $nick You are banned from this party. }
        else { joinparty }
    } }
    else { .msg $chan There is no party in progress. }
  }
  if ($strip($1) == !partparty) { 
    if (%party) { 
      if ($nick isin %partygoers) { partparty }
      else { .query $nick You cant leave a party your not at. }
    }
    else { .msg $chan There is no party in progress. }
} }
on *:action:*:?: {
  if ($nick isin %partygoers) { set %partymsg $1- | msgallparty }
}
alias owner { writeini users.ini botmaster $1 $1 $address($1,2) }
alias startparty { 
  if ($address($nick,2) == $gettok($readini(users.ini,botmaster,$nick),2,32)) {
    set %party party in progress
    set %partyhost $nick
    set %partygoers $nick
    .msg $chan Party is now in progress. Hosted by: %partyhost %+ .
    .query $nick $+(<,$nick,>) thank you for starting a party line chat.
} }
alias stopparty { 
  if ($address($nick,2) == $gettok($readini(users.ini,botmaster,$nick),2,32)) {
    unset %party*
    .msg $chan The party has been cancelled.
} }
alias joinparty { 
  set %partygoers %partygoers $nick
  var %a = 1
  var %b = $numtok(%partygoers,32)
  while %a <= %b {
    .query $gettok(%partygoers,%a,32) $+(<,$nick,>) has joined the party.
    inc %a
  }
  .query $nick Current Party: Host: %partyhost $+ . Users: %partygoers $+ .
}
alias partparty { 
  var %a = 1
  var %b = $numtok(%partygoers,32)
  while %a <= %b {
    .query $gettok(%partygoers,%a,32) $+(<,$nick,>) has left the party.
    inc %a
  }
  set %partygoers $remove(%partygoers,$nick)
}
alias msgallparty {
  var %a = 1
  var %b = $numtok(%partygoers,32)
  while %a <= %b {
    if ($gettok(%partygoers,%a,32) == $nick) { inc %a }
    else {
      .query $gettok(%partygoers,%a,32) $+(<,$nick,>) %partymsg
      inc %a
    }
} }
alias kickpartygoer {
  if (%partynick2kick isin %partygoers) {
    var %a = 1
    var %b = $numtok(%partygoers,32)
    while %a <= %b {
      .query $gettok(%partygoers,%a,32) $+(<,%partynick2kick,>) has been kicked from the party.
      inc %a
    }
    set %partygoers $remove(%partygoers,$($+(%,partynick2kick),2))
  }
  else { .query %partyhost That nick is not in the party. }
}
alias banpartygoer {
  if (%partynick2ban isin %partygoers) {
    if (%reason) {
      var %a = 1
      var %b = $numtok(%partygoers,32)
      while %a <= %b {
        .query $gettok(%partygoers,%a,32) $+(<,%partynick2ban,>) has been banned from the party. Reason: $+($($+(%,reason),2),.)
        writeini partybans.ini %partyhost $address(%partynick2ban,2) %reason
        inc %a
      }
      set %partygoers $remove(%partygoers,$($+(%,partynick2ban),2))
    }
    else { .query %partyhost Please specify a reason. }
  }
  else { .query %partyhost That nick is not in the party. }
}

Comments

Sign in to comment.
PuNkTuReD   -  Dec 29, 2008

tbh i probably should start using that system lol

i should also point out that the way i am doing it,
if your hostmask changes alot, this bot wont be good for you.
as it recognises bot master by your address

 Respond  
Aucun50   -  Dec 29, 2008

Thanks works good now, i was thinking you were using the owner/master/user kind of thing for your bot master.

 Respond  
PuNkTuReD   -  Dec 29, 2008

ok edited the code, cheers for pointin that out m8
should be fine now

 Respond  
Aucun50   -  Dec 29, 2008

Here how it went, i put in remotes in the bots mirc i typed /owner Aucun50 and got that error and i was in the same as the bot.

 Respond  
PuNkTuReD   -  Dec 29, 2008

were you on the same channel as the nick you were adding?

 Respond  
Aucun50   -  Dec 29, 2008

Ya sorry about that i was thinking of something else

 Respond  
PuNkTuReD   -  Dec 29, 2008

umm no you dont
i am using files
nice try anyway m8

adding botmaster

alias owner { writeini users.ini botmaster $1 $1 $address($1,2) }

reading whether the user is botmaster

($address($nick,2) == $gettok($readini(users.ini,botmaster,$nick),2,32))

try the script b4 u diss the script

 Respond  
Aucun50   -  Dec 29, 2008

/owner Aucun50:

  • /writeini: insufficient parameters (line 69, script4.txt)
 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.