/* WallChop.AMIRX -- Write a message to all channel operators on a channel
\\ written by Oliver Wagner
// UPDATED BY TROY "DOOGIE" DAVIS (DOOGIE@WSP1.WSPICE.COM), WHO IS
\\ TYPING IN ALL CAPS BECAUSE A CERTAIN HACK MUI PROGRAMMER SEEMED
// TO "FORGET" ABOUT HIS CONTRIBUTION.  ;^)
\\
//
\\ Put this script in PROGDIR:rexx/ and add this as an alias with the
// command:  "/alias wallchop /rx wallchop %p"
\\
*/

parse arg args
options results

if args = "" then do
   'echo P='d2c(27)'b«Error» Usage: /RX WALLCHOP text'
   exit
end

ops = ""
getmynick
mynick = RESULT
getchannel
channel = RESULT

namevalid = 0
count = 0
do while namevalid = 0
   getuserstate count
   if rc = 5 then break
   if rc = 1 then do
      getuser count
      nick = RESULT
      ops = ops nick
      'RAW PRIVMSG 'nick' :'d2c(2)'[WallChop/'channel']'d2c(2) ARGS
   end
   count = count + 1
end
'echo P='d2c(27)'b«WallChop» WallChop message sent to:  'strip(ops)
