alias donations {
var %one $read(%donateFile,n,1)
echo -a %one
var %two $read(%checkFile,n,1)
echo -a %two
var %name $gettok(%two,1,38)
echo -a %name
var %message $gettok(%two,2,38)
if (%message == $chr(32)) || (%message == $null) || (%message == $chr(38)) {
var %message default
}
echo -a %message
var %donate $gettok(%two,3,38)
echo -a %donate
;This line removes the $ from the dollar amount donated. To work with the system easier.
var %donateamount $mid(%donate,3)
echo -a %donateamount
;This is the problem line.
if (%one isin %two) { return }
;Calls the donation alias to then convert donate amount to whole number and times it by 6 for points to be added to user who donated.
;donation %name %donateamount
;Currently sitting at 15 total
var %soundcodes [BABY] [BANE] [CHCK] [DOOM] [ELCO] [ELTO] [IGBO] [MATI] [MONK] [MOOO] [MORS] [NONO] [PEWP] [TOOT] [BOON] [DINO] [SQUI] [DUKE] [BAYM] [DWDU] [MILI]
var %soundrand 1 3 1 1 1 1 1 4 1 1 1 1 1 1 2 1 1 16 1 1 1
;Sets an incremental variable
var %a 1
while ($gettok(%soundcodes,%a,32) != $null) {
var %v $v1
;echo -a v: %v
if ($istok(%message,%v,32)) {
var %tof $v1
}
if (%v isin %message) {
var %vs $v1
var %vss $mid(%vs,2,4)
;echo -a vss: %vss
;echo -a a: %a
var %vsss %vss $+ $rand(1,$gettok(%soundrand,%a,32))
;echo -a vssstotal: %donateSounds $+ %vsss $+ .mp3
splay %donateSounds $+ %vsss $+ .mp3
;echo -a vsss: %vsss
}
inc %a
}
if (%tof == $null) {
splay %sounds $+ Alerts-Donation-Online.mp3
}
echo -a New Donation: %two
write -c %checkFile %one
}