So, I have this script that is supposed to work, but doesn't.
Larger size
Does anyone know why?
Last edited by TVflea (2011-11-06 01:55:25)
Offline
You don't set No. back to 0. You are basically making No. stay what it is when Reset is broadcasted. That is a pretty advanced script, though.
I don't know if I'm right. I almost never use super-complicated scripts.
Offline
TVflea wrote:
So, I have this script that is supposed to work, but doesn't.
http://www.freeimagehosting.net/t/27dea.gif
Larger size
Does anyone know why?
I think you need to set No. To 1
Otherwise you are trying to read item 0 of a list
Offline
The problem, I believe, is in the 'repeat until' blocks.
"No" seems to be a number variable (always set to numbers, and increased by one each time).
However, in the 'repeat until' blocks, you are asking whether "No" (let's say, the number 3) is equal to the value of the last item in the list (for example, "What's up").
In this case, 3 is not equal to "What's up". Try, instead of "item last of list", using "length of list".
Offline
I'm pretty sure you can put just move the "<change [No.] by (1) >" in the beginning of the loop, and eliminate the "reset" broadcast. Since all that does is restart your search, you could just set No. to zero again. Also, if I'm reading what you want to do right, you don't want "repeat until No. == last item of list". You want "repeat until No. == length of list
Repeat Until( No. == length of [list] ) { change No. by 1 if( item (No.) of [list] == answer ) { ask (item [No. + 1] ) and wait set [No.] to ( 0 ) } }
Last edited by MoreGamesNow (2011-11-06 08:20:24)
Offline