| View previous topic :: View next topic |
| Author |
Message |
Zorb Voice
Joined: 17 Oct 2006 Posts: 22
|
Posted: Wed Jul 18, 2007 11:56 am Post subject: 20 bots want 1 to respond |
|
|
I have X amount of bots in a certain channel, when someone types a command I want only one to respond.
I've tried a few ways of going about this, and thought of a few to, I'll try them when I wake up as it's 1:30am as I'm writing.
Any suggested ways of doing this? |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Wed Jul 18, 2007 2:01 pm Post subject: Re: 20 bots want 1 to respond |
|
|
| daone wrote: | I have X amount of bots in a certain channel, when someone types a command I want only one to respond.
I've tried a few ways of going about this, and thought of a few to, I'll try them when I wake up as it's 1:30am as I'm writing.
Any suggested ways of doing this? |
put public command scripts only on one bot |
|
| Back to top |
|
 |
Zorb Voice
Joined: 17 Oct 2006 Posts: 22
|
Posted: Wed Jul 18, 2007 7:42 pm Post subject: |
|
|
| To be honest that is just silly. The bots are in more than one channel.. Hand I want one of them for only one bot to respond. |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Wed Jul 18, 2007 7:51 pm Post subject: |
|
|
The particular script doesn't have a setting to enable/disable in particular channels? _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
Zorb Voice
Joined: 17 Oct 2006 Posts: 22
|
Posted: Wed Jul 18, 2007 7:54 pm Post subject: |
|
|
Well, this is what I'm trying to do.
I was thinking.
| Code: | | if {$chan == #thechan && $botnick != TheMainBot} { return 0 } REST OF SCRIPT HERE |
Would that work? |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Wed Jul 18, 2007 8:23 pm Post subject: |
|
|
You can use something like:
| Code: |
#Set your trigger commands here
set pubtrigger(1) "command1"
set pubtrigger(2) "command2"
set pubtrigger(3) "command3"
bind pub - "!$botnick" pub:proc
proc pub:proc {nick uhost hand chan text} {
if {[string equal -nocase $::pubtrigger(1) [lindex [split $text] 0]]} {
#do whatever you want here for command1
} elseif {[string equal -nocase $::pubtrigger(2) [lindex [split $text] 0]]} {
#do whatever you want here for command2
} elseif {[string equal -nocase $::pubtrigger(3) [lindex [split $text] 0]]} {
#do whatever you want here for command3
}
}
|
This code can be put into all bots and it will activate when you type:
| Quote: |
!<botnick> command1
!<botnick> command2
!<botnick> command3
|
The command can be anything say like "msg", "act", "notc", "op", "deop", "cycle" and etc for each and every one of your different bots, with different botnicks. Well this is the simplest way to do it. _________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
Zorb Voice
Joined: 17 Oct 2006 Posts: 22
|
Posted: Wed Jul 18, 2007 8:57 pm Post subject: |
|
|
Not sure I made myself clear enough..
I mean I have say 5 bots on one channel. If I type !omg I only want one to respond ONLY in THAT channel.
Any other channels I won't have more than one bot in them. |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Wed Jul 18, 2007 9:02 pm Post subject: |
|
|
Well then thats an easy case now isn't it? I suppose your bots might not be linked so, in that case, you add this script in the bot which you want ONLY to respond.
I think that is clear enough and common sense, because the ones without it, obviously won't respond to the public trigger. For this:
| Quote: |
I mean I have say 5 bots on one channel. If I type !omg I only want one to respond ONLY in THAT channel.
|
Use this:
| Code: |
bind pub - "!omg" pub:proc
proc pub:proc {nick uhost hand chan text} {
putserv "PRIVMSG $chan :your_shit_here"
}
|
_________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
Zorb Voice
Joined: 17 Oct 2006 Posts: 22
|
Posted: Wed Jul 18, 2007 9:15 pm Post subject: |
|
|
Uhh. Nobody gets it...
I have 5 bots in a channel and I want ONLY ONE to respond to anything that I do, public or notice. Each bot has the same commands. And all respond to the same command. They all run off the same script if that helps.
I was thinking something like this at the start of a proc, to make the main bot reply only.
| Code: | | if {$chan == #MainChannel && $botnick != MainBot} { return 0 } REST OF SCRIPT HERE |
Meaning if the chan equals MainChannel and the bots nickname is not equal to MainBot halt the script. Otherwhise if bots nickname does equal MainBot and channel equals #MainChannel continue with the script. |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Wed Jul 18, 2007 10:15 pm Post subject: |
|
|
| daone wrote: | Uhh. Nobody gets it...
I have 5 bots in a channel and I want ONLY ONE to respond to anything that I do, public or notice. Each bot has the same commands. And all respond to the same command. They all run off the same script if that helps.
I was thinking something like this at the start of a proc, to make the main bot reply only.
| Code: | | if {$chan == #MainChannel && $botnick != MainBot} { return 0 } REST OF SCRIPT HERE |
Meaning if the chan equals MainChannel and the bots nickname is not equal to MainBot halt the script. Otherwhise if bots nickname does equal MainBot and channel equals #MainChannel continue with the script. |
If you are so keen in using this code, then use it correctly:
| Code: |
if {[string equal -nocase "#mainchannel" $chan] && ![isbotnick "MainBot"]} { return 0 }
###OR##
if {[string equal -nocase "#mainchannel" $chan] && ![string equal -nocase $::botnick "mainbot"]} { return 0 }
|
_________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
Zorb Voice
Joined: 17 Oct 2006 Posts: 22
|
Posted: Wed Jul 18, 2007 10:32 pm Post subject: |
|
|
| Ah never mind I figured it out before you posted. Thank anyway. |
|
| Back to top |
|
 |
|