All-In-One Bot

By Sebastianb on Aug 14, 2009

This is a script thst includes:
!op
!-op
!hop
!-hop
!voice
!-voice
!ban
!unbann
!kick
!kick&ban
!topic
!mode
!invite
!help
Join/part message
Url Title fetcher
!bot on
!bot off

{b]How to install[/b]
Make 2 new remotes named File1.ini and File2.ini.
Uplooad part 1 in File1.ini
Upload part 2 in Fuke2.ini

Bug report?
Sebastianjbrown@rocketmail.com

All this is not mine but tweaked a lot.

;All-In-One Bot;
;By:Sebastian Brown;
;Part 1;

ON *:TEXT:!topic *:#: { 
  if ($nick isop $chan) { 
/Topic $chan $2
}
}

ON *:TEXT:!kick *:#: { 
  if ($nick isop $chan) { 
   kick $chan $2 $3-
}
}

ON *:TEXT:!Ban *:#: { 
  if ($nick isop $chan) { 
      /mode #channel +b $address ($2,3)
}
}

ON *:TEXT:!Kick&Ban *:#: { 
  if ($nick isop $chan) { 
      ban -k $chan $2 3 $3- 

}
}

ON *:TEXT:!Mode *:#: { 
  if ($nick isop $chan) { 
mode $chan $2-
}
}

ON *:TEXT:!op *:#: { 
  if ($nick isop $chan) { 
mode $chan +o $2 
}
}

ON *:TEXT:!-op *:#: { 
  if ($nick isop $chan) { 
mode $chan -o $2 
}
}

ON *:TEXT:!unban *:#: { 
  if ($nick isop $chan) { 
      /mode #channel -b $address ($2,3)
}
}

ON *:TEXT:!voice *:#: { 
  if ($nick isop $chan) { 
      mode $chan +v $2 
}
}

ON *:TEXT:!-voice *:#: { 
  if ($nick isop $chan) { 
      mode $chan -v $2
}
}

ON *:TEXT:!hop *:#: { 
  if ($nick isop $chan) { 
/mode #channel +h nick
}
}

ON *:TEXT:!-hop *:#: { 
  if ($nick isop $chan) { 
/mode #channel -h nick
}
}

ON *:TEXT:!invite *:#: { 
  if ($nick isop $chan) { 
/invite $chan $2
}
}

ON *:TEXT:!help:#: {
      notice $nick Nick Registration: /msg NickServ REGISTER password e-mail
      notice $nick Channel Registration: /msg ChanServ REGISTER channel password e-mail
      notice $nick Memo Sending: /msg MemoServ SEND nick message
      notice $nick  
      notice $nick While using MemoServ, you must have a registered nick.
}

ON !*:JOIN:#: {
      notice $nick Welcome to $chan $+ , $nick $+ !
      notice $nick Enjoy your stay!!!
}

ON *:PART:#: {
      notice $nick Goodbye, and thanks for coming to $chan $+ !
}

