24/7 bot in channel

By Cheiron on Jan 29, 2008

Full Updated script.

This script allows you to maintain a bot in channel 24/7.

This is made for a help channel for example where there are say 2 or 3 ops with the same scripts on their bots so if one goes offline another instantly joins the channel to provide seamless cover.

All bots names must be added to Notify for this script to work and obviously need to be online but not sat in the desired channel.

set up...

change #channel for the working channel
change nick nick2 for the nicks on notify

thanks to PuNkTuReD for helping with the user in channel check where there are more than one bot setup for the channel.

on *:JOIN:#channel:{
  if ($istok(nick nick2,$nick,32)) { part #channel }
  elseif ($nick == $me) { .timer 1 1 check4nicks $chan }
}
on *:UNOTIFY:{
  if ($istok(nick nick2,$nick,32)) {
    if ( ( $notify(nick).ison == $false ) && ( $notify(nick2).ison == $false ) ) {
      join #channel
    }
  }
}
on *:NICK: { if ($istok(nick nick2,$newnick,32)) { part #channel } } 
alias check4nicks { if (nick ison $1) || (nick2 ison $1) { part $1 } }

Comments

Sign in to comment.
CraZy_KiLLaH   -  Dec 27, 2010

same nick but different hostmasks :D

But nice

 Respond  
Cheiron   -  Jul 25, 2010

Script updated to a much cleaner, better coded version

 Respond  
Cheiron   -  Jan 26, 2010

out of interest .... you HAVE got the other bot names on your notify list havent you??
it wont work if the nicks are not on notify.. my version

 Respond  
Flux   -  Jan 13, 2010

if may Main BOT is join in 3 channels..like #cssource #mod #sot.. the 2 BOT must be join in 3 Channels too??? same like main BOT channels??

 Respond  
Flux   -  Jan 13, 2010

may Owner of channel is name ~Jairas
and my Bots are BOB & Jay

but, its not working sir.. huhu..i like this 24/7 may Bot.. but..hmm..

@Jethro, yea will try it. ^^ty.

 Respond  
Jethro   -  Jan 12, 2010

Flux, rather than doing:> if ( ( $nick == ) || ( $nick == ) ) {
part #cssource
part #mod
part #sotyou can do:

if ($istok(bob jay,$nick,32)) {
part #cssource,#mod,#sot

Same for the join #cssource,#mod,#sot

 Respond  
Flux   -  Jan 12, 2010

is this correct???

on :JOIN:#source:{
if ( ( $nick == ) || ( $nick == ) ) {
part #cssource
part #mod
part #sot
}
}
on
:UNOTIFY:{
if ( ( $nick == ) || ( $nick == ) ) {
if ( ( $notify().ison == $false ) && ( $notify().ison == $false ) ) {
join #cssource
join #mod
join #sot
}
}
}

 Respond  
Flux   -  Jan 12, 2010

can u post it here your screenshot sir..:)

 Respond  
MatthewsTech   -  Jan 09, 2010

It's for places like EFNet with no registration services.

 Respond  
PuNkTuReD   -  Sep 19, 2008

you could use a while loop to make it join channels from a txt file
that way it could "protect" as many channels as you like.
awesome script, this bot could be exanded greatly and i hope you do.
i liike.

you could maybe even get into putting this into sockets.

 Respond  
Cheiron   -  Feb 25, 2008

you gots it El lol... it just ensures that there is always one bot in channel at all times that runs the main control scripts for that channel.. thanks for the rating and hope you found it an unusual but useful snippet :)

 Respond  
EL   -  Feb 25, 2008

Hmm i like it finally got around to using it actualy.i have mine set up pretty simple i only have one server security bot so its easy.The \"Sleeper\" bot idles in one of my channels(prolly make this random soon),Just like its supossed if its notified that my main bot went off line,its changes nicks(gains admin at this point),joins all the channels that the main bot was in then ops it self an takes over the main bots security duties,being its just 2 mIRC applications i just use the same scripts an upadate when needed so all the protections an data remain the same,altho the only thing i really loose is the hash data,which i dont hav to i could relay all data to the Sleeper as my main bot works all day so i wont loose anything.I\'d actually like to expand on the idea further,since ppl will be looking to target the sleeper bot i actually like to haev the Sleeper auto disonnect change Indent an Fullname an even change to a proxy(list of about 10 working that would be on my exempt list on the main bot to get past it),Then reconnect an be anonomous again,prolly add anty idle along with some other things.Sorry gon off on rant there its a good idea tho,the reation time is a bit slower then lets say a on connect notice ora quit notice but then again the Sleeper doesnt hav to be in the same room or see notices to activate so it can be anonumous still so i ll deal with the reaction time.Ah also i changed theSleeper to -admin on connection notice of the main bot returning then join a certain channel an change to a random nick name.This way no trace about the only ppl know that it exists are the ppl seeing the indent/host then they can target it after that but all attacks to the sleeper whiles its not active i will relay to the main bot an hav the main bot protect the Sleeper.Yeah im just gettin silly i know lol there more but i ll spare you XD\"Rate it or Hate it?\"....7/10.Good work nice idea.`-.-

 Respond  
Noutrious   -  Feb 08, 2008

Nothing so special about that all - just /help $gettok and stuff, you will learn fast.
I have a way to learn too, because here is a one stupid mistake:
:again
and
.goto again
isn\'t needed in while (), i figured that out yesterday - so i have been eating a little bit more bytes of resources at my scripts than needed!

 Respond  
Cheiron   -  Feb 03, 2008

i will have to be totally honest here Noutrious and admit you have me totally lost there heh.. that level of scripting still eludes my grasp of understanding at the moment. i am finding it hard going learning :(

i appreciate the feedback though as it is encouraging. many thanks :))

 Respond  
