Botserv Possesion version 2.1

By TMFKSOFT on Dec 25, 2011

This is version two of my old script. Just right click! This version allows seperate channels so you cna resume normal chatting in other channels while controling a bot in one channel.

Of course this allows mutliple channel bot control!

Make sure there is a bot assigned to the channel and that you have access! Rightclick -> "Botserv Possesor" -> "posses #channel's bot"

To unposses repeat the same step but the text will read "unposses #channel's bot".

Have fun!

This script uses my tools I scripted earlier last month :D

Updated to v2.1: Added a fix provided by Savage_CL and it only works with Anope currently. :|

EXTRA Juicy code:

If you would like to make scripts work through botserv then simply add this in:

; This code is nice for bots ;) ; CAUTION: This code is buggy and may break. Remove it if you experience problems.

alias msg { ; Rewrites other scripts to go through botserv if ($getvar($network,$chan,possessed) == 1) {

raw -q privmsg botserv :say $1-
HALT

} } alias describe { ; Rewrites other scripts to go through botserv if ($getvar($network.$chan,possessed) == 1) {

raw -q privmsg botserv :act $1-
HALT

} }

; Botserv Possessor Version 2
; ( Was named Chanserv Possesor )
; This uses the TMFKSOFT Coder Tools http://www.hawkee.com/snippet/9172/
; By Thomas Edwards (TMFKSOFT) 2011

; Simply right click and select "Possess bot on #channel" or "Unpossess bot on #channel"
; Yes, it is now channel specific 

menu channel {
  BotServ Possessor
  . $iif($getvar($network,$chan,possessed) == 1,Unpossess,Possess) $chan $+ 's bot:/possess
}
alias -l possess {
  if ($getvar($network,$chan,possessed) == 1) {
    echo 4[BotServ Possessor] You no longer possess $chan $+ 's bot.
    away
    unsetvar $network $chan possessed
  }
  else {
    if ($me isop $chan) {
      echo 4[BotServ Possessor] You now possess $chan $+ 's bot.
      away I am possesing the bot on $chan via http://www.hawkee.com/snippet/9251/
      setvar $network $chan possessed 1
    }
    else {
      echo 4[BotServ Possessor] Operator or above is required to possess $chan $+ s bot.
    }  
  }
}
on 1:input:#:{
  if ($getvar($network,$chan,possessed) == 1) {
    if ($1 == /me) {
      raw -q privmsg botserv :act $chan $2-
      HALT
    }
    else if ($1 == /topic) {
      raw -q privmsg chanserv :topic $chan $2-
      HALT
    }
    else if ( isin $1) {
      raw -q privmsg botserv :say $1-
      HALT
    }
    else if ($left($1,1) == /) {
      $1-
      HALT
    }
    else {
      raw -q privmsg botserv :say $chan $1-
      HALT
    }
  }
}

alias setvar {
  set % $+ $1 $+ . $+ $2 $+ . $+ $3 $4-
}
alias getvar {
  return % [ $+ [ $1 ] $+ . $+ [ $2 ] $+ . $+ [ $3 ] ]
}
alias unsetvar {
  unset % $+ $1 $+ . $+ $2 $+ . $+ $3
}
Sign in to comment.
TMFKSOFT   -  Mar 31, 2012

Added your Fix Savage :) Thanks for liking :P

 Respond  
Savage_CL   -  Dec 30, 2011
; Botserv Possessor Version 2
; ( Was named Chanserv Possesor )
; This uses the TMFKSOFT Coder Tools http://www.hawkee.com/snippet/9172/
; By Thomas Edwards (TMFKSOFT) 2011

; Simply right click and select "Possess bot on #channel" or "Unpossess bot on #channel"
; Yes, it is now channel specific 

menu channel {
  BotServ Possessor
  . $iif($getvar($network,$chan,possessed) == 1,Unpossess,Possess) $chan $+ 's bot:/possess
}
alias -l possess {
  if ($getvar($network,$chan,possessed) == 1) {
    echo 4[BotServ Possessor] You no longer possess $chan $+ 's bot.
    away
    unsetvar $network $chan possessed
  }
  else {
    if ($me isop $chan) {
      echo 4[BotServ Possessor] You now possess $chan $+ 's bot.
      away I am possesing the bot on $chan via http://www.hawkee.com/snippet/9251/
      setvar $network $chan possessed 1
    }
    else {
      echo 4[BotServ Possessor] Operator or above is required to possess $chan $+ s bot.
    }  
  }
}
on 1:input:#:{
  if ($getvar($network,$chan,possessed) == 1) {
    if ($1 == /me) {
      raw -q privmsg botserv :act $chan $2-
      HALT
    }
    else if ($1 == /topic) {
      raw -q privmsg chanserv :topic $chan $2-
      HALT
    }
    else if ( isin $1) {
      raw -q privmsg botserv :say $1-
      HALT
    }
    else if ($left($1,1) == /) {
      $1-
      HALT
    }
    else {
      raw -q privmsg botserv :say $chan $1-
      HALT
    }
  }
}

alias setvar {
  set % $+ $1 $+ . $+ $2 $+ . $+ $3 $4-
}
alias getvar {
  return % [ $+ [ $1 ] $+ . $+ [ $2 ] $+ . $+ [ $3 ] ]
}
alias unsetvar {
  unset % $+ $1 $+ . $+ $2 $+ . $+ $3
}

Adapted for a multi-network situation in which you might be in #chan on two different networks.

Good script

Cheers :)

 Respond  
PyThOn   -  Dec 28, 2011

Thanks, it does.

 Respond  
TMFKSOFT   -  Dec 27, 2011
 Respond  
PyThOn   -  Dec 26, 2011

Can you add a screen shot?

 Respond  
Fuzionx   -  Dec 26, 2011

You can use 'elseif' instead of 'else if' at the on :input: part. And I don't believe there is need for a HALT every time.

 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.