| View previous topic :: View next topic |
| Author |
Message |
Thanhas Op

Joined: 02 Sep 2006 Posts: 124 Location: Ottawa, Canada
|
Posted: Tue Sep 19, 2006 7:38 am Post subject: moxquizz |
|
|
| Code: |
-----------------------------
[b]# mini funstuff
bind pub - !hi moxquiz_pub_hi
bind ctcp - action moxquiz_purr[/b]
------------------------------
# say Hi to "known" users
proc moxquiz_purr {nick host handle channel action arg} {
global quizconf allstarsarray
# [pending] translate this
set tlist [list "purrs." \
"meows." \
"happily hops around."]
if {$action == "ACTION" && arg == "pats $botnick" &&
[mx_str_ieq $channel $quizconf(quizchannel)] &&
([validuser $handle] || [info exists allstarsarray($nick)]) } {
mxirc_action $quizconf(quizchannel) [lindex $tlist [rand [llength $tlist]]]
}
}
|
Errer is on action when someone type /me anything the BOT in has DCC type
Tcl error [moxquiz_purr]: syntax error in expression "$action == "ACTION" && arg == "pats $botnick" &&
i hope someone will find the reason of Errer i try my best on it
regards |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Tue Sep 19, 2006 8:26 am Post subject: |
|
|
Your missing the $ before arg:
| Code: | | if {$action == "ACTION" && $arg == "pats $botnick" && [mx_str_ieq $channel $quizconf(quizchannel)] && ([validuser $handle] || [info exists allstarsarray($nick)]) } { |
_________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Tue Sep 19, 2006 10:52 am Post subject: |
|
|
the problem is afaik mainly the unescaped newline. I bypassed by simply putting it into one line:
| Code: | if {$action == "ACTION" && $arg == "pats $botnick" && [mx_str_ieq $channel $quizconf(quizchannel)] && ([validuser $handle] || [info exists allstarsarray($nick)]) } {
mxirc_action $quizconf(quizchannel) [lindex $tlist [rand [llength $tlist]]]
} |
PS: I sent in this fix more than a year ago to the creator... but either email failed or he nolonger responds to them . _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
Thanhas Op

Joined: 02 Sep 2006 Posts: 124 Location: Ottawa, Canada
|
Posted: Tue Sep 19, 2006 1:17 pm Post subject: Thanks |
|
|
Thanks it works thanks alot
Regards |
|
| Back to top |
|
 |
Thanhas Op

Joined: 02 Sep 2006 Posts: 124 Location: Ottawa, Canada
|
Posted: Thu Sep 21, 2006 4:23 am Post subject: heay |
|
|
it was fine but suddenly i see this Errer 2 don't know where shuold i FIND the prob.,.,.,.,.,
Errer
-------------------------------------------------------------------
Tcl error [moxquiz_purr]: can't read "botnick": no such variable
--------------------------------------------------------------------
| Quote: |
## Version:
set version_moxquizz "0.8.1"
package require msgcat
namespace import -force msgcat::*
###########################################################################
##
## ATTENTION:
##
## Defaults for bot configuration. Don't edit here, edit the file
## moxquizz.rc instead!
##
###########################################################################
# system stuff
variable quizbasedir moxquizz
variable datadir $quizbasedir/quizdata
variable configfile $quizbasedir/moxquizz.rc
variable intldir $quizbasedir/intl
variable rankfile $datadir/rank.data
variable allstarsfile $datadir/rankallstars.data
variable statsfile $datadir/stats.data
variable userqfile $datadir/questions.user.new
variable commentsfile $datadir/comments.txt
variable quizhelp
# these will be searched in $intldir/$quizconf(language)
variable channeltipfile channeltips.txt
variable channelrulesfile channelrules.txt
variable pricesfile prices.txt
variable helpfile help.txt
|
what am i do ? |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Thu Sep 21, 2006 5:16 am Post subject: |
|
|
Add:
After the: | Quote: | | global quizconf allstarsarray | line _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
Thanhas Op

Joined: 02 Sep 2006 Posts: 124 Location: Ottawa, Canada
|
Posted: Thu Sep 21, 2006 5:31 am Post subject: i don't know why i can' |
|
|
| i don't know why its not pasting all ? |
|
| Back to top |
|
 |
Thanhas Op

Joined: 02 Sep 2006 Posts: 124 Location: Ottawa, Canada
|
Posted: Thu Sep 21, 2006 5:42 am Post subject: sorry |
|
|
| Quote: |
# say Hi to "known" users
proc moxquiz_purr {nick host handle channel action arg} {
global quizconf allstarsarray
global botnick
# [pending] translate this
set tlist [list "purrs." \
"meows." \
"happily hops around."]
if {$action == "ACTION" && $arg == "pats $botnick" &&
[mx_str_ieq $channel $quizconf(quizchannel)] &&
([validuser $handle] || [info exists allstarsarray($nick)]) } {
mxirc_action $quizconf(quizchannel) [lindex $tlist [rand [llength $tlist]]]
}
}
|
|
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Thu Sep 21, 2006 8:55 pm Post subject: |
|
|
You do not edit any Tcl file you edit the .rc file as per instructions.
| Quote: | ## Defaults for bot configuration. Don't edit here, edit the file
## moxquizz.rc instead! |
_________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
|