| View previous topic :: View next topic |
| Author |
Message |
mrNobody Voice
Joined: 02 Dec 2013 Posts: 14
|
Posted: Thu Dec 19, 2013 9:38 am Post subject: Script executes on one bot but not on the other |
|
|
Hi all,
I wrote a very simple script to set a mode to my channels. I have a production bot and a testbot on the same network. The testbot runs the script without any problems, but the production bot doesn't trigger it at all. I checked with .binds that the command is bound, and with .whois that I have the nescesarry flags.
this is the script:
| Code: |
bind pub (m) !set mcm:set
proc mcm:set {nick host handle chan args} {
set script [lindex [join $args] 0]
set what [lindex [join $args] 1]
if {$what == ""} {
putserv "NOTICE $nick :Error. No settings specified. Use !set <script> <on|off>"
return
} elseif { $what == "on"} {
set what "+"
set notice "enabled"
} else {
set what "-"
set notice "disabled"
}
channel set $chan $what$script
puthelp "PRIVMSG $chan :$script $notice"
}
|
on testbot it runs as it is supposed to.
on productionbot it doesn't even trigger the command.
I'm owner of both bots, the command shows in both .binds commands but it only gets triggered on testbot.
Oh yeah, I also restarted the productionbot, didn't do the trick either. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Dec 19, 2013 12:29 pm Post subject: |
|
|
Give this a try.
| Code: |
bind pub m|m !set mcm:set
proc mcm:set {nick host handle chan text} {
if {[scan $text {%s%s} script mode] != 2} {
puthelp "NOTICE $nick :Error, no settings specified. Use !set <script> <on|off>"
}
catch {channel get $chan $script} err
if {$err!=0} {
puthelp "NOTICE $nick :Error, the $script setting doesn't exist!"
return
}
switch -- [string tolower $mode] {
"on" {
if {[channel get $chan $script]} {
puthelp "NOTICE $nick :Error, the $script setting is already enabled."
} else {
channel set $chan +$script
puthelp "NOTICE $nick :The $script setting has been disabled."
}
}
"off" {
if {![channel get $chan $script]} {
puthelp "NOTICE $nick :Error, the $script setting is already disabled."
} else {
channel set $chan -$script
puthelp "NOTICE $nick :The $script setting has been disabled."
}
}
}
}
|
Haven't tested so load it on test bot and see if it works. Reply back if you got any issues. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
mrNobody Voice
Joined: 02 Dec 2013 Posts: 14
|
Posted: Thu Dec 19, 2013 12:37 pm Post subject: |
|
|
it returns error code 1
//edit:
If I remove the part that catches the error code it works on testbot
//edit2:
If I load it on the production bot, just like my own code, it doesn't execute. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Dec 20, 2013 1:30 am Post subject: |
|
|
What versions of eggdrop and TCL you got there? _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
mrNobody Voice
Joined: 02 Dec 2013 Posts: 14
|
Posted: Fri Dec 20, 2013 5:33 am Post subject: |
|
|
eggdrop 1.6.21, tcl version 8.5.11
It runs on a raspberry pi with debian linux. Both bots run on the same machine with virtually the same config file. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Dec 20, 2013 7:45 am Post subject: |
|
|
Where do you see that error code 1? _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
mrNobody Voice
Joined: 02 Dec 2013 Posts: 14
|
Posted: Fri Dec 20, 2013 8:00 am Post subject: |
|
|
| I made it putlog $err |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Dec 20, 2013 10:03 am Post subject: |
|
|
And you don't get any notice from the bot with that error? _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
mrNobody Voice
Joined: 02 Dec 2013 Posts: 14
|
Posted: Fri Dec 20, 2013 2:25 pm Post subject: |
|
|
| no, the bot stays otherwise silent |
|
| Back to top |
|
 |
mrNobody Voice
Joined: 02 Dec 2013 Posts: 14
|
Posted: Sun Dec 22, 2013 9:24 am Post subject: |
|
|
| I found what was causing this problem, apparently my production bot had the wrong hostname for my user, so it didn't trigger the script. updated the hostname and now it works as it should, thanks for your help though! |
|
| Back to top |
|
 |
|