This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

20 bots want 1 to respond

Help for those learning Tcl or writing their own scripts.
Post Reply
Z
Zorb
Voice
Posts: 22
Joined: Tue Oct 17, 2006 8:14 am

20 bots want 1 to respond

Post by Zorb »

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?
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Re: 20 bots want 1 to respond

Post by DragnLord »

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
Z
Zorb
Voice
Posts: 22
Joined: Tue Oct 17, 2006 8:14 am

Post by Zorb »

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.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

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
Z
Zorb
Voice
Posts: 22
Joined: Tue Oct 17, 2006 8:14 am

Post by Zorb »

Well, this is what I'm trying to do.

I was thinking.

Code: Select all

if {$chan == #thechan && $botnick != TheMainBot} { return 0 } REST OF SCRIPT HERE
Would that work?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

You can use something like:

Code: Select all

#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:
!<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.
==================================
Z
Zorb
Voice
Posts: 22
Joined: Tue Oct 17, 2006 8:14 am

Post by Zorb »

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.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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:
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: Select all

bind pub - "!omg" pub:proc

proc pub:proc {nick uhost hand chan text} {
 putserv "PRIVMSG $chan :your_[censored]_here"
}
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Z
Zorb
Voice
Posts: 22
Joined: Tue Oct 17, 2006 8:14 am

Post by Zorb »

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: Select all

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.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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: Select all

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: Select all

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.
==================================
Z
Zorb
Voice
Posts: 22
Joined: Tue Oct 17, 2006 8:14 am

Post by Zorb »

Ah never mind I figured it out before you posted. Thank anyway.
Post Reply