/* Bot Editor - DMS - May 98 - by Sylvain HUET [CRYO] Modified by Vincent CARON [QUAERIS] - July 98 ***** ***** *** THIS PACKAGE IS BROUGHT TO YOU BY QUAERIS *** ** ** *** www.quaeris.com - I-net solutions ! *** ***** *****/ typeof win=ObjWin;; typeof bannerll=ObjText;; typeof cfglabel=ObjText;; typeof cfgfile=ObjText;; typeof ll=ObjList;; typeof addll= ObjButton;; typeof delll = ObjButton;; typeof links=[S r1];; var helpfile="Dms/Bots/KBot/help.txt";; var class="Dms/Bots/KBot/kbot.dmc";; var iconefile="Dms/Bots/KBot/kbot.scs.bmp";; fun conc(p,q)= if p==nil then q else (hd p)::conc (tl p) q;; fun suppevent(l)= if l==nil then nil else let l->[a n] in ("botevent"::a::nil)::("event"::a::nil)::suppevent n;; fun save(s,n)= ("action"::"in"::nil):: ("action"::"out"::nil):: ("action"::"hear"::nil):: ("action"::"!chglogin"::nil):: ("action"::"run"::nil):: ("action"::"stop"::nil):: ("event"::"broad"::nil):: ("event"::"private"::nil):: ("event"::"log"::nil):: ("cfgfile"::(_GETtext cfgfile)::nil):: suppevent links;; fun updatel2(s,b)= _ADDlist ll 1000 s;; fun updatel()= _RSTlist ll; apply_on_list links @updatel2 0;; fun addr(s)= if s==nil then nil else (set links=conc links s::nil; updatel);; fun _add(a,b)= /* loc( iniEnterBox _channel editWin nil nil "New Event" @addr "Enter a new event name" ;; ) */ iniEnterBox _channel win nil nil (_locEditor "240-BOT0ED-newevent" nil) @addr (_locEditor "241-BOT0ED-enteranewe" nil);; fun _rem(x,b)= let _GETlist ll ->[i _] in let nth_list links i -> a in if a==nil then nil else (set links=remove_from_list links a; updatel);; fun fdlink(a,b)= if strcmp hd a "botevent" then 0 else (set links=conc links (hd tl a)::nil; 0);; fun load (l) = _SETtext cfgfile getInfo l "cfgfile"; set links=nil; apply_on_list l @fdlink 0; updatel;; fun _resizeT(a,t,x,y)=_SIZEtext t x-2 y-2 1 1;; fun rflSizeEditWin (wn, blurp, w, h)= /*_SIZEtext cfglabel 100 20 5 5;*/ _SIZEtext cfgfile w-115 20 110 5; _SIZEtext bannerll w-10 20 5 35; _SIZElist ll w-10 h-85 5 60; _SIZEbutton addll 45 20 5 h-25; _SIZEbutton delll 45 20 70 h-25;; fun IniEditor(s)= let [315 250] -> [w h] in let startEditor _channel nil nil nil w h WN_MENU EDITOR_NORMAL s class helpfile iconefile @load @save nil -> ed in ( set win = getEditWin ed; /* set cfglabel = _CRtext _channel win 5 5 100 20 ET_BORDER+ET_ALIGN_CENTER "Config file :";*/ set cfglabel = _CRtext _channel win 5 5 100 20 ET_BORDER+ET_ALIGN_CENTER (_locEditor "990-BOT0ED-configfile" nil); set cfgfile = _CReditLine _channel win 110 5 200 20 ET_DOWN+ET_AHSCROLL "dms/bots/kbot/kbot.cfg"; /* set bannerll = _CRtext _channel win 5 35 305 20 ET_BORDER+ET_ALIGN_CENTER "New events :";*/ set bannerll = _CRtext _channel win 5 35 305 20 ET_BORDER+ET_ALIGN_CENTER (_locEditor "810-BOT0ED-newevents:" nil); set ll=_CRlist _channel win 5 60 305 160 LB_DOWN+LB_VSCROLL; /* set addll = _CBbutton _CRbutton _channel win 5 225 45 20 0 "Add" @_add 0;*/ set addll = _CBbutton _CRbutton _channel win 5 225 45 20 0 (_locEditor "830-BOT0ED-add" nil) @_add 0; /* set delll = _CBbutton _CRbutton _channel win 70 225 45 20 0 "Remove" @_rem 0;*/ set delll = _CBbutton _CRbutton _channel win 70 225 45 20 0 (_locEditor "840-BOT0ED-remove" nil) @_rem 0; _CBwinSize win @rflSizeEditWin 0; if s==nil then nil else openDMI ed ); 0;;