GhostBot+

Off-topic discussion.

Moderator: Userbase Moderators

aero
Palom
Palom
Posts: 4787
Joined: Fri Mar 28, 2014 2:51 pm

GhostBot+

Postby aero » Sun Dec 28, 2014 12:33 am

Now that GhostBot has been retired from the lack of spam, I'm going to share his script with everyone. Feel free to suggest changes, and use this script or parts of it for your own bot. Forgive some of the odd stuff, since I built GB around the spam attacks and used multiple sources to get some stuff done.
Spoiler: show

Code: Select all

;Connect to server
on *:START: {
  server irc.stardustfields.net
}

;Join channels
on *:CONNECT: {
  join #smbx
  join #smbx-staff
  join ##smbx-entrance-blocked
}

;Initialize guardmode
on *:LOAD: {
  set %guardmode 0
}

;Prevents changing nick 3 or more times within 5 seconds
on *:NICK:{
  inc -u5 %spam. [ $+ [ $nick ] ]
  if (%spam. [ $+ [ $nick ] ] >=  3) && ($nick !isop $chan) && (%guardmode = 1) {
    ban $chan $wildsite
    kick $chan $nick Nick change spam.
    notice GhostHawk $nick has been banned.
    halt
  }
}

;Prevent noticing the channel
on *:NOTICE:*:#smbx: {
  if (%guardmode = 1) && ($nick !isop $chan) {
    ban $chan $wildsite
    kick $chan $nick Noticing $chan
    notice GhostHawk $nick has been banned.
    halt
  }
}

;Determine if guardmode is on or off
on *:TEXT:*:#: {
  if ($1 == ?guard) && ($nick isop $chan) && (%guardmode == 1) {
    msg $chan Guard mode is on.
  }
  elseif ($1 == ?guard) && ($nick isop $chan) && (%guardmode == 0) {
    msg $chan Guard mode is off.
  }

;Set guardmode to be on or off
  if ($1 = ?guardmode) && ($2 = on) && ($nick isop $chan) {
    set %guardmode 1
    msg $chan Guard mode is now on.
  }
  elseif ($1 = ?guardmode) && ($2 = off) && ($nick isop $chan) {
    set %guardmode 0
    msg $chan Guard mode is now off.
  }

;Prevent saying 5 or more lines of text within 3 seconds
  if (%guardmode = 1) {
    inc -u3 %spam. [ $+ [ $nick ] ]
    if (%spam. [ $+ [ $nick ] ] >= 5) && ($nick !isop $chan) && (%guardmode = 1) {
      ban $chan $wildsite
      kick $chan $nick Spam.
      notice GhostHawk $nick has been banned.
      halt
    }

;Kick if starman or donger is said
    if (*starman* iswm $1-) || (*donger* iswm $1-)  {
      kick $chan $nick
    }

;Prevent wall of text from being sent as soon as user joins
    if ($len($1-) >= 150) && (%lastj == $nick) {
      ban $chan $wildsite
      kick $chan $nick You appear to be a spambot.
      notice GhostHawk $nick has been banned.
    }

    set %text $1-
    set %s 1
    set %totalwords 0

    ;Looks how many lines is in your text file
    set %lines $lines(badwords.txt)
    while ( %s <= %lines ) {
;Counts the number of badwords in your message, and bans if 6 or more badwords are said
      if ($read(badwords.txt, %s ) isin %text ) {
        inc %totalwords. [ $+ [ $nick ] ]
        inc %s
      }
      else inc %s
    }

    if (%totalwords. [ $+ [ $nick ] ] >=  6) {
      ban $chan $wildsite
      kick $chan $nick Spam.
      notice GhostHawk $nick has been banned.
      unset %s
      unset %totalwords. [ $+ [ $nick ] ]
      halt
    }
    else {
      unset %s
      unset %totalwords. [ $+ [ $nick ] ]
      halt
    }
  }
}