on *:TEXT:*:#: rtc $chan $1-
on *:ACTION:*:#: rtc $chan $1-
on *:sockopen:website.*: {
  if (!$sockerr) {
    tokenize 32 $($+(%,$sockname),2)
    sockwrite -n $sockname GET $2 HTTP/1.1
    sockwrite -n $sockname Host: $1
    sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8)
    sockwrite -n $sockname Accept: */*
    sockwrite -n $sockname Connection: Close
    sockwrite -n $sockname $crlf
  }
  else unset $+(%,$sockname)
}
on *:sockread:website.*: {
  var %x, %z = $sockname, %e = $($+(%,%z),2)
  sockread -f %x
  if ($regex(%x,/<title[\w\s="]*>(.*?)<\/title>/i)) {
    tokenize 32 %e
    var %s = $btc(Url:) $+(http://,$+($1,$iif($2 != /,$2))) - $btc(Title:) $ptc($regml(1)) $iif($4,$4)
    msg $3 $iif(c isincs $chan($3).mode,$strip(%s),%s)
    unset $+(%,$(%z,2))
    .sockclose %z
  }
  if (*HTTP*302* iswm %x) set -e %web.tmp 1
  if (Location: isin %x) {
    if ($mtc(%x)) {
      tokenize 32 %e
      sockclose %z
      soc $regml(web,1) $iif($regml(web,2),$v1,/) $iif($3,$3,1) %z $iif(%web.tmp,Redirected)
      unset %web.tmp
    }
  }
}
on *:sockclose:website.*: unset $+(%,$sockname)
alias -l soc {
  var %x = $iif($4,$4,$+(website.,$r(a,z),$r(a,z),$r(a,z),$r(0,9),$r(0,9),$r(0,9)))
  set -e $+(%,%x) $1-2 $iif($3 ischan && $me ison $3,$3) $iif($5,$ntc($5))
  sockopen %x $1 80
}
alias -l mtc return $regex(web,$1,/(?:https?:\/\/)?((?:www\.)?[\w-.]+\.(?>[a-z]{2,4})(?![a-z]))([\w-_#?=%.\/&?]+)?/ig)
alias -l ptc return $replacecs($1,&mdash;,-,&quot;,",&amp;,&,&lt;,<,&gt;,>,�,$chr(233),�,$chr(231),&ccedil;,$chr(231),&ntilde;,$chr(241),�,$chr(209),�,$chr(220),�,$chr(244))
alias -l btc return $+($chr(2),$1,$chr(2))
alias -l ntc return $+($chr(40),$1,$chr(41))
alias rtc {
  if ($mtc($2-)) && (!%website.flood [ $+ [ $regml(web,1) ] ]) {
    var %x = 1, %v 
    while ($regml(web,%x)) {
      var %z = $iif(/ isin $regml(web,$calc(%x +1)),$v2,/), %i = $regml(web,%x)
      if (/ !isin %i) && (!$istok(%v,%i,32)) {
        soc %i %z $1
        %v = %v %i
      }
      inc %x 1
    }
    set -eu5 %website.flood $+ $regml(web,1) 1
  }
}

on *:text:!bot off:#:{
  if ($nick isop $chan) {
    unload –rs File1.ini
    /msg $chan Bot commands now unactive!
  }
}

;All-In-One Bot;
;By:Sebastian Brown;
;Part 2;

on *:text:!bot on:#:{
  if ($nick isop $chan) {
    load –rs File1.ini
    /msg $chan Bot commands now active!
  }
}

Comments

Sign in to comment.
PuNkTuReD   -  Aug 15, 2009

considering your scripts starts with

ON :TEXT:!topic :#: {
if ($nick isop $chan) {
/Topic $chan $2
}
}

i take it youve copied this before youve actually used it in remote files or the layout would be proper. im not saying this script doesnt work, but im sick of seeing people upload script they obviously havent

A: test.
B: even pasted into a remotes file.

as i said youll prob get defensive about my post but, i dont mean it personaly but when you see a script with proper ............ meh whats the point. ........... ......... paste your script in remote files first then upload, even script layout will make some of us look at your script more serious than others.................

 Respond  
zNigel-   -  Aug 15, 2009
ON *:TEXT:!topic *:#: { 
  if ($nick isop $chan) { 
/Topic $chan $2
}
}

Moar liek $2-

 Respond  
Sebastianb   -  Aug 14, 2009

?

 Respond  
xplo   -  Aug 14, 2009

rip.

 Respond  
Sebastianb   -  Aug 14, 2009

Thank you spent 2 days on it! Tweaking and typing up everything

 Respond  
knoeki   -  Aug 14, 2009

The indenting is a bit weird, but otherwise this seems to be doing what it's supposed to do. :_)

 Respond  
Sebastianb   -  Aug 14, 2009

i tested everything but the bot on and off so if its broke i can edit it

 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.