egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

20 bots want 1 to respond

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Zorb
Voice


Joined: 17 Oct 2006
Posts: 22

PostPosted: Wed Jul 18, 2007 11:56 am    Post subject: 20 bots want 1 to respond Reply with quote

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
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Wed Jul 18, 2007 2:01 pm    Post subject: Re: 20 bots want 1 to respond Reply with quote

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
View user's profile Send private message
Zorb
Voice


Joined: 17 Oct 2006
Posts: 22

PostPosted: Wed Jul 18, 2007 7:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Wed Jul 18, 2007 7:51 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Zorb
Voice


Joined: 17 Oct 2006
Posts: 22

PostPosted: Wed Jul 18, 2007 7:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Wed Jul 18, 2007 8:23 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Zorb
Voice


Joined: 17 Oct 2006
Posts: 22

PostPosted: Wed Jul 18, 2007 8:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Wed Jul 18, 2007 9:02 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Zorb
Voice


Joined: 17 Oct 2006
Posts: 22

PostPosted: Wed Jul 18, 2007 9:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Wed Jul 18, 2007 10:15 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Zorb
Voice


Joined: 17 Oct 2006
Posts: 22

PostPosted: Wed Jul 18, 2007 10:32 pm    Post subject: Reply with quote

Ah never mind I figured it out before you posted. Thank anyway.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber