/* MCF.AMIRX \\ Written by Donald T. Becker (dtbecker@postoffice.ptd.net) IRC: StarDustr // Please mail any bug reports/comments to the above address with a subject \\ header of MCF.AMIRX. // \\ ** What to do with this file? Put this script in REXX: // \\ What else to do with this file... (if not Auto-started by MCF_JOIN.AMIRX) // Put this script in REXX:, connect to an IRC server and type /Rx MCF args \\ where args are: NOOPS/S FSERV/S NOSOUND/S NORCMDS/S GREETS/S */ arg argline OPTIONS RESULTS MCFenv = address() xl = pos(".", MCFenv) + 1 Client = substr(MCFenv, xl) PRO = "PROTECT." || Client CMC = "CMDS." || Client FSC = "FSERV." || Client GRC = "GREETS." || Client OPC = "OPS." || Client OCC = "OPCHAR." || Client OLC = "OPLINE." || Client SoundDir = "Sounds:" /* Directory where sounds are stored */ SoundPlayer = "DH0:C/Play16" /* Name of Player to use for playing sounds */ FSERV.Client = "N" /* AUTO switch for File Server functions */ GREETS.Client = "N" /* AUTO switch for Auto-Greetings */ OPS.Client = "Y" /* AUTO switch for Auto-Ops */ RCMDS.Client = "Y" /* AUTO switch for Remote Commands */ SOUNDS.Client = "Y" /* AUTO switch for CTCP Sounds */ OPCHAR.Client = "@" /* AUTO Operator recognition character */ if 0 ~= pos("NOOPS", argline) then OPS.Client = "N" if 0 ~= pos("FSERV", argline) then FSERV.Client = "Y" if 0 ~= pos("NOSOUND", argline) then SOUNDS.Client = "N" if 0 ~= pos("NORCMDS", argline) then RCMDS.Client = "N" call setclip(FSC, FSERV.Client) call setclip(OPC, OPS.Client) call setclip(GRC, GREETS.Client) call setclip(OCC, OPCHAR.Client) call setclip(MCFenv, "Y") Cname = "MCF:MCF.Cmds" fname = "MCF:MCF.Ops" call RU() call RC() address command "Run >nil: Rx MCF_PROTECT.AMIRX" MCFenv address command WaitForPort PRO "echo P="d2c(27)"««MCF»" "Master Control Functions are now loaded." do forever getline lpos = pos("!", line.prefix) - 1 if lpos < 0 then iterate Unick = substr(line.prefix, 1, lpos) if 0 ~= pos('01'x, line.rest) then do if 0 = pos("PRIVMSG", upper(line.command)) then iterate xx = upper(line.rest) select when 0 ~= pos("ACTION", xx) then iterate when 0 ~= pos("SOUND", xx) then do if SOUNDS.Client = "Y" then address command "Run >nil: Rx MCF_SOUND.AMIRX "MCFenv Unick SoundPlayer SoundDir line.rest iterate end otherwise interpret "address" PRO "line.prefix line.command line.dest line.rest" iterate end end cpos = pos("%", line.rest) if cpos ~= 2 then iterate idata = upper(line.rest) || " " spos = pos(" ", idata) - 2 Rcmd = substr(idata, 2, spos) rpos = pos(Rcmd, CmdLine) if rpos = 0 then iterate Rauth = substr(CmdLine, rpos - 3, 2) auth = "" Rnick = upper(Unick) getmynick MyNick = upper(RESULT) if MyNick = Rnick then auth = 99 if auth = "" then do npos = pos("@", line.prefix) Uname = upper(left(line.prefix, npos)) UIP = upper(substr(line.prefix, npos + 1)) apos = 1 do cauth = 1 by 1 until auth ~= "" upos = pos(Uname, OpLine, apos) if upos = 0 then auth = 00 if auth = "" then do apos = upos + npos + 1 ipos = pos(" ", OpLine, apos) OIP = substr(OpLine, apos, ipos - apos) if 0 ~= pos(OIP, UIP) then auth = substr(OpLine, upos - 3, 2) end end cauth end if auth < Rauth then iterate Rcmd = substr(Rcmd, 2, spos - 1) RxCmd = "say /Rx MCF_" || Rcmd || " " if Rauth = 99 then do interpret "CALL" Rcmd iterate end if RCMDS.Client ~= "Y" then exit if Rauth < 30 then do RxCmd auth Unick line.rest iterate end Dst = upper(line.dest) if 0 ~= pos(":", Dst) then Dst = substr(Dst, 2) if MyNick = Dst then iterate opnick = " " || MyNick || " " channels ChList = upper(result) if ChList = "" | 0 = pos(Dst, ChList) then iterate do chcnt = 1 by 1 until chan.chcnt = Dst parse value ChList with chan.chcnt ChList end chcnt if chcnt = 1 then ChanCntr = "" else ChanCntr = chcnt getusers ChanCntr ChUs = " " || upper(result) || " " opstat = pos(MyNick, ChUs) nostat = pos(opnick, ChUs) if opstat > 0 & nostat > 0 then iterate interpret "call setclip("chan.chcnt", ChUs)" RxCmd MyNick Unick chan.chcnt line.rest end exit AUTO: parse value idata with junk funct opt junk xl = pos(funct, "OPS FSERV GREETS OPCHAR RCMDS SOUNDS") if xl = 0 then return Ifunct = funct || "." || Client interpret Ifunct "= opt" if xl < 17 then interpret "call setclip(Ifunct, "Ifunct")" "echo P="d2c(27)"««MCF»" funct" is now set to "d2c(2)value(Ifunct) return AU: DU: USERS: RxCmd line.rest return OPTS: "echo P="d2c(27)"««MCF»" "FSERV = "FSERV.Client "echo P="d2c(27)"««MCF»" "GREETS = "GREETS.Client "echo P="d2c(27)"««MCF»" "OPS = "OPS.Client "echo P="d2c(27)"««MCF»" "RCMDS = "RCMDS.Client "echo P="d2c(27)"««MCF»" "SOUNDS = "SOUNDS.Client "echo P="d2c(27)"««MCF»" "OPCHAR = "OPCHAR.Client return RC: xx = "" CmdLine = "" call open("Input", Cname, 'R') do until eof("Input") CmdLine = CmdLine xx xx = readln("Input") end call close("Input") CmdLine = CmdLine || " " CmdLine = upper(CmdLine) call setclip(CMC, CmdLine) return RU: xx = "" OpLine = "" call open("Input", fname, 'R') do until eof("Input") OpLine = OpLine xx xx = readln("Input") end call close("Input") OpLine = OpLine || " " OpLine = upper(OpLine) call setclip(OLC, OpLine) return QUIT: "echo P="d2c(27)"««MCF»" "Quitting at the request of"d2c(2) Unick call setclip(CMC, "") call setclip(FSC, "") call setclip(GRC, "") call setclip(MCFenv, "") call setclip(OLC, "") call setclip(OPC, "") interpret "address" PRO '"%QUIT"' exit return