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.

KAOS multiple asnwers trivia by MArky

Help for those learning Tcl or writing their own scripts.
Post Reply
O
Ozhak
Voice
Posts: 7
Joined: Thu Nov 30, 2006 10:10 pm
Location: Manchester, UK

KAOS multiple asnwers trivia by MArky

Post by Ozhak »

I have problem with malformed question
#
# Parse Question
#
proc KAOSParseQuestion {QNum} {
global KAOSMarker KAOSQuestions KAOSQuestion KAOSAnswers KAOSAnswerCount KAOSForcedQuestion KDebug

set KAnswersLeft ""

if {$QNum < 0} {
set KAOSFileQuestion $KAOSForcedQuestion
} {
set KAOSFileQuestion $KAOSQuestions($QNum)
}

if {$KDebug > 1} {kaoslog "kaos" "Picked:$QNum Question:$KAOSFileQuestion"}

if [info exists KAOSAnswers] {unset KAOSAnswers}

# Position of first "*"

set KAOSMarkerIDX [string first $KAOSMarker $KAOSFileQuestion]

if {$KAOSMarkerIDX < 1} {
kaoslog "KAOS" "Malformed Question #$QNum"
}

set KAOSQuestionEndIDX [expr $KAOSMarkerIDX - 1]

set KAOSQuestion [string range $KAOSFileQuestion 0 $KAOSQuestionEndIDX]

I have tried several ways to solve this but the problem still persists. When I run this script and the problem occurs, the bot will ask a blank question and we have to type '!' to answer the question. I already check the question file and I cant find anything wrong, so I think it shud be on scripting code.
Many thanks
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

READ: http://forum.egghelp.org/viewtopic.php?t=10215

FORMAT your code and post the error msgs as instructed in the above page.
Post Reply