The logic of the script is that when a user says !q 1 or !q 2 or !q 23. Is that it would pull the quote from the ini file and display it in the chat.
After that it would then randomly select a number 1-2 or 1-3 or 1-4. Depending on how may audio files are tied to that quote.
For instance. Quote 1. Has two quote audio files tied. Quote 2 has 4. So the randomly selected audio quote file would play along with the quote being stated in chat.
Now that is covered. Your solution worked perfectly once I figured out the understanding of the array variable and $gettok.
My %listforrand is now 68 characters long for all 68 quotes that have audio files with them. After work I will post the working solution.
I do understand the listforrand portion now. This would work with the existing code from my first post. Meaning that if $2=1 then the listforrand would be 2. Also if $2=2 then the listforrand would be 4. Based on the usage of the $gettok.
;if $2=1 then it would be quote listforrand 2
;if $2=2 then it would be quote listforrand 4
;if $2=3 then it would be quote listforrand 3
;if $2=4 then it would be quote listforrand 2
var %listforrand 2 4 3 2
var %qr1 $rand(1,$gettok(%listforrand,$2,32))
;if $2=1 then the result would be 1 or 2 for %qr1
splay %soundquotes $+ q $+ $2 $+ - $+ %qr1 $+ .mp3
;this would play q1-1.mp3 or q1-2.mp3 if $2=1
I do have some more script portions that I would love help on optimizing if possible. Though I am unsure if I should continue with this thread or create another thread. Since they are the same thing.