# AutoLoad.irc v1.0b by Rwf (rwf@loonybin.dyn.ml.org) # # AutoLoad is a little script i spawned from the idea of having a menu # to pick a script to load.. kinda like System Commander which lets you # pick an OS to boot... i liked the idea, so i coded it. -rwf # # my recommendation for use is to put /load autoload.irc in your .bitchxrc # file in your home dir.. then create a savefile in this script that has # all your favorite scripts loaded in order.. then, after you start bX, # just hit 'l' at the prompt and all your scripts will load up nicely. :) # # this script is a silent run.. it won't make any major changes to bX, and # it cleans up after itself quite nicely.. however, it includes a few things # that can be added to a script to make it more AutoLoad compatible.. # # keep AutoLoad updated.. check #Lb or #BitchX periodically, look for me.. # i'll make sure you get an updated version. :) # # greetz to: # suicide - for helping me figure out some shit :) # panasync - for a kick-ass client.. this guy rocks. :) # whoever wrote system commander - for the great menuload idea. # all the script authors - for makin great scripts and bein nice to me ;) # #Lb, #BitchX, & #woohoo - cause you're great.. # # mad greetz to: # oweff - for REALLY fixing it big time, he's a more feerable god. :) # Fudd - for coming up with a shitload of ideas for the script and for # helping me dig up all the supported scripts.. thanx man. # [nutbar] - for his scripting skillz and fixing it big time, hes a god :) # # supported script filenames.. @ fmax = [21] @ fn.0 = [addons.x] @ fn.1 = [azure.irc] @ fn.2 = [backlash.bx] @ fn.3 = [caramel.irc] @ fn.4 = [crack3.irc] @ fn.5 = [evolver.irc] @ fn.6 = [horizon.bx] @ fn.7 = [ice.bx] @ fn.8 = [is.bx] @ fn.9 = [jive.bx] @ fn.10 = [mb.irc] @ fn.11 = [mdk.irc] @ fn.12 = [na.irc] @ fn.13 = [nz.scr] @ fn.14 = [os.bx] @ fn.15 = [pebble.irc] @ fn.16 = [prevail.bx] @ fn.17 = [sextalk.bx] @ fn.18 = [ScriptX.x] @ fn.19 = [tv.bx] @ fn.20 = [votetrak.scr] # script paths @ al.path1 = [~] @ al.path2 = [~/.BitchX] @ al.path3 = [~/bl] @ al.path4 = [~/.evolver] @ al.path5 = [~/is] @ al.path6 = [~/.jive] @ al.path7 = [~/.mb] @ al.path8 = [~/pv] @ al.path9 = [~/scripts] # misc assigns @ al.b = [] @ al.o = [] @ al.u = [] @ al.bu = [] @ alph = [abcdefghijklmnopqrstuvwxyz] @ autoload.ver = [1.0b] @ alv1 = [$left(1 $autoload.ver)] @ alv2 = [$strip($alph $right(2 $autoload.ver))] @ alv3 = [$right(1 $autoload.ver)] @ autoload.logo = [ú‘ autoload ${alv1}.${alv2}${alv3} ‘ú] @ al.pmt = [ú‘ú] @ al.pmt2 = [ú‘] @ al.pmt3 = [‘ú] @ al.cpmt = [%Cú%W‘%Cú%n] @ tmp.lnums = [1 2 3 4 5] @ tmp.redo = [] # script-specific aliases alias al.addons { @ tmp.ver = [$findver($tmp.dofn alias addons.ver)] @ tmp.fver.$al.lcount = [$strip([] $rightw(2 $tmp.ver))] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.azure { @ tmp.ver = [$after(= $findver($tmp.dofn @azure.logo))] @ tmp.fver1 = [${al.b}ù${al.u}az${al.bu}\(${al.b}u${al.bu}\)${al.u}re${al.bu}\[] @ tmp.fver2 = [$leftw(1 $rightw(3 $sar(g/\[/ /$sar(g/\]/ /$tmp.ver))))] @ tmp.fver.$al.lcount = [$tmp.fver1$tmp.fver2${al.bu}\]${al.b}ù${al.o}] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.backlash { @ tmp.ver = [$strip([] $after(= $findver($tmp.dofn @bl.ver=)) $after(= $findver($tmp.dofn @bl.rel=)) $after(= $findver($tmp.dofn @bl.date=)))] @ tmp.fver1 = [${al.b}b${al.o}ackla${al.u}s${al.bu}h${al.o}] @ tmp.fver.$al.lcount = [$tmp.fver1 $tmp.ver] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.caramel { @ tmp.ver = [$strip([] $after(= $findver($tmp.dofn @cm.ver=)))] @ tmp.fver1 = [$strip([] $after(= $findver($tmp.dofn @cm.logo=)))] @ tmp.fver.$al.lcount = [${tmp.fver1}/${al.b}\[${al.o}$tmp.ver${al.b}\]${al.o}] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.crack3 { @ tmp.ver = [$rightw(1 $findver($tmp.dofn ^assign crack.ver))] @ tmp.fver1 = [\(${al.b}c${al.o}\)${al.u}rackrock${al.o}/${al.b}b${al.o}X] @ tmp.fver.$al.lcount = [$tmp.fver1 $tmp.ver] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.evolver { @ tmp.ver = [$strip([]\\ $after(= $findver($tmp.dofn @ev.name=))${al.o}\(${al.b}$after(= $findver($tmp.dofn @ev.ver=)${al.o}\)))] @ tmp.fver.$al.lcount = [$tmp.ver] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.horizon { @ tmp.ver = [$strip([] $after(= $findver($tmp.dofn @horizon=)) $after(n $findver($tmp.dofn @horver=)))] @ tmp.fver.$al.lcount = [$tmp.ver] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.ice { @ tmp.ver = [$strip([] $after(= $findver($tmp.dofn @icevershun=)))] @ tmp.fver.$al.lcount = [${al.u}\[${al.o}$tmp.ver${al.u}\]${al.o}] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.is { @ tmp.is = open(~/is/isc/version.isc R) @ tmp.isver = [$read($tmp.is)] @ tmp.ver = [$strip(\} $after(= $tmp.isver))] @ tmp.fver.$al.lcount = [\[${al.u}i${al.o}nterspace${al.b}.${al.o}$tmp.ver\]${al.o}] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.jive { @ tmp.ver = [$rightw(1 $findver($tmp.dofn assign jive.ver)) $rightw(1 $findver($tmp.dofn assign jive.num))] @ tmp.fver.$al.lcount = [$tmp.ver] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.mb { @ tmp.ver = [$after(= $findver($tmp.dofn @mb.shortver=))] @ tmp.fver1 = [${al.bu}\[${al.b}m${al.bu}\]${al.u}onkey${al.bu}\[${al.b}b${al.bu}\]${al.u}eans${al.o}] @ tmp.fver2 = [${al.u}\[${al.b}$sar(g/./${al.u}.${al.b}/$tmp.ver)${al.u}\]${al.o}] @ tmp.fver.$al.lcount = [${tmp.fver1}/$tmp.fver2] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.mdk { @ tmp.ver = [$strip([] $after(= $findver($tmp.dofn @mdk.ver=)))] @ tmp.fver.$al.lcount = [${al.b}MDK${al.o}-${al.b}$tmp.ver${al.o}] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.na { @ tmp.ver = [$strip([] $after(= $findver($tmp.dofn @na.logo=))${al.u}/${al.o}$after(= $findver($tmp.dofn @na.ver=)))] @ tmp.fver.$al.lcount = [$tmp.ver] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.nz { @ tmp.ver = [$strip([] $after(= $findver(~/.BitchX/nz.scr @nz.ver.nocolor=)))] @ tmp.fver.$al.lcount = [n${al.b}Z${al.o} $tmp.ver] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.os { @ tmp.ver = [$rightw(1 $findver($tmp.dofn ^assign os.ver))] @ tmp.fver1 = [${al.b}o${al.o}smosi${al.b}s${al.o}] @ tmp.fver.$al.lcount = [$tmp.fver1 $tmp.ver] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.pebble { @ tmp.ver = [$strip([] $after(= $findver($tmp.dofn @cp.ver=)))] @ tmp.fver1 = [\(${al.b}c${al.o}\)${al.u}rackpebble${al.o}] @ tmp.fver.$al.lcount = [$tmp.fver1\[${al.bu}$tmp.ver${al.o}\]] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.prevail { @ tmp.ver = [$strip({[prevail]} $after(= $findver($tmp.dofn alias prevail)))] @ tmp.fver.$al.lcount = [prevail${al.u}\[${al.o}$tmp.ver${al.y}\]${al.o}] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.ScriptX { @ tmp.ver = [$strip([]\\ $after(= $findver($tmp.dofn @scriptx.ver=)))] @ tmp.fver.$al.lcount = [${al.u}Script${al.bu}X${al.u}x$tmp.ver${al.o}] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.sextalk { @ tmp.ver = [$strip([]\\ $after(= $findver($tmp.dofn @sextalk.ver=)))] @ tmp.fver.$al.lcount = [\[$tmp.ver\]] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.tv { @ tmp.ver = [$rightw(1 $findver($tmp.dofn ^assign tv.logo))/$rightw(1 $findver($tmp.dofn ^assign tv.ver))] @ tmp.fver.$al.lcount = [$tmp.ver] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } alias al.votetrak { @ tmp.ver = [$strip([] $after(= $findver($tmp.dofn @vver=)))] @ tmp.fver1 = [\(${al.bu}v${al.o}\)${al.u}ote${al.o}\(${al.bu}t${al.o}\)${al.u}rak${al.o}] @ tmp.fver.$al.lcount = [$tmp.fver1 ${al.b}$tmp.ver${al.o}] echo $al.pmt ${al.bu}\(${al.b}$[-2]al.lcount${al.bu}\)${al.o} $tmp.fver[$al.lcount] @ fn.load.$al.lcount = [$tmp.dofn] } # various fixes.. alias fixfn { if ([$left(9 $0)]==[~/scripts]) { @ tmp.fn = [$mid(10 ${strlen($0) - 10} $0)] @function_return=[$before(. $tmp.fn)] }{if ([$left(4 $0)]==[~/pv]) { @ tmp.fn = [$mid(5 ${strlen($0) - 5} $0)] @function_return=[$before(. $tmp.fn)] }{if ([$left(7 $0)]==[~/.jive]) { @ tmp.fn = [$mid(8 ${strlen($0) - 8} $0)] @function_return=[$before(. $tmp.fn)] }{if ([$left(5 $0)]==[~/.mb]) { @ tmp.fn = [$mid(6 ${strlen($0) - 6} $0)] @function_return=[$before(. $tmp.fn)] }{if ([$left(4 $0)]==[~/is]) { @ tmp.fn = [$mid(5 ${strlen($0) - 5} $0)] @function_return=[$before(. $tmp.fn)] }{if ([$left(10 $0)]==[~/.evolver]) { @ tmp.fn = [$mid(11 ${strlen($0) - 11} $0)] @function_return=[$before(. $tmp.fn)] }{if ([$left(4 $0)]==[~/bl]) { @ tmp.fn = [$mid(5 ${strlen($0) - 5} $0)] @function_return=[$before(. $tmp.fn)] }{if ([$left(9 $0)]==[~/.BitchX]) { @ tmp.fn = [$mid(10 ${strlen($0) - 10} $0)] @function_return=[$before(. $tmp.fn)] }{@function_return=[$before(. $strip(~/ $0))]}}}}}}}} } # script finder.. alias findscr { @ fnlist = [] @ fncount = [0] while ([$fncount] < [$fmax]) { @ fname = [$fn[$fncount]] if ([$fexist(${al.path1}/${fname})]==[1]) {@ fnlist = [$fnlist${al.path1}/$fname ]} if ([$fexist(${al.path2}/${fname})]==[1]) {@ fnlist = [$fnlist${al.path2}/$fname ]} if ([$fexist(${al.path3}/${fname})]==[1]) {@ fnlist = [$fnlist${al.path3}/$fname ]} if ([$fexist(${al.path4}/${fname})]==[1]) {@ fnlist = [$fnlist${al.path4}/$fname ]} if ([$fexist(${al.path5}/${fname})]==[1]) {@ fnlist = [$fnlist${al.path5}/$fname ]} if ([$fexist(${al.path6}/${fname})]==[1]) {@ fnlist = [$fnlist${al.path6}/$fname ]} if ([$fexist(${al.path7}/${fname})]==[1]) {@ fnlist = [$fnlist${al.path7}/$fname ]} if ([$fexist(${al.path8}/${fname})]==[1]) {@ fnlist = [$fnlist${al.path8}/$fname ]} if ([$fexist(${al.path9}/${fname})]==[1]) {@ fnlist = [$fnlist${al.path9}/$fname ]} @ fncount++ } } # version finder for scripts alias findver { @ foundver = [0] @ verscript = [$0] @ verstr = [$1] @ verstr2 = [$1$2] @ verstr3 = [$2] @ verfile = open($verscript R) if ([$[1]verstr]==[@]) { while (!foundver && !eof($verfile)) { @ verline = [$read($verfile)] if ([$before(= $tr(/ //$verline))]==[$strip(= $verstr2)]) { @ foundver = [1] @function_return=[$tr(/ //$verline)] } } }{ while (!foundver && !eof($verfile)) { @ verline = [$read($verfile)] if ([$leftw(1 $verline)]==[$verstr]) { if ([$rightw(1 $leftw(2 $verline))]==[$verstr3]) { @ foundver = [1] @function_return=[$verline] } } }} @close($verfile) } alias _relist { @ tmp.cnt = [0] echo $al.pmt2 scripts found: foreach tmp.fver jj { @ tmp.cnt++ echo $al.pmt ${al.bu}\(${al.b}$[-2]tmp.cnt${al.bu}\)${al.o} $tmp.fver[$tmp.cnt] } } alias _addscr { @ tmp.ascr = [$0] input "$cparse("$al.cpmt") add script $strip( $tmp.fver[$tmp.ascr]) to which queue? [1-5] " if ([$match($0 $tmp.lnums)]!=[0]) { @ tmp.lq = [$0] echo $al.pmt adding script $tmp.fver[$tmp.ascr] to load queue ${al.b}$tmp.lq${al.o}.. @ tmp.queue.$tmp.lq = [$tmp.queue[$tmp.lq] $fn.load[$tmp.ascr]] @ tmp.qlist.$tmp.lq = [$tmp.qlist[$tmp.lq] $tmp.ascr] }{@ tmp.redo = [1]} if ([$tmp.redo]) {@ tmp.redo = [];^_addscr $tmp.ascr} } alias _qlist { input "$cparse("$al.cpmt") list contents of which queue? [1-5] " if ([$match($0 $tmp.lnums)]!=[0]) { @ tmp.llq = [$0] @ tmp.qlst = [$tmp.qlist[$tmp.llq]] echo $al.pmt2 scripts in load queue ${al.b}$0${al.o}: fe ($tmp.qlst) ql.tmp { echo $al.pmt $tmp.fver[$ql.tmp] } }{@ tmp.redo = [1]} if ([$tmp.redo]) {@ tmp.redo = [];^_qlist} } alias _qsave { @rename(${al.path1}/.al.sav ${al.path1}/.al.sav~) @ al.save = open(${al.path1}/.al.sav W T) @write($al.save # autoload.irc load queue save file) @write($al.save ) @write($al.save @ al.old = [$autoload.ver]) @write($al.save ) @write($al.save # user load queues..) @write($al.save @ tmp.queue.1 = [$tmp.queue.1]) @write($al.save @ tmp.qlist.1 = [$tmp.qlist.1]) @write($al.save @ tmp.queue.2 = [$tmp.queue.2]) @write($al.save @ tmp.qlist.2 = [$tmp.qlist.2]) @write($al.save @ tmp.queue.3 = [$tmp.queue.3]) @write($al.save @ tmp.qlist.3 = [$tmp.qlist.3]) @write($al.save @ tmp.queue.4 = [$tmp.queue.4]) @write($al.save @ tmp.qlist.4 = [$tmp.qlist.4]) @write($al.save @ tmp.queue.5 = [$tmp.queue.5]) @write($al.save @ tmp.qlist.5 = [$tmp.qlist.5]) @close($al.save) if (![$tmp.bleh]) {echo $al.pmt load queues saved to ${al.b}${al.path1}/.al.sav${al.o}} } alias _qsave2 {@ tmp.bleh = [1];^_qsave;@ tmp.bleh = []} alias _qclr { input "$cparse("$al.cpmt") clear contents of which queue? [1-5] " if ([$match($0 $tmp.lnums)]!=[0]) { @ tmp.llq = [$0] @ tmp.queue.$tmp.llq = [];@ tmp.qlist.$tmp.llq = []; echo $al.pmt load queue ${al.b}$tmp.llq${al.o} cleared.. }{^_qclr2;echo $al.pmt all load queues cleared..} } alias _qclr2 { @ tmp.queue.1 = [];@ tmp.qlist.1 = []; @ tmp.queue.2 = [];@ tmp.qlist.2 = []; @ tmp.queue.3 = [];@ tmp.qlist.3 = []; @ tmp.queue.4 = [];@ tmp.qlist.4 = []; @ tmp.queue.5 = [];@ tmp.qlist.5 = []; } alias _qload { input "$cparse("$al.cpmt") load contents of which queue? [1-5] " if ([$match($0 $tmp.lnums)]!=[0]) { @ tmp.llq = [$0] @ tmp.que = [$tmp.queue[$tmp.llq]] ^wait -cmd fe ($tmp.que) loadscr {^load $loadscr}) }{^_qload} } alias _donums { @ tmp.nums = [] foreach fn jj { if ([$isdigit($jj)]==[1]) { @ jj++ @ tmp.nums = [$numsort($tmp.nums$jj) ] } } } alias _dopmt { @ tmp.q = [] @ tmp.ins = [${tmp.nums}c h l q r s x] input "$cparse("$al.cpmt") Please pick an option: " if ([$match($0 $tmp.ins)]!=[0]) { if ([$isdigit($0)]==[1] && [$0]<=[$fmax]) {^_addscr $0;^_dopmt}{ switch ($0) { (c) {^_qclr;^_dopmt} (h) {^_dohelp;^_dopmt} (l) {^_qload} (q) {^_qlist;^_dopmt} (r) {^_relist;^_dopmt} (s) {^_qsave;^_dopmt} (x) {echo $al.pmt no scripts loaded!} } }}{^_dopmt} } alias _domenu { ^findscr echo $al.pmt2 scripts found: @ al.lcount = [0] fe ($fnlist) fn.tmp { @ al.lcount++ @ tmp.dofn = [$fn.tmp] ^al.$fixfn($fn.tmp) } echo $al.pmt2 ${al.u}--=${al.bu}>${al.o} found ${al.b}$al.lcount${al.o} of ${al.b}$fmax${al.o} possible scripts.. hit ${al.b}h${al.o} for help if ([$fexist(${al.path1}/.al.sav)]==[1]) { echo $al.pmt2 ${al.u}--=${al.bu}>${al.o} found saved queue file ${al.b}${al.path1}/.al.sav${al.o} , settings autoloaded.. ^load ${al.path1}/.al.sav } if ([$al.old]!=[$autoload.ver]) {echo $al.pmt2 ${al.bu}--=${al.b}> ** Save file is OLD! please reconfigure and save again **;^_qclr2;^_qsave2} } alias _dohelp { echo $al.pmt2 available commands: echo $al.pmt ${al.bu}\(${al.b} #${al.bu}\) ${al.u}-${al.o} adds script # to a load queue echo $al.pmt ${al.bu}\(${al.b} c${al.bu}\) ${al.u}-${al.o} clears a single or all load queue\(s\) echo $al.pmt ${al.bu}\(${al.b} l${al.bu}\) ${al.u}-${al.o} loads the contents of a single load queue echo $al.pmt ${al.bu}\(${al.b} q${al.bu}\) ${al.u}-${al.o} lists the contents of a single load queue echo $al.pmt ${al.bu}\(${al.b} r${al.bu}\) ${al.u}-${al.o} relists the available scripts echo $al.pmt ${al.bu}\(${al.b} s${al.bu}\) ${al.u}-${al.o} saves the current load queues to disk echo $al.pmt ${al.bu}\(${al.b} x${al.bu}\) ${al.u}-${al.o} quits without loading any scripts } if (!S) {^clear} ^eval echo $al.pmt2 $autoload.logo $al.pmt3 ^eval echo $al.pmt2 loading and searching for supported scripts.. $al.pmt3 ^eval echo $al.pmt2 $autoload.logo $al.pmt3 ^_donums ^_qclr2 ^_domenu ^_dopmt