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.
Old posts that have not been replied to for several years.
nickname
Voice
Posts: 3 Joined: Sun Nov 28, 2004 2:46 am
Post
by nickname » Sun Nov 28, 2004 3:18 am
Can anyone help me pls?
I put the file here
Code: Select all
http://con4n007.freelinuxhost.com/txc.tcl
the scramble works ok,
my problem is, it doesn't recognize the answer...
let's say the answer will be "good"
even though I asnwer "good", it gives no response at all and doesn't increment the score.
can anyone help me pls?
thanks
edit:
there's seperate question called "soal.txt" with {question} {answer} format, line per line
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Sun Nov 28, 2004 3:40 am
there would be a better chance someone can if you paste the problematic code here
YooHoo
Owner
Posts: 939 Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast
Post
by YooHoo » Sun Nov 28, 2004 6:18 am
That script is for the birds. Try the
TCL archives , in the
'Games' section. You might wish to try
nerfbendr's trivia , it has far more potential
nickname
Voice
Posts: 3 Joined: Sun Nov 28, 2004 2:46 am
Post
by nickname » Sun Nov 28, 2004 10:46 pm
this's for set the question and answer
set game(questions) ""
if {[file exists $game(file)]} {
set fileid [open $game(file) r]
while {![eof $fileid]} {
gets $fileid game(temp)
if {$game(temp) != ""} {
lappend game(questions) $game(temp)
}
}
close $fileid
proc xrange {xr xr1 xr2} {
return [join [lrange [split $xr] $xr1 $xr2]]
}
proc xindex {xr xr1} {
return [join [lrange [split $xr] $xr1 $xr1]]
}
this's to show whether the user is correct
foreach game(temp) $game(answers) {
if {((!$game(type)) && ($guess == [string tolower $game(answers)])) || (($game(type) == 1) && ([string match [string tolower $game(temp)] $guess]))} {
if {$game(team)} {
foreach game(temp) [array names game_players] {
if {[lsearch -exact [string tolower $game_players($game(temp))] [string tolower $nick]] != -1} {
incr game_teams($game(temp))
putserv "PRIVMSG $chan :$nick \[team $game(temp)\] is correct! ($guess)"
}
}
}
}
my problem here is the bot doesn't want to tell whether the user is correct answering the question...
nerfbendr's trivia is not free
YooHoo
Owner
Posts: 939 Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast
Post
by YooHoo » Mon Nov 29, 2004 12:21 am
It may not be free, but it's still coded far better than what ya got goin there
nickname
Voice
Posts: 3 Joined: Sun Nov 28, 2004 2:46 am
Post
by nickname » Tue Nov 30, 2004 5:11 am
YooHoo wrote: It may not be free, but it's still coded far better than what ya got goin there
I thought this forum is used to help people that having trouble
not flame other people' code