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.

Only one bot responds

Help for those learning Tcl or writing their own scripts.
Post Reply
j
juanamores
Master
Posts: 317
Joined: Sun Mar 15, 2015 9:59 am

Only one bot responds

Post by juanamores »

I have 2 BOTs on my channel having the same TCL.
Until a few days ago both BOTs responded the same commands .
Today just one answers me.
What can be changed?

This only happens with this Tcl:

Code: Select all

bind pub n|n !restart restart_bot
bind pub n|n !rehash rehash_bot
bind pub n|n !reload reload_bot
bind pub nt|n !quits quit_bot

proc restart_bot {nick uhost hand chan text} {
global channel_admin
   if { $chan != $channel_admin} { return 0 }
    putserv "PRIVMSG $chan :Ok, restart...."
putlog "\002RESTART\002 requested by $nick"
utimer 1 restart
}

proc rehash_bot {nick uhost hand chan text} {
global channel_admin
 if { $chan != channel_admin} { return 0 }
     putserv "PRIVMSG $chan :Ok, rehash...."
putlog "\002Rehash\002 requested by $nick"
utimer 1 rehash
}
proc reload_bot {nick uhost hand chan text} {
global channel_admin
   if { $chan != $channel_admin} { return 0 }
   putserv "PRIVMSG $chan :Ok, reload...."
putlog "\002Reload\002 requested by $nick"
utimer 1 reload
}

proc quit_bot {nick uhost hand chan text} {
global channel_admin
   if { $chan != $channel_admin} { return 0 }
   putserv "PRIVMSG $chan :Ok, quit...."
putlog "\002QUIT\002 requested by $nick"
die "good bye!"
}
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks :)
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

There are 3 options:

1. You don't have the right access (flags).
2. You issue the command on another channel than what is defined by channel_admin
3. This piece of code:

Code: Select all

if { $chan != $channel_admin} { return 0 } 
meaning let's say that channel_admin is defined to be #admin but the server tells the bot he is on #ADMIN channel then that comparison fails.

How to find the culprit?

1. From DCC Chat/Telnet with the bot do a .channel #channel_admin and see with what user name it sees you then do a .whois on that name and see if you have the required flags

2. Check the channel_admin variable and make sure you are on the same channel.

3. You better change that line with:

Code: Select all

if {![string equal -nocase $chan $channel_admin} return
I honestly suspect it's the 3rd option. :)
Once the game is over, the king and the pawn go back in the same box.
j
juanamores
Master
Posts: 317
Joined: Sun Mar 15, 2015 9:59 am

Post by juanamores »

It is rare , but I saw what the problem was .
The BoT is not taking my virtual host.
It must be a network problem, I will consult...

The bot takes a random virtual ip given by the Network .
If I performed a /whois I see my virtual Ip (registered host by the Network), but the bot takes:
(Rxm@BeL8IV.BARG4B.virtual) :roll:

EDIT: I was told the network that may have been a momentary desynchronization and it was solved. :D
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks :)
Post Reply