;Prevent revolving door spam
on *:PART:#:{
  set -u60 %rd. [ $+ [ $chan ] $+ . $+ [ $nick ] ] $calc( %rd. [ $+ [ $chan ] $+ . $+ [ $nick ] ] + 1 )
  if (%rd. [ $+ [ $chan ] $+ . $+ [ $nick ] ] >= 4) {
    if (%guardmode = 1) {
      ban $chan $wildsite
      kick $chan $nick Part/Join spam.
      notice GhostHawk $nick has been banned.
    }
  }
}

;Auto-rejoin
on *:KICK:#: {
  join #
}

;Automatically turns on guardmode if someone quits with spambot in their quit message, used with Xanos
on *:QUIT: {
  if (*spambot* iswm $1-) && (%guardmode = 0) {
    set %guardmode 1
    msg #smbx Guard mode is now on.
  }
}

on *:JOIN:#:{
;Message user why they aren't able to join
  if ($chan == ##smbx-entrance-blocked) && ($wildsite isban #smbx) {
    notice $nick Hi $nick $+ . You are here because you are banned from #smbx. To appeal this ban, message an OP.
  }

  if ($chan == ##smbx-entrance-blocked) && (r isin $chan(#smbx).mode) && ($wildsite !isban #smbx) {
    notice $nick Hi $nick $+ . You are here because you must be authenticated with NickServ before joining #smbx at this time. Use the following command for help to either register to $network or login: /msg NickServ HELP
  }

  if ($chan == ##smbx-entrance-blocked) && (i isin $chan(#smbx).mode) && ($wildsite !isban #smbx) {
    notice $nick Hi $nick $+ . You are here because you must be invited into #smbx to join at this time. Contact an op and they will invite you shortly.
  }

;Prevent duplicates of a host from joining.
  if (%guardmode = 1) {

    if ($ialchan($address,#,0) >= 3) {
      ban $chan $wildsite
      kick $chan $nick Clone.
      notice GhostHawk $nick has been banned.
    }

;Set the last joined user, to prevent wall of text when they join
    set -u30 %lastj $nick
  }

Julia Pseudo
Luigi
Luigi
Posts: 5609
Joined: Wed Jan 08, 2014 12:04 am
Flair: gay gaymer girl
Pronouns: She/her

Re: GhostBot+

Postby Julia Pseudo » Sun Dec 28, 2014 12:42 am

Aww, good-bye, GhostBot. You had a good run. We'll miss you.

HeroOfRhyme
Boomerang Bro
Boomerang Bro
Posts: 1382
Joined: Sat May 17, 2014 12:47 pm

Re: GhostBot+

Postby HeroOfRhyme » Sun Dec 28, 2014 5:26 am

Would gladly take the code and make something out of it if I knew how.

Mable
Luigi
Luigi
Posts: 5806
Joined: Sat Dec 21, 2013 4:23 am
Contact:

Re: GhostBot+

Postby Mable » Sun Dec 28, 2014 8:25 am

Amazing thank you dude. Now i finally could setup the bot for the channel :) thank you.

aero
Palom
Palom
Posts: 4787
Joined: Fri Mar 28, 2014 2:51 pm

Re: GhostBot+

Postby aero » Sun Dec 28, 2014 10:06 am

Mystogan wrote:Would gladly take the code and make something out of it if I knew how.
Load it into mIRC, and change stuff (like my Name in the code to yours so that you get noticed when somebody is banned) and look up some scripts online. The support online isn't the best since IRC and mIRC are pretty old and it's unlikely you'll find recent stuff for fixing problems and whatever, but when you get the hang of some of the syntax you should be good from there.
CaptainSyrup wrote:Amazing thank you dude. Now i finally could setup the bot for the channel :) thank you.
No problem. :)

HeroOfRhyme
Boomerang Bro
Boomerang Bro
Posts: 1382
Joined: Sat May 17, 2014 12:47 pm

Re: GhostBot+

