Moderator: MacroQuest Developers

Code: Select all
Sub CustomQuote(string thename, int specific, int chattype)
:wait
/if (${QuoteChatDelay}) /goto :wait
/declare amtofquotes int local ${Ini[CustomQuotes.ini,Custom,-1,NO].Left[-1].Count[|]}
/declare number int local 0
:reroll
/varcalc number ${Math.Rand[${amtofquotes}]} + 1
/if (${specific}) /varset number ${specific}
/if (${String[${Ini[CustomQuotes.ini,Custom,${number}]}].Equal[NULL]}) {
/if (${specific}) {
/if (${chattype} == 1) /gu Invalid or Blank Quote! (#${number})
/if (${chattype} == 2) /tell ${thename} Invalid or Blank Quote! (#${number})
/return
} else {
/goto :reroll
}
}
/echo Quote Spew! ${chattype}
/if (${chattype} == 1) /gu #${number}: ${Ini[CustomQuotes.ini,Custom,${number}]}
/if (${chattype} == 2) /tell ${thename} #${number}: ${Ini[CustomQuotes.ini,Custom,${number}]}
/varset QuoteChatDelay 3s
/return