Noutrious   -  Feb 03, 2008

Ahh, yeah - sorry a bit mistake in getbots aliases:
.inc %num should be .inc %n
and
if ($gettok(%botnicks,%num,44) = $1) { return 1 }
should be
if ($gettok(%botnicks,%n,44) = $1) { return 1 }

Sorry, my bad :)

 Respond  
Noutrious   -  Feb 03, 2008

Yeah, the idea is nice, but you could make it simpler for the clients, somehow, for example:

alias -l getbots {
.var %botnicks = Bob,Tom,Sally
.var %n = 0
.var %num = $numtok(%botnicks,44)
:again
while (%n < %num) {
.inc %num
if ($gettok(%botnicks,%num,44) = $1) { return 1 }
.goto again
}
}

And now all you have to do is:
Replace:

  if ( ( $nick == <nick1> ) || ( $nick == <nick2> ) ) {
    if ( ( $notify(<nick1>).ison == $false ) && ( $notify(<nick2>).ison == $false ) ) {

With:

 if ($getbots($nick) = 1) && (!$notify($nick).ison) {

And replace:

  if ( ( $nick == <nick1> ) || ( $nick == <nick2> ) ) {

With:

if ($getbots($nick) = 1) {

This makes it user-friendlier and a little bit more professional :)

 Respond  
Cheiron   -  Feb 02, 2008

no.. sorry if i didnt explain it better. i have a bot, as do 2 of my ops. the bot runs 3 channel\'s control scripts etc. all bots are online but only one of them are in the channels. the others are sat in the \"hallway\" as it were idling. if the master bot goes offline, the script on each of the bots checks to see.. A - which of the other 2 bots are online, and if none are in channels, it will auto join them. if any of the other bots come on and in channel, then it will auto leave them. for example....

Bob, Tom, and Sally.

Bob runs the master bot. tom and sally have the \"backup bots\". If bob\'s goes offline then each of tom\'s and sally\'s bots will get the message via unotify and try to join the channels that bob\'s was in. however.. if one of the other bots are there already, it will not join. on the same note. if it joins the channels and bob\'s comes back on line and into the channels, it will leave them and go back to standby.

i hope that makes a bit more sense. if not let me know and i will try and simplify it a bit more for you

 Respond  
Tankgeneral   -  Feb 02, 2008

this keeps bot 24 hours online when you log off from mirc?

 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.