Code: Select all
| pull.mac - 4 Feb 2005
| Written by: Chill - ini sub borrowed from robdawg
| Usage: /macro pull [g/gu/rs/say/#] (some valid chat channel - group by default)
| Requires: Pull.ini file (see post for format)
Sub Main
/declare chan string outer gsay
/declare nValues int outer 1
/call ReadINI Pull.ini "${Me.Name}" Msg
/if (!${Defined[Msg_Array]}) {
/echo No Messages in ini, ending
/endm
}
/if (${Defined[Param0]}) /varset chan ${Param0}
/echo Randomly saying one of ${nValues} messages in ${chan}
/docommand /${chan} ${Msg_Array[${Math.Calc[${Math.Rand[${nValues}]}+1]}]}
/return
Sub ReadINI(FileName,SectionName,ArrayType)
/if (${Ini[${FileName},${SectionName},-1,NO].Equal[NO]}) {
/echo "${SectionName}" is not a Valid Section for FILE:${FileName}, ending macro...
/delay 1
/return
}
/declare nArray int local 0
/declare KeySet string local ${Ini[${FileName},${SectionName}]}
:CounterLoop
/if (${String[${Ini[${FileName},${SectionName},${ArrayType}${nValues}]}].Equal[null]}) {
/varcalc nValues ${nValues}-1
/goto :MakeArray
}
/varcalc nValues ${nValues}+1
/goto :CounterLoop
:MakeArray
/if (!${nValues}) /return
/declare Msg_Array[${nValues}] string outer
/for nArray 1 to ${nValues}
/varset Msg_Array[${nArray}] ${Ini[${FileName},${SectionName},${ArrayType}${nArray}]}
/next nArray
/delay 1
/return
Code: Select all
[Puller]
Msg1="inc ${Target.CleanName} msg a"
Msg2="inc ${Target.CleanName} msg b"
Msg3="inc ${Target.CleanName} msg c"
Next step is to build a cool ini file.
I'm looking for suggestions if anyone has seen any really cool/funny pull messages lately.