Postby HeroOfRhyme » Mon Dec 29, 2014 7:46 am

Looks like GhostBot's job isnt done yet, considering yesterday...

TangledLion
Spike
Spike
Posts: 267
Joined: Sun Jul 06, 2014 9:57 pm

Re: GhostBot+

Postby TangledLion » Tue Dec 30, 2014 2:14 pm

Mystogan wrote:Looks like GhostBot's job isnt done yet, considering yesterday...
What happened on the 28th? I'm not on the IRC too often...

Danny
Wart
Wart
Posts: 4001
Joined: Fri Dec 20, 2013 1:12 pm
Flair: aka LMNtals
Pronouns: he/they

Re: GhostBot+

Postby Danny » Tue Dec 30, 2014 6:10 pm

Michel had a botnet on #elsa and attacked #smbx.

JupiHornet
Boom Boom
Boom Boom
Posts: 2399
Joined: Tue Sep 02, 2014 5:43 pm
Contact:

Re: GhostBot+

Postby JupiHornet » Tue Dec 30, 2014 6:27 pm

8bitmushroom wrote:Michel had a botnet on #elsa and attacked #smbx.
This is why we need at least 5 bots

aero
Palom
Palom
Posts: 4787
Joined: Fri Mar 28, 2014 2:51 pm

Re: GhostBot+

Postby aero » Tue Dec 30, 2014 9:01 pm

Turtwig wrote:
8bitmushroom wrote:Michel had a botnet on #elsa and attacked #smbx.
This is why we need at least 5 bots
I don't think you understand the concept of bots.

Danny
Wart
Wart
Posts: 4001
Joined: Fri Dec 20, 2013 1:12 pm
Flair: aka LMNtals
Pronouns: he/they

Re: GhostBot+

Postby Danny » Wed Dec 31, 2014 12:35 am

* Now talking on #smbx
* Topic for #smbx is: Merry Christmas! | Tower of Biased 8 http://www.smbxgame.com/forums/v ... =36&t=7334 | Welcome to the IRC channel for Super Mario Bros. X :: http://www.smbxgame.com/ | Wiki channel - #smbxwiki :: Games channel - #smbxgames | Channel Rules: http://bit.ly/1Bbp33V | The chat can be quiet sometimes. Be Patient.
* Topic for #smbx set by Melia!~Melia@smbx/chanop/Quill (Fri Dec 26 21:37:17 2014)
* #smbx :http://www.smbxgame.com/
<The8bitmushroom> https://www.youtube.com/watch?v=Fhw-yOW ... e=youtu.be
* GhostBot sets ban on *!*@c-174-62-137-141.hsd1.ct.comcast.net
* You have been kicked from #smbx by GhostBot (You appear to be a spambot.)
* Cannot join #smbx (You are banned).
Ghooostboottt whyyyyyy. :cry:

HeroOfRhyme
Boomerang Bro
Boomerang Bro
Posts: 1382
Joined: Sat May 17, 2014 12:47 pm

Re: GhostBot+

Postby HeroOfRhyme » Wed Dec 31, 2014 8:11 am

Because you joined and immediately posted a link.

Danny
Wart
Wart
Posts: 4001
Joined: Fri Dec 20, 2013 1:12 pm
Flair: aka LMNtals
Pronouns: he/they

Re: GhostBot+

Postby Danny » Wed Dec 31, 2014 4:05 pm

Mystogan wrote:Because you joined and immediately posted a link.
No shit, Sherlock.

aero
Palom
Palom
Posts: 4787
Joined: Fri Mar 28, 2014 2:51 pm

Re: GhostBot+

Postby aero » Wed Dec 31, 2014 5:26 pm

8bitmushroom wrote:
Mystogan wrote:Because you joined and immediately posted a link.
No shit, Sherlock.
Don't be rude please.


Return to “Sandbox”

Who is online

Users browsing this forum: Amazon [Bot] and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari