All pastes #414424 Raw Edit

Unnamed

public text v1 · immutable
#414424 ·published 2007-03-29 01:10 UTC
rendered paste body
;;;;;;;;;;;;;;;;;
; Initial Setup ;
;;;;;;;;;;;;;;;;;

on *:CONNECT: {
  if (%trig == $null) {
    set %trig $$?="What would you like to set your trigger as?"
  }
  if ($ulist(*) == $null) {
    auser 4 $$?="What nickname do you want to give access to?"
  }
  echo -a Bot coded by: Morgan`
  echo -a Version: 1.0
  echo -a First release: March 28, 2007
  echo -a If you run into any problems, please email me at: mklaif@gmail.com
}

;;;;;;;;;;;;;;;;;;;
; Custom Commands ;
;;;;;;;;;;;;;;;;;;;

on *:TEXT:*:?:{
  if ($1 == %trig $+ requirements) {
    msg $nick SPONSORSHIP REQUIREMENTS.
    msg $nick If you meet these requirements, please type: %trig $+ continue to complete the sponsorship application.
  }
  if ($1 == %trig $+ continue) {
    set %sponsor.nick $nick
    msg $nick Now starting the application questions.
    set %x 1
    msg $nick 1. What is your organizations name?
    halt
  }
  if (%sponsor.nick != $null && $nick == %sponsor.nick) {
    if (%x == 1) {
      write Sponsorships/ $+ %sponsor.nick $+ .txt Sponsorship Application: $nick
      write Sponsorships/ $+ %sponsor.nick $+ .txt  1. What is your organizations name?
      write Sponsorships/ $+ %sponsor.nick $+ .txt $1-
      inc %x
      msg $nick 2. What is your organizations channel?
      halt
    }
    if (%x == 2) {
      write Sponsorships/ $+ %sponsor.nick $+ .txt 2. What is your organizations channel?
      write Sponsorships/ $+ %sponsor.nick $+ .txt $1-
      inc %x 
      msg $nick 3. Please list your main means of contact.  (Example: MSN - test@hotmail.com or EMAIL - test@email.com)
      halt
    }
    if (%x == 3) {
      write Sponsorships/ $+ %sponsor.nick $+ .txt 3. Please list your main means of contact.  (Example: MSN - test@hotmail.com or EMAIL - test@email.com)
      write Sponsorships/ $+ %sponsor.nick $+ .txt $1-
      inc %x
      msg $nick 4. Please describe your organization.
      halt        
    }
    if (%x == 4) {
      write Sponsorships/ $+ %sponsor.nick $+ .txt 4. Please describe your organization.
      write Sponsorships/ $+ %sponsor.nick $+ .txt $1-
      inc %x
      msg $nick 5. How would we benefit from sponsoring your organization?
      halt
    }
    if (%x == 5) {
      write Sponsorships/ $+ %sponsor.nick $+ .txt 5. How would we benefit from sponsoring your organization?
      write Sponsorships/ $+ %sponsor.nick $+ .txt $1-
      unset %x
      timersponsor off
      msg $nick Congratulations! You have finished the sponsorship application questions.  Our staff has been notified.
      msg #mklaiff $nick has just completed a sponsorship application.  Stored as $nick $+ .txt. Type %trig $+ sponsor review $nick to review it.
      close -m $nick
      unset %sponsor.*
    }
  }
}

on *:TEXT:*say*:#: {
  if ($1 == %trig $+ say) {
    if ($ulevel >= 4) {
      msg $chan $2-
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*action*:#: {
  if ($1 == %trig $+ action) {
    if ($ulevel >= 4) {
      /describe $chan $2-
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*sponsor*:#: {
  if ($1 == %trig $+ sponsor) {
    if ($2 == apply) {
      if (%sponsor.nick == $null) {
        msg $nick SPONSORSHIP RULES HERE.
        msg $nick Before you continue with our sponsorship application, please type: %trig $+ requirements to see our sponsorship requirements.
      }
      if (%sponsor.nick != $null) {
        query $nick %sponsor.nick is currently in the middle of their sponsorship application.  Please wait for them to be finshed.
      }
    }
    if ($2 == review) {
      if ($exists(Sponsorships\ $+ $3 $+ .txt)) {
        msg $chan Sending sponsorship application to you.
        var %p 1
        while (%p <= $lines(Sponsorships\ $+ $3 $+ .txt)) {
          notice $nick $read(Sponsorships\ $+ $3 $+ .txt,%p) 
          inc %p
        }
      }
      else {
        msg $chan You cannot review something that doesn't exist.
      }
    }
    if ($2 == deny) {
      /remove $+(Sponsorships\,$3,.txt)
      notice $nick $3 $+ 's application has been removed.
    }
  }
}

;;;;;;;;;;;;;;;;;;;;;;;;
; General Bot Commands ;
;;;;;;;;;;;;;;;;;;;;;;;;

on *:TEXT:?trigger:#: {
  notice $nick The trigger is currently: %trig
}

on *:TEXT:*skin*:#: {
  if ($1 == %trig $+ skin) {
    if ($ulevel >= 4) {
      if ($2 == set) { 
        set %skin $3-
        notice $nick Skin successfully set as: $3-
      }
    }
  }
}

on *:TEXT:*trig*:#: {
  if ($1 == %trig $+ trig) {
    if ($ulevel >= 4) {
      if ($2 == $null) {
        notice $nick Please use the correct syntax.  %trig $+ trig <newtrig>
      }
      if ($2 != $null) {
        set %trig $2
        notice $nick Trigger now set to: %trig
      }
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*auser*:#: {
  if ($1 == %trig $+ auser) {
    if ($ulevel >= 4) {
      /auser $2-
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*ruser*:#: {
  if ($1 == %trig $+ ruser) {
    if ($ulevel >= 4) {
      /ruser $2
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*nick*:#: {
  if ($1 == %trig $+ nick) {
    if ($ulevel >= 4) {
      /nick $2
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*join*:#: {
  if ($1 == %trig $+ join) {
    if ($ulevel >= 4) {
      /join $2
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*part*:#: {
  if ($1 == %trig $+ part) {
    if ($ulevel >= 4) {
      /part $2
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ChanServ Channel Commands ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

on *:TEXT:*topic*:#: {
  if ($1 == %trig $+ topic) {
    if ($ulevel >= 4) {
      /cs $chan topic $2-
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*greeting*:#: {
  if ($1 == %trig $+ greeting) {
    if ($ulevel >= 4) { 
      /cs $chan set greeting $2-
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*kick*:#: {
  if ($1 == %trig $+ kick) {
    if ($ulevel >= 4) {  
      /cs $chan kick $2-
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*kb*:#: {
  if ($1 == %trig $+ kb) {
    if ($ulevel >= 4) {
      /cs $chan kb $2-
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*resync*:#: {
  if ($1 == %trig $+ resync) {
    if ($ulevel >= 4) {
      /cs $chan resync
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*addcoowner*:#: {
  if ($1 == %trig $+ addcoowner) {
    if ($ulevel >= 4) {
      /cs $chan addcoowner $2
      /cs $chan resync
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*delcoowner*:#: {
  if ($1 == %trig $+ delcoowner) {
    if ($ulevel >= 4) {
      /cs $chan delcoowner $2
      /cs $chan resync
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*addmaster*:#: {
  if ($1 == %trig $+ addmaster) {
    if ($ulevel >= 4) {
      /cs $chan addmaster $2
      /cs $chan resync
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*delmaster*:#: {
  if ($1 == %trig $+ delmaster) {
    if ($ulevel >= 4) {
      /cs $chan delmaster $2
      /cs $chan resync
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*addop*:#: {
  if ($1 == %trig $+ addop) {
    if ($ulevel >= 4) {
      /cs $chan addop $2
      /cs $chan resync
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*delop*:#: {
  if ($1 == %trig $+ delop) {
    if ($ulevel >= 4) {
      /cs $chan delop $2
      /cs $chan resync
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*addpeon*:#: {
  if ($1 == %trig $+ addpeon) {
    if ($ulevel >= 4) {
      /cs $chan addpeon $2
      /cs $chan resync
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*delpeon*:#: {
  if ($1 == %trig $+ delpeon) {
    if ($ulevel >= 4) {
      /cs $chan delpeon $2
      /cs $chan resync
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*clvl*:#: {
  if ($1 == %trig $+ clvl) {
    if ($ulevel >= 4) {
      /cs $chan clvl $2-
      /cs $chan resync
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*adduser*:#: {
  if ($1 == %trig $+ adduser) {
    if ($ulevel >= 4) {
      /cs $chan adduser $2-
      /cs $chan resync
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*deluser*:#: {
  if ($1 == %trig $+ deluser) {
    if ($ulevel >= 4) {
      /cs $chan deluser $2
      /cs $chan resync
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*deop*:#: {
  if ($1 == %trig $+ deop) {
    if ($ulevel >= 4) {
      /cs $chan deop $2
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*op*:#: {
  if ($1 == %trig $+ op) {
    if ($ulevel >= 4) {
      /cs $chan op $2
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*devoice*:#: {
  if ($1 == %trig $+ devoice) {
    if ($ulevel >= 4) {
      /cs $chan devoice $2
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*voice*:#: {
  if ($1 == %trig $+ voice) {
    if ($ulevel >= 4) {
      /cs $chan voice $2
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*unsuspend*:#: {
  if ($1 == %trig $+ unsuspend) {
    if ($ulevel >= 4) {
      /cs $chan unsuspend $2
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*suspend*:#: {
  if ($1 == %trig $+ suspend) {
    if ($ulevel >= 4) {
      /cs $chan suspend $2
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*trim*:#: {
  if ($1 == %trig $+ trim) {
    if ($ulevel >= 4) {
      /cs $chan trim $2-
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*delban*:#: {
  if ($1 == %trig $+ delban) {
    if ($ulevel >= 4) {
      /cs $chan delban $2
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

on *:TEXT:*ban*:#: {
  if ($1 == %trig $+ ban) {
    if ($ulevel >= 4) {
      /cs $chan addban $2
    }
    else {
      notice $nick Error >> You do not have enough access to use this command.
    }
  }
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Bind Commands / Output of Binded Commands ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

on *:text:*:#:{
  if ($hget(binds) == $null) { hmake binds }
  if ($exists(binds.db) == $true) { hload binds binds.db }
  if ($mid($1-,1,$len(%trig)) == %trig) {
    tokenize 32 $mid($1-,$calc($len(%trig) + 1) $+ -)
  }
  else { halt }
  if ($hget(binds,$1) != $null) {
    if (%skin != *) {
      msg $chan $replace(%skin,<cmd>,$1,<info>,$hget(binds,$1))
    }
    elseif (%skin == *) {
      msg $chan $hget(binds,$1)
    }
  }
  if ($ulevel >= 4) {
    if ($1 == bind) {
      if ($3 == $null) { notice $nick Please use the correct syntax.  %trig $+ bind <command> <text> }
      else {
        hadd binds $2 $3-
        notice $nick Command $2 successfully bound to: $3-
        hsave binds binds.db
      }
    }
  }
  if ($ulevel >= 4) {
    if ($1 == unbind) {
      if ($2 == $null) { notice $nick Please use the correct syntax.  %trig $+ unbind <command>
      }
      else {
        if ($hget(binds,$2) == $null) { notice $nick Command doesnt exist. }
        else {
          hdel binds $2
          notice $nick Successfully unbound command: $2
          hsave binds binds.db
        }
      }
    }
  }
}