; PAE ProDOS v4.5b ; Seg #5 (more commands) public rename public kill.file public page public want.list public activs1 public top.uls public w.file public change on nocar goto link.term ; subroutines log.list open #1,f$:if mark(1) close:print "No data available."\:return position #1,80,0:input #1,bb:gf=0:d1=bb:wx=0 dc position #1,80,d1:input #1,i$ a$=right$(i$,18):a$=left$(a$,8) if x$ and (a$"EMPTY" wx=1:setint(1):print i$:setint("") if key(1) print "":wx=1:close:return gf=gf+1:if gf=nr close:return d1=d1-1:if not d1 d1=nr goto dc name.find if f$="/" f$=fn$:print " Filename: "f$ open #1,bd$+"dir"+lg$:position #1,95,0:input #1,a if not a close:print \"No such file":pop:return for b=1 to a:position #1,95,b:input #1,i$,x$ if i$="EMPTY" next:close:print \"File not found":pop:return gf=len(f$):if left$(i$,gf)=f$ x=b:b=a:next:close:goto number1 next:close:print \"File not found":pop:return number open #1,bd$+"dir"+lg$:position #1,95,0:input #1,b if not b close:print \"No files on this drive!":pop:return if a>b close:print \"Error - Highest file # is "b:pop:return position #1,95,a:input #1,i$,x$:close if i$="EMPTY" print \"No such file":pop:return x=a:f$=left$(i$,30):print " Filename: "f$ number1 if info(5) or (li=un) return if left$(i$,2)="S." print\"This file is for SysOps only.":pop:return if left$(i$,2)<>"U." return gh=val(mid$(i$,3,(len(str$(nu))))):if (gh<1) or (gh>nu) return if un<>gh print \"This file is for user #"gh" only.":pop:return return ed.log if info(5) return open #1,bd$+"pae.log":append #1:print #1,ul$:close #1 return show.file setint(1):print:copy f$:setint(""):return link.pae open #1,bd$+"pae.points":position #1,12,un:print #1,pt,up,dn:close link l1$,"return" link.term open #1,bd$+"pae.points":position #1,12,un:print #1,pt,up,dn:close link l1$,"link.term" get.key yy=0 get.key1 if (clock(2)<>0) and (clock(1)>clock(2)) print "[Time Limit Exceeded]":goto link.term yx=peek(-16384):if (yx=129) or (yx=150) get i$:print bs$;:return yx=key(0):if (yx>96) and (yx<123) yx=yx-32 if (yx=7) or (yx=15) or (yx=16) goto get.key2 if yx i$=chr$(yx):return get.key2 yy=yy+1 if yy=2000 print chr$(7,2);:goto get.key1 if yy=4000 modem(2):return if (not info(0)) and (not info(5)) goto link.term goto get.key1 case.convert ab$="":for wy=1 to len(fn$):wx=asc(mid$(fn$,wy,1)) if (wx=32) or (wx=46) ab$=ab$+".":next:goto case1 if (wx<48) or (wx>90) next:goto case1 if (wx>57) and (wx<65) next:goto case1 ab$=ab$+chr$(wx):next case1 ab$=left$(ab$,15) if right$(ab$,1)="." ab$=left$(ab$,(len(ab$)-1)):goto case1 return ; SysOp rename file rename push link.pae input @2"Rename file: "f$:if f$="" return if left$(f$,1)<>"#" gosub name.find:goto ren2 a=val(mid$(f$,2,(len(f$)-1))):if a<1 return gosub number ren2 input @2\"New filename: "f$:if f$="" return if left$(f$,1)="#" or instr(":",f$) print \"Illegal filename":return if len(f$)>30 print"Invalid file name - max 30 chars":return i$=right$(i$,len(i$)-30) f$=left$(f$+chr$(32,30),30)+i$:fn$=left$(f$,30) open #1,bd$+"dir"+lg$:position #1,95,x:print #1,f$,x$:close ul$="Renamed file: "+lg$+":"+f$:gosub ed.log print \"File renamed":return ; Change File Info change push link.pae input @2 "Change info on: "f$:if not f$ return if left$(f$,1)<>"#" gosub name.find:goto change1 a=val(mid$(f$,2,len(f$)-1)):if a<1 return gosub number change1 if info(5) or (li=un) goto change2 a$=a1$+" "+a2$:a=len(a$) if (mid$(i$,55,a)<>a$) and (gh<>un) print \"Not your file":return change2 fn$=left$(i$,30) edit(0):print \"Enter New Info Now: "edit(3)" cols, 4k max" print "Type 'DONE' when finished '.h' for help" edit(1):if not edit(2) return print \"Saving new info..."; i$=lg$+":a"+str$(x)+"."+x$ open #1,i$:input #1,x1$\x2$\x3$\x4$\x5$\x6$\x7$:close kill i$:create i$:open #1,i$ print #1,x1$\x2$\x3$\x4$\x5$\x6$\x7$\" Description:"\ copy #8,#1:close print "done.":return ; User Kill File kill.file push link.pae:bn=0:print:kill rd$+"batch":create rd$+"batch" kill1 print \"[#"bn+1"] Kill file: ";:input @2 f$:if not f$ goto kill5 if left$(f$,1)<>"#" gosub name.find:goto kill4 a=val(mid$(f$,2,len(f$)-1)):if a<1 goto kill1 gosub number kill4 if info(5) or (li=un) goto kill3 a$=a1$+" "+a2$:a=len(a$) if (mid$(i$,55,a)<>a$) and (gh<>un) print \"Not your file":goto kill1 kill3 fn$=left$(i$,30) print \"Sure you want to kill? [Y/N]: ";:gosub get.key if i$<>"Y" print "No":goto kill1 print "Yes":bn=bn+1 open #1,rd$+"batch":position #1,30,bn:print #1,x,x$:close goto kill1 kill5 if not bn return print \"Deleting file #00"; open #1,rd$+"batch":open #2,bd$+"dir"+lg$ for a=1 to bn:a$=str$(a):print chr$(8,len(a$));a; position #1,30,a:input #1,x,x$ position #2,95,x:print #2,"EMPTY",x$ kill lg$+":"+x$:kill lg$+":a"+str$(x)+"."+x$ close #1:ul$="Killed file: "+lg$+":"+x$:gosub ed.log open #1,rd$+"batch":next:close #1:close #2:kill rd$+"batch" print " - done.":return ; SysOp page page push link.pae print "Page sysop? "; gosub get.key if i$<>"Y" print "No":return print "Yes" if ps=0 print \"The sysop is not available.":return tone(112,175):tone(75,255) tone(84,50):tone(89,50):tone(99,50):tone(56,255):tone(75,255) tone(84,50):tone(89,50):tone(99,50):tone(56,255):tone(75,255) tone(84,50):tone(89,50):tone(84,50):tone(99,255) print\"The sysop has been paged." info(4)=1 ul$="Paged sysop":gosub ed.log return ; User want list want.list push link.pae want.ls1 print \"Want list" print\"1> View want list" print "2> Add to want list" print "3> Kill your entries" print\"Choice? ";:gosub get.key if (i$="") or (val(i$)<1) or (val(i$)>3) print "Quit":return push want.ls1 print i$\ if i$="2" goto want1 if i$="3" goto want.kill x$="":wx=1:f$=bd$+"wants":gosub log.list if not wx print "No data available." ul$="Viewed want list":gosub ed.log return want1 print "What's the name of your request?" input @2 ": "f$:if f$="" print "Aborted":return if len(f$)>20 print "Invalid entry - max 20 chars":goto want1 f$=f$+chr$(32,20) want2 print \"Type a short description of your request (34 chars max)."\chr$(174,36) input @3 ": "xr$:if xr$="" print "Aborted":return if len(xr$)>34 print "Invalid entry - max 34 chars":goto want2 xr$=xr$+chr$(32,34) p$=a1$+" "+a2$+chr$(32,15) i$=left$(f$,20)+" "+left$(xr$,34)+" "+left$(p$,15) print \i$\\"Acceptable? "; g$=i$:gosub get.key if i$<>"Y" print "No":return print "Yes":i$=g$:f$=bd$+"wants" open #1,f$:if not mark(1) goto nhere close:create f$:open #1,f$:position #1,80,0:print #1,0 for b=1 to nr:position #1,80,b:print #1,"EMPTY":next nhere position #1,80,0:input #1,bb:bb=bb+1:if bb=nr bb=1 position #1,80,0:print #1,bb:position #1,80,bb print #1,i$" #"right$(("0"+str$(bb)),2):close print\"Your request has been added." ul$="Added to want list":gosub ed.log return want.kill input @2 "Delete record #"x:if (not x) or (x>nr) return print \"Reading..."; open #1,bd$+"wants":position #1,80,0:input #1,a if a=0 close:print "no data.":return position #1,80,x:input #1,i$:close if i$="EMPTY" print "nothing.":return f$=a1$+" "+a2$ if (not instr(f$,i$)) and (not info(5)) print "not yours.":return print chr$(8,10)i$\\"Remove this? ";:gosub get.key if i$<>"Y" print "No":return print "Yes":ul$="Deleted from want list":gosub ed.log open #1,bd$+"wants":position #1,80,x:print #1,"EMPTY":close:return ; User activity files activs1 push link.pae activs2 print \"Activities" print\"1> View Uploads" print "2> View Downloads" print "3> View New Uploads" print "4> View New Downloads" print\"Choice? ";:gosub get.key ww=val(i$):if (ww<1) or (ww>4) print "Quit":return print ww if (ww=1) or (ww=3) f$=bd$+"uploads":else f$=bd$+"downloads" x$="":if (ww=3) or (ww=4) gosub new push activs2 wx=1:if f$=bd$+"uploads" print\"Drv:Filename"chr$(95,22)"|PT|_Uploaded by________|U/L date|_Baud____" if f$=bd$+"downloads" print\"Drv:Filename"chr$(95,22)"|PT|_Downloaded by______|D/L date|_Baud____" gosub log.list if not wx print "Nothing." ul$="Viewed recent activities":gosub ed.log return new print \"Enter date to start listing at:" print "([RET] = "lc$"): ";:input @3 x$ if x$="" x$=lc$ if len(x$)<>8 goto new return ; Top uploaders top.uls push link.pae ul$="Viewed top point holders list":gosub ed.log print \\"The top "tt" point holders are:"\ print "##]_Username__________________pnts." clear #10:t1=32766:open #1,bd$+"pae.points" open #2,cd$+"users":for i=1 to tt:x=0:tu=0:for ie=1 to nu position #1,12,ie:input #1,pp,b,b if (pp<=t1) and (pp>x) gosub top3 next:if not tu next:goto top2 print #10,tu:position #2,vr,tu input #2,d1$,d2$ if not d1$ position #1,12,tu:print #1,0,up,dn:next:goto top2 i$=str$(i):if i<10 i$="0"+i$ ch$=i$+"] "+d1$+" "+d2$+chr$(46,30) ch$=left$(ch$,30)+str$(x) setint(1):print ch$:setint(""):if key(1) i=tt:next:print "":goto top2 t1=x:next top2 close #1:close #2:return top3 b=mark(10):mark(10)=0:for a=1 to i:input #10,d if d=ie mark(10)=b:a=i:next:return next:mark(10)=b:tu=ie:x=pp:return ; Copy File w.file push link.pae if not flag(25) print "You don't have copy file access.":return if (l1=1) or (l1=3) print "This drive is in Read Only mode.":return open #1,bd$+"dir"+lg$:position #1,95,0:input #1,a if a30 print \"Invalid filename - max 30 chars":return if left$(i$,1)="#" or instr(":",i$) print \"Illegal filename":return if i$="/" i$=fn$ fn$=i$:x=0 open #1,bd$+"dir"+lg$:position #1,95,0:input #1,a if not a x=1:position #1,95,0:print #1,x:goto copy2 for b=1 to a:position #1,95,b:input #1,f$,x$:j$=left$(f$,len(i$)) if j$=i$ close:b=a:next:print \"File already exists!":return if (f$="EMPTY") and (not x) x=b next:if x goto copy2 x=a+1:position #1,95,0:print #1,x copy2 close:edit(0):print \"Enter Message Now: "edit(3)" cols, 4k max" print "Type 'DONE' when finished '.h' for help" edit(1):if not edit(2) return print \"Saving..."; gosub case.convert i$=lg$+":"+ab$:create i$:open #1,i$ copy #8,#1:close:use cd$+"xdos","getinfo "+i$ sz=peek(edit(5)+21)+peek(edit(5)+22)*256 pb=peek(edit(5)+11)+peek(edit(5)+12)*256 d1$=fn$+chr$(32,30):d1$=left$(d1$,30) d2$=right$("00"+str$(pb),3) d2$=d2$+"/"+right$("000"+str$(sz),4) d3$=a1$+" "+a2$+chr$(32,20):d3$=left$(d3$,20) open #1,bd$+"dir"+lg$:position #1,95,x print #1,d1$" TXT "d2$" "date$" "d3$,ab$:close ul$="Copied file: "+lg$+":"+fn$:gosub ed.log print "done.":return