home *** CD-ROM | disk | FTP | other *** search
/ back2roots/padua / padua.7z / padua / ftp.vapor.com / amirc / submissions / DalHelper.lzx / DalHelper / Rexx / DalHelper.amirx
Encoding:
Text File  |  1997-06-05  |  9.0 KB  |  16 lines

  1. /* DalHelper.amirx
  2. \\ $VER: DalHelper.AMIRX 5.0 (04.06.97)
  3. // Written by Donald T. Becker (dtbecker@prolog.net) IRC: StarDustr
  4. \\ Please mail any bug reports/comments to the above address with a subject
  5. // header of DalHelper.amirx.
  6. \\
  7. // ** What to do with this file?
  8. \\ Put this script in AmIRC/Rexx
  9. //  Make the following Aliases:
  10. \\
  11. //  /Alias  CS  /Rx DalHelper C %p
  12. \\  /Alias  MS  /Rx DalHelper M %p
  13. //  /Alias  NS  /Rx DalHelper N %p
  14. \\
  15. */
  16. ;parse arg j1 j2 j3 j4 j5 j6;j1=upper(j1);x1=left(upper(j2),3);x2=left(upper(j2),2);if j1 ~='M'&j1 ~='N'&j1 ~='C' then exit;if j1='C' then DalDest="CHANSERV";if j1='M' then DalDest="MEMOSERV";if j1='N' then DalDest="NICKSERV";CCmd1="AKAdd, AKDel, AKList, AOAdd, AODel, AOList, DOP, DRop, HElp, IDentify, INfo, MDeop,";CCmd2="MKick, OP, PAsswd, REGister, SIDent, SKTopic, SLOps, SMEmo, SOAdd, SODel,";CCmd3="SDEsc, SMLock, SOGuard, SOList, SPRivate, SREstrict, STLlock, SURl, SUSecure, UNban.";CCmds=CCmd1 CCmd2 CCmd3;MCmds="DAll, DElete, HElp, LIst, PUrge, REad, SEnd, UNdel.";NCmd1="AAdd, ADel, AList, DRop, GHost, HElp, IDentify, INfo, PAsswd,";NCmd2="RECover, REGister, RELease, SKIll, SNMemo, SURl.";NCmds=NCmd1 NCmd2;if j1='M'|x2="IN"|x2="HE" then signal NoNeed;ReadFile=1;fname="MCF.Dal";if ~open("Input","MCF.Dal",'r') then;do;fname="MCF:MCF.Dal";if ~open("Input","MCF:MCF.Dal",'r') then;do;address command "Echo >MCF.Dal $VER: MCF.Dal 5.0 (04.06.97)";fname="MCF.Dal";ReadFile=0;end;end;ccnt=0;ncnt=0;if ReadFile then;do;xx=readln("Input");do mcnt=1 by 1 until eof("Input");Dal.mcnt=xx;Byte1=left(xx,1);select;when Byte1='$' then continue;when Byte1='#' then;do;ccnt=ccnt+1;parse value xx with Chan.ccnt CPass.ccnt junk;end;when Byte1 ~=' ' then;do;ncnt=ncnt+1;parse value xx with Nick.ncnt NPass.ncnt junk;end;otherwise continue;end;xx=readln("Input");end mcnt;call close("Input");end;options results;getchannel;CurChan=result;getmynick;MyNick=result;j6=strip(j6,'B');if j1='N' then;do;if j3 ~="" then Name=upper(j3);if j3="" then;do;if 0 ~=pos(x2,'ID DR AL GH') then Name=upper(MyNick);if 0=pos(x2,'ID DR AL GH') then Name=upper(Nick.1);if 0 ~=pos(x1,'REC REL') then Name=upper(MyNick);if x1 ~='SUR' then j3=Name;end;if 0=pos('@',Name) then;do;do cntn=1 by 1 until cntn=ncnt;if upper(Nick.cntn)=Name then;do;CPas=NPass.cntn;cntn=ncnt;end;end;end;end;if j1='C' then;do;if j3 ~="" then Chan=upper(j3);if j3="" then;do;if 0 ~=pos(x2,'ID DR') then Chan=upper(CurChan);if 0=pos(x2,'ID DR') then Chan=upper(Chan.1);if 0 ~=pos(x1,'AOL SOL SUR') then Chan=upper(CurChan);j3=Chan;end;pl=pos('@',Chan)+pos('*',Chan);if pl=0 then;do;do cntc=1 by 1 until cntc=ccnt;if upper(Chan.cntc)=Chan then;do;CPas=Chan CPass.cntc;cntc=ccnt;end;end;end;end;if x1='REG'|x2='PA' then;do;RParm=j3;if j4 ~="" then RParm=RParm j4;if j5 ~="" then RParm=RParm j5;if j6 ~="" then RParm=RParm j6;if j1='C'&0=pos('#',RParm) then;do;call GetChan();RParm=Chan RParm;if j4="" then;do;if x1='REG' then RParm=RParm "My Channel";end;parse value RParm with j3 j4 junk;end;end;NoNeed:;select;when j6 ~="" then xhelp=j3 j4 j5 j6;when j5 ~="" then xhelp=j3 j4 j5;when j4 ~="" then xhelp=j3 j4;when j3 ~="" then xhelp=j3;otherwise xhelp="";end;select;when x2='DR' then "RAW PRIVMSG "DalDest" :Drop" j3;when x2='HE' then "RAW PRIVMSG "DalDest" :Help" xhelp;when x2='ID' then "RAW PRIVMSG "DalDest" :Identify" CPas;when x2='IN' then "RAW PRIVMSG "DalDest" :Info" j3;when x2='PA' then "RAW PRIVMSG "DalDest" :Passwd" RParm;when x1='REG' then "RAW PRIVMSG "DalDest" :Register" RParm;when j1='N' then select;when x2='AA' then "RAW PRIVMSG "DalDest" :Access Add" j3;when x2='AD' then "RAW PRIVMSG "DalDest" :Access Del" j3;when x2='AL' then "RAW PRIVMSG "DalDest" :Access List" j3;when x2='GH' then "RAW PRIVMSG "DalDest" :Ghost" j3 CPas;when x1='REC' then;do;"RAW PRIVMSG "DalDest" :Recover" j3 CPas;"RAW PRIVMSG "DalDest" :Release" j3;end;when x1='REL' then "RAW PRIVMSG "DalDest" :Release" j3 CPas;when x1='SKI' then;do;if Name=1 then;Name="ON";else Name="OFF";"RAW PRIVMSG "DalDest" :SET KILL" Name;end;when x1='SNM' then;do;if Name=1 then;Name="ON";else Name="OFF";"RAW PRIVMSG "DalDest" :SET NOMEMO" Name;end;when x1='SUR' then "RAW PRIVMSG "DalDest" :SET URL" j3;otherwise;do;"echo P="d2c(27)"½½MCF╗" " "d2c(2)"NickServ"d2c(2)" commands are:" NCmd1;"echo P="d2c(27)"½½MCF╗" ":"NCmd2;end;end;when j1='C' then select;when x2='MD' then "RAW PRIVMSG "DalDest" :MDeop" Chan;when x2='MK' then "RAW PRIVMSG "DalDest" :MKick" Chan;when x2='UN' then "RAW PRIVMSG "DalDest" :UnBan" Chan "Me";when x2='OP' then;do;call GetChan();"RAW PRIVMSG "DalDest" :OP" Chan Name;end;when x1='AKA' then;do;call GetChan();"RAW PRIVMSG "DalDest" :AKick" Chan "Add" Name;end;when x1='AKD' then;do;call GetChan();"RAW PRIVMSG "DalDest" :AKick" Chan "Del" Name;end;when x1='AKL' then;do;call GetChan();"RAW PRIVMSG "DalDest" :AKick" Chan "List";end;when x1='AOA' then;do;call GetChan();"RAW PRIVMSG "DalDest" :AOP" Chan "Add" Name;end;when x1='AOD' then;do;call GetChan();"RAW PRIVMSG "DalDest" :AOP" Chan "Del" Name;end;when x1='AOL' then;do;call GetChan();"RAW PRIVMSG "DalDest" :AOP" Chan "List";end;when x1='DOP' then;do;call GetChan();"RAW PRIVMSG "DalDest" :OP" Chan "-"Name;end;when x1='SDE' then;do;call GetChan();"RAW PRIVMSG "DalDest" :SET" Chan "DESC" Name;end;when x1='SML' then;do;call GetChan();"RAW PRIVMSG "DalDest" :SET" Chan "MLOCK" Name;end;when x1='SUR' then;do;call GetChan();"RAW PRIVMSG "DalDest" :SET" Chan "URL" Name;end;when x1='SKT' then;do;call GetChan();if Name=1 then;Name="ON";else Name="OFF";"RAW PRIVMSG "DalDest" :SET" Chan "KEEPTOPIC" Name;end;when x1='SID' then;do;call GetChan();if Name=1 then;Name="ON";else Name="OFF";"RAW PRIVMSG "DalDest" :SET" Chan "IDENT" Name;end;when x1='SME' then;do;call GetChan();select;when Name=1 then Name="AOP";when Name=2 then Name="SOP";when Name=3 then Name="FOUNDER";otherwise Name="NONE";end;"RAW PRIVMSG "DalDest" :SET" Chan "MEMO" Name;end;when x1='SRE' then;do;call GetChan();if Name=1 then;Name="ON";else Name="OFF";"RAW PRIVMSG "DalDest" :SET" Chan "RESTRICT" Name;end;when x1='SLO' then;do;call GetChan();if Name=1 then;Name="ON";else Name="OFF";"RAW PRIVMSG "DalDest" :SET" Chan "LEAVEOPS" Name;end;when x1='SOG' then;do;call GetChan();if Name=1 then;Name="ON";else Name="OFF";"RAW PRIVMSG "DalDest" :SET" Chan "OPGUARD" Name;end;when x1='STL' then;do;call GetChan();select;when Name=1 then Name="SOP";when Name=2 then Name="FOUNDER";otherwise Name="NONE";end;"RAW PRIVMSG "DalDest" :SET" Chan "TOPICLOCK" Name;end;when x1='SPR' then;do;call GetChan();if Name=1 then;Name="ON";else Name="OFF";"RAW PRIVMSG "DalDest" :SET" Chan "PRIVATE" Name;end;when x1='SUS' then;do;call GetChan();if Name=1 then;Name="ON";else Name="OFF";"RAW PRIVMSG "DalDest" :SET" Chan "UNSECURE" Name;end;when x1='SOA' then;do;call GetChan();"RAW PRIVMSG "DalDest" :SOP" Chan "Add" Name;end;when x1='SOD' then;do;call GetChan();"RAW PRIVMSG "DalDest" :SOP" Chan "Del" Name;end;when x1='SOL' then;do;call GetChan();"RAW PRIVMSG "DalDest" :SOP" Chan "List";end;otherwise;do;"echo P="d2c(27)"½½MCF╗" " "d2c(2)"ChanServ"d2c(2)" commands are:" CCmd1;"echo P="d2c(27)"½½MCF╗" ":"CCmd2;"echo P="d2c(27)"½½MCF╗" ":"CCmd3;end;end;when j1='M' then select;when x2='DA' then "RAW PRIVMSG "DalDest" :Del All";when x2='DE' then "RAW PRIVMSG "DalDest" :Del" j3;when x2='LI' then "RAW PRIVMSG "DalDest" :List";when x2='PU' then "RAW PRIVMSG "DalDest" :Purge";when x2='RE' then "RAW PRIVMSG "DalDest" :Read" j3;when x2='SE' then "RAW PRIVMSG "DalDest" :Send" xhelp;when x2='UN' then "RAW PRIVMSG "DalDest" :UnDel" j3;otherwise "echo P="d2c(27)"½½MCF╗" " "d2c(2)"MemoServ"d2c(2)" commands are:" MCmds;end;end;select;when x2='MK' then;llit=":MASSKICK COMPLETE";when x2='UN' then;llit=upper(Chan)||" ARE NOW CLEARED";when x1='REG' then;llit=" ";when x2='DR' then;llit=" ";when x2='PA' then;llit=" ";otherwise exit;end;qflag='N';do until qflag ~='N';getline;lrest=upper(line.rest);if lrest=':%DAL' then exit;pfix=left(upper(line.prefix),8);if pfix ~= DalDest then iterate;if line.command ~='NOTICE' then iterate;if upper(line.dest) ~=upper(MyNick) then iterate;if 0 ~=pos(llit,lrest) then qflag='J';end;select;when x1='REG' then;do;if 0=pos("REGISTERED",lrest) then exit;if j1='N' then;do;j4=j3;j3=MyNick;end;call open("Output",fname,'A');wlen=writeln("Output",j3 j4);call close("Output");end;when x2='DR' then;do;if 0=pos("OPPED",lrest) then exit;address command "Echo >MCF:MCF.Dal $VER: MCF.Dal 5.0 (04.06.97)";scnt=1;if 0 ~=pos('$VER', Dal.1) then scnt=2;call open("Output",fname,'A');do ocnt=scnt by 1 while ocnt ~>mcnt;if 1=pos(upper(j3),upper(Dal.ocnt)) then iterate ocnt;wlen=writeln("Output", Dal.ocnt);end ocnt;call close("Output");end;when x2='PA' then;do;if 0=pos("CHANGED",lrest) then exit;if j1='N' then;do;j4=j3;j3=MyNick;end;address command "Echo >MCF:MCF.Dal $VER: MCF.Dal 5.0 (04.06.97)";scnt=1;if 0 ~=pos('$VER', Dal.1) then scnt=2;call open("Output",fname,'A');do ocnt=scnt by 1 until ocnt=mcnt;if 1=pos(upper(j3),upper(Dal.ocnt)) then Dal.ocnt=j3 j4;wlen=writeln("Output", Dal.ocnt);end ocnt;call close("Output");end;when qflag='J' then;do;address command wait 7 sec;"Say /JOIN" Chan;end;otherwise exit;end;exit;GetChan:;if 0 ~=pos('#',Chan) then Name=j4;if 0=pos('#',Chan) then;do;Chan=CurChan;Name=j3;end;return