mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2007
Posts: 60
M
maconga Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Apr 2007
Posts: 60
I am in a channel with a !trivia bot called "Wallfly[BZZZ]" that is run by a different person. The !trivia bot is in the channel almost all the time, but disconnects for various reasons every once in a while. Could it be possible to have a script set to enable my !trivia bot while the main trivia bot is disconnected, and if the main trivia bot "Wallfly[BZZZ]" rejoins, my !trivia bot will auto disable.

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
A basic set of events would look like this:
Code:
on *:QUIT: if ($nick == Wallfly[BZZZ]) enablescriptcommand
on *:PART:#channelname: if ($nick == Wallfly[BZZZ]) enablescriptcommand
on *:KICK:#channelname: if ($knick == Wallfly[BZZZ]) enablescriptcommand

on *:JOIN:#channelname: if ($nick == Wallfly[BZZZ]) disablescriptcommand

Perhaps it's better to use $address($nick,n) (see /help $mask for a list of n-values) though instead of $nick since the bot's nick can change.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Why not use an alias for enablescriptcommand instead of writing it for every event?

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Originally Posted By: Tomao
Why not use an alias for enablescriptcommand instead of writing it for every event?

The command could simply be (read: often is) an alias itself.

Joined: Apr 2007
Posts: 60
M
maconga Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Apr 2007
Posts: 60
5618,

Thanks you. your script works perfectly, is it possible to make it irc server specific also ?

Last edited by maconga; 06/01/10 06:23 PM.
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Originally Posted By: maconga
is it possible to make it irc server specific also ?
Code:
on *:QUIT:$iif($nick == Wallfly[BZZZ] && $server == irc.yourserver.com,enablescriptcommand)
on *:PART:#channelname:$iif($nick == Wallfly[BZZZ] && $server == irc.yourserver.com,enablescriptcommand)
on *:KICK:#channelname:$iif($knick == Wallfly[BZZZ] && $server == irc.yourserver.com,enablescriptcommand)
on *:JOIN:#channelname:$iif($nick == Wallfly[BZZZ] && $server == irc.yourserver.com,disablescriptcommand)
Just change server name to your actual one.

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Just an untested idea.

Code:
on *:QUIT:dis_en $nick .enable
on *:PART:#channelname:dis_en $nick .enable
on *:KICK:#channelname:dis_en $knick .enable
on *:JOIN:#channelname:dis_en $nick .disable

alias dis_en {
  if ($readini(dis_en.ini,Nicks,$1)) $2 #group
}

menu nicklist {
  Dis_En Able
  $iif($readini(dis_en.ini,Nicks,$$1),Remove,Add) $$1:{ $iif($readini(dis_en.ini,Nicks,$$1),remini,writeini) dis_en.ini Nicks $$1 $true }
  -
}


Link Copied to Clipboard