Code:
Name: 'Parrot Array Example', VNum: [ 46], RNum: [ 46]
Trigger Intended Assignment: Mobiles
Trigger Type: Speech , Numeric Arg: 100, Arg list: *
Commands:
* By Meyekul of The Builder Academy tbamud.com 9091
* Squak for the nice people, Polly
wait 1 s
emote squawks loudly.
wait 1 s
* 75% chance of learning phrase.
eval polly %random.4%
if %polly% > 1
* Ignore if already known
switch %speech%
case %phrase(1)%
case %phrase(2)%
case %phrase(3)%
case %phrase(4)%
case %phrase(5)%
case %phrase(6)%
case %phrase(7)%
case %phrase(8)%
case %phrase(9)%
case %phrase(10)%
emote looks at you curiously.
break
default
eval say %%phrase(%random.%%number%%)%)%%
emote squawks, %say%
break
done
* Learn new phrases
eval number (%number% + 1)
eval phrase(%number%) %speech%
global number
global phrase(%number%)
* Reset array after 10 phrases
if %number% == 10
eval number 0
global number
eval maxphrases 1
global maxphrases
end
end
for TBA.