/* Kuang Eleven 3 AmIRC config modifier Ariel Magnum */ options results if ~show('L','rexxsupport.library') then addlib('rexxsupport.library',0,-30,0) if ~show('L','rexxreqtools.library') then addlib('rexxreqtools.library',0,-30,0) progdir=getextvar('T:Kuang_11_amirdir') file=getextvar('T:Kuang_11_amircfg') newfile=getextvar('T:Kuang_11_newamircfg') options=getextvar('T:Kuang_11_installoptions') parse var options instbut . if instbut='' then instbut=0 if progdir='' then progdir=pragma('d') if file='' then file='Default.amircfg' if newfile='' then newfile='Kuang11/Default.amircfg' say instbut;say progdir;say file;say newfile l=show('P');p=1 do until p=0 p=pos('AMIRC',l,p) if p~=0 then do address value substr(l,p,7) 'QUIT' address p=p+1 end end pr='Kuang Eleven Installer';tags='';cr='0a'x;NL='0a'x;conf='Kuang11/Config';t=time('s') if open(1,file,'R') then do buffer=readch(1,word(statef(file),2)) close(1) end else exit newconfig='';autoaway='';addawayalias=1;addbackalias=1 do until buffer='' parse var buffer ln (cr) buffer if ln='' then iterate parse var ln id value value=strip(value,'L',' ') Select when id="CTCPSOUNDDIR" then sndir=prsprg(value) when id='MSG_QUIT' then if pos('PHOENIX',upper(ln))~=0 then ln='MSG_QUIT' '02'x||'Kuang Eleven Terminating'||'02'x when id='MSG_KICK' then if pos('PHOENIX',upper(ln))~=0 then ln='MSG_KICK' '02'x||'Kuang Eleven'||'02'x when id='MSG_AUTOAWAY' then parse var ln . autoaway when id='EVENT_PRIV'|id='EVENT_INVITE'|id='EVENT_NOTICE'|id='EVENT_JOIN'|id='EVENT_PRIV'|id='EVENT_KICK'|id='EVENT_MODE' then ln=delstr(ln,lastpos(',',ln))',T:Kuang11.amirx %p' when id='EVENT_CTCP' then ln=delstr(ln,lastpos(',',ln))',T:Kuang11.amirx ctcp%p' when id='EVENT_DCC' then ln=delstr(ln,lastpos(',',ln))',T:Kuang11.amirx dcc%p' when id='EVENT_HILITE' then ln=delstr(ln,lastpos(',',ln))',T:Kuang11.amirx hilite%p' when id='ALIAS' then do value=upper(strip(value)) Select when value='AWAY /RX KUANG11CMD.AMIRX AWAY %P'|value='AWAY /RX KUANG11CMD AWAY %P' then addawayalias=0 when value='BACK /RX KUANG11CMD.AMIRX AWAY %P'|value='BACK /RX KUANG11CMD AWAY %P' then addbackalias=0 Otherwise end end when instbut then do Select when id='USEROPBUTTONPAGES' then if word(ln,2)<2 then ln='USEROPBUTTONPAGES 2' when left(id,6)~='USEROP' then nop when id='USEROP0' then ln='USEROP0 Away/Back,/Away' when id='USEROP1' then ln='USEROP1 Chat,/DCC CHAT %u' when id='USEROP2' then ln='USEROP2 Ping,/PING %u' when id='USEROP3' then ln='USEROP3 Send,/DCC SEND %u' when id='USEROP4' then ln='USEROP4 Whois,/whois %u' when id='USEROP5' then ln='USEROP5 KSend,/KDCC %u' when id='USEROP6' then ln='USEROP6 Userlist,/KUSR' when id='USEROP7' then ln='USEROP7 XDCC·Get,/axdcc %u' when id='USEROP8' then ln='USEROP8 Page,/ctcp %u PAGE' when id='USEROP9' then ln='USEROP9 Kick,/KICK %u' when id='USEROP10' then ln='USEROP10 DeOp,/DEOP %m' when id='USEROP11' then ln='USEROP11 Op,/OP %m' when id='USEROP12' then ln='USEROP12 Ban,/QKICK %u' when id='USEROP13' then ln='USEROP13 PermBan,/Pban %u' when id='USEROP14' then ln='USEROP14 KGui,/KGUI' when id='USEROP15' then ln='USEROP15 KHelp,/KHELP' when id='USEROP16' then ln='USEROP16 XDCC PList,/XDCC PLIST' when id='USEROP17' then ln='USEROP17 XDCC SList,/XDCC SList' when id='USEROP18' then ln='USEROP18 XDCC Noti,/XDCC NOTI' when id='USEROP19' then ln='USEROP19 XDCC List,/XDCC LIST' when id='USEROP20' then ln='USEROP20 XDCC Add,/XDCC ADDP' when id='USEROP21' then ln='USEROP21 Add Friends,/Addf %u all' when id='USEROP22' then ln='USEROP22 Add Host,/addh %u' when id='USEROP23' then ln='USEROP23 Ping Channel,/pc' otherwise end end otherwise end newconfig=newconfig||ln||cr end if addbackalias then newconfig=newconfig'ALIAS BACK /RX KUANG11CMD.AMIRX AWAY %p'||cr if addawayalias then newconfig=newconfig'ALIAS AWAY /RX KUANG11CMD.AMIRX AWAY %p'||cr open(1,newfile,'W') writech(1,newconfig) close(1) open(1,'ENV:Kuang_11_sounddir','W') writech(1,sndir) close(1) open(1,conf,'R') then do buffer=readch(1,word(statef(conf),2)) close(1) do until buffer='' parse var buffer ln (cr) buffer if ln='' then iterate parse var ln id value call setclip('sc_'id,strip(value,'L',' ')) end if getclip('sc_msg_autoaway')~=autoaway then do call setclip('sc_msg_autoaway',autoaway) save=1 end x=getclip('sc_extrctcp') if find(x,'PING')=0&find(x,'GETSOUND')=0&find(x,'SOUND')=0 then if rtezrequest("Would you like to install the SoundLeech plugins?"||NL||"-PING plugin to play PING.WAV."||NL||"-SOUND plugin to request sounds you dont have."||NL||"-GETSOUND plugin to send sounds on CTCP request."||NL||"Any of those may be easily deactivated via the GUI!"||NL||"This will NOT overwrite your current Plugins config!","Yes|NO WAY!",pr,tags)=1 then do call setclip('sc_extrctcp',strip(getclip('sc_extrctcp') 'PING GETSOUND SOUND')) call setclip('sc_extrscr',strip(getclip('sc_extrscr') 'ping.amirx getsound.amirx autogetsounds.amirx')) save=1 end if find(x,'KDCC')=0 then do call setclip('sc_extrctcp',strip(getclip('sc_extrctcp') 'KDCC')) call setclip('sc_extrscr',strip(getclip('sc_extrscr') 'KDCC')) save=1 end x=getclip('sc_pubcmd') if find(x,'VOICE')=0&find(x,'UNVOICE')=0&find(x,'OP')=0&find(x,'OP')=0&find(x,'ADDF')=0&find(x,'ADDH')=0&find(x,'SETF')=0&find(x,'SAVE')=0 then if rtezrequest("Would you like to install the Modes and RemoteSysop public channel commands?"||NL||"This will NOT overwrite your current Channel Commands config!","Yes|NO WAY!",pr,tags)=1 then do call setclip('sc_pubcmd',strip(getclip('sc_pubcmd') 'VOICE UNVOICE OP ADDF ADDH SETF SAVE')) call setclip('sc_pubscr',strip(getclip('sc_pubscr') 'modes modes modes remotesys remotesys remotesys remotesys')) save=1 end if exists('env:TIADCC') then do call setclip('sc_tia','ON') save=1 end x=getclip('sc_sensordcc');if x='' then x=0 if x<5 then do setclip('sc_sensordcc',5) save=1 end x=getclip('sc_sensorctcp') if x>3 then if rtezrequest("AmIRC's internal flood protection sensor is set at 4 hits."||NL||"Inorder for K¹¹ to intercept floods before AmIRC,"||NL||" I will now set CTCP sensor to 3.","Great do it|Dont do it",pr,'')=1 then do setclip('sc_sensorctcp',3) save=1 end x=getclip('sc_rvg') if x='ON'|x='NONP' then if getclip('sc_rvgd')~='ON'&getclip('sc_rvgb')~='ON'&getclip('sc_rvgk')~='ON' then do setclip('sc_rvgk','ON') save=1 end if save=1 then do l=show('c');newkuang11config='' do until l='' parse var l x l if substr(x,1,3)='sc_' then newkuang11config=newkuang11config||substr(x,4) getclip(x)||cr end open(1,conf,'W') writech(1,newkuang11config) close(1) end open(1,'T:Rexxmast','R') buffer=readch(1,word(statef(conf),2)) close(1) value=0 if pos('REXX server already active',buffer)=0 then value=1 open(1,'ENV:Kuang_11_rexxmast','W') writech(1,value) close(1) say time('s')-t exit /* Shared Functions */ prsprg:PROCEDURE EXPOSE progdir y=progdir z=right(y,1) if z~='/'&z~=':' then y=y||'/' x=strip(arg(1)) if upper(left(x,8))='PROGDIR:' then if length(x)>8 then return y||substr(x,9);else return y return x getextvar:PROCEDURE open(1,arg(1),'R') x=readln(1) close(1) return x