; Insurance ; Created 09/17/88 on nocar goto no.car create "b:insurance":goto start no.car link "a:main.seg","term1" link.main link "a:games.seg","fromsys" center b=(edit(3)/2)-(len(a$)/2):if b<1 b=1 print chr$(32,b); if flag(32) print chr$(15);a$;chr$(14):return print a$:return show.file setint(1):copy f$:setint(""):return start print sc$ if flag(32) a$=chr$(32,13)+chr$(14,2):gosub center if flag(32) a$=" "+chr$(14)+" Insurance "+chr$(15)+" ":gosub center if flag(32) a$=chr$(32,13)+chr$(14,2):gosub center if not flag(32) a$="%> Insurance <%":gosub center open #1,"b:bank":position #1,6,un:input #1,cr:close open #1,"f:u."+str$(un):position #1,5,15:input #1,in:close if flag(5) gosub check start2 push start2 if clock(2)<>0 print \(clock(2)-clock(1))/60":";:i$=str$((clock(2)-clock(1)) mod 60):if len(i$)<2 i$="0"+i$ if not clock(2) i$=chr$(13)+"00:00" print i$" Command? "; start1 gosub get.key if (i$="*") and (info(5)) flag(5)=not flag(5) if i$="Q" print "Quit...":pop:goto link.main if i$="?" print "Commands -":goto menu if flag(5) goto com2 if i$="C" print "Create company":goto create if i$="D" print "Drop insurance":goto drop if i$="L" print "List companies":goto list if i$="P" print "Purchase insurance":goto purchase if i$="V" print "View your coverage":goto view goto start1 com2 if i$="D" print "Delete your company":goto delete if i$="E" print "Edit your company":goto edit if i$="L" print "List companies":goto list if i$="M" print "Members":goto members if i$="R" print "Remover user":goto remove if i$="V" print "View company status":goto comp.view goto start1 menu if flag(5) goto menu1 setint(1) print ' [C)reate insurance company [D)rop insurance [L)ist companies [P)urchase insurance [V)iew your coverage [Q)uit':setint("") if info(5) print \"[*) Switch menu" return menu1 setint(1) print ' [D)elete your company [E)dit your company [L)ist companies [M)embers of your company [R)emove a user [V)iew your company status [Q)uit':setint(""):return drop if not in print \"You have no insurance!":return print \"Do you really wish to do this? ";:gosub get.key if i$<>"Y" print "No":return print "Yes"\"Cancelling insurance..."; open #1,"f:u."+str$(un):position #1,5,15:input #1,u position #1,5,15:print #1,0:close open #1,"b:insurance":position #1,48,u:input #1,i$,u,f,p,d:close edit(0):ready "e:gmail":gosub date1 print #msg(u),un:print #6,'Letter From -%>Insurance Date Mailed -%>'i$\ print #6,a4$" (#"un") has dropped your insurance company." copy #8,#6:print #msg(u),chr$(4);chr$(0);:msg(u)=msg(u)+1:update in=0:print "done.":return purchase if in print \"You already have insurance!":return gosub list:if not fx return input @1 \"Join company #"a if (a<1) or (a>fx) return open #1,"f:u."+str$(un):position #1,5,15:print #1,a:close open #1,"b:insurance":position #1,48,a:input #1,i$,u,f,p,d:close edit(0):ready "e:gmail":gosub date1 print #msg(u),un:print #6,'Letter From -%>Insurance Date Mailed -%>'i$\ print #6,a4$" (#"un") joined your insurance company." copy #8,#6:print #msg(u),chr$(4);chr$(0);:msg(u)=msg(u)+1:update in=a:return members d=xx if flag(4) input @2 \"For company #"xx:if (xx<1) or (xx>nu) xx=d print \"Users who own your insurance:"\ open #2,"b:users" for a=1 to nu:open #1,"f:u."+str$(a) position #1,5,15:input #1,b:close #1 if b<>xx goto member2 print "#"a" - "; position #2,64,a:input #2,d4$,d2$ if d2$<>"." d4$=d4$+" "+d2$ if d1$="" d4$="<< Deleted >>" print d4$ member2 next:close #2 print \"[ End of List ]" xx=d:return remove d=xx if flag(4) input @2 \"For company #"xx:if (xx<1) or (xx>nu) xx=d gosub to.who:a=d if (a<1) or (a=un) return open #1,"f:u."+str$(a):position #1,5,15:input #1,b:close if b<>xx print \"That user isn't with your company!":return print \"Remove "d1$" "d2$"? ";:gosub get.key if i$<>"Y" print "No":return:else print "Yes" remove2 open #1,"f:u."+str$(a):position #1,5,15:print #1,0:close if d1$="" goto remove3 edit(0):gosub date1:ready "e:gmail":print #msg(a),un print #6,'Letter From -%>Insurance Date Mailed -%>'i$' Your insurance company has dropped your coverage.' copy #8,#6:print #msg(a),chr$(4);chr$(0);:msg(a)=msg(a)+1:update remove3 print \"User has been removed.":return list print ' Current insurance companies: ##)_Name_of_Insurance____________|_Owner__________________|Fee%|Pay%|Dedct|' open #1,"b:insurance":position #1,48,0:input #1,fx if not fx close:print "No insurance companies created!":return open #2,"b:users" for b=1 to fx:position #1,48,b:input #1,i$,u,f,p,d if i$="EMPTY" next:close #1:close #2:return position #2,64,u:input #2,d1$,d2$:d4$=d1$:if d2$<>"." d4$=d4$+" "+d2$ if d1$="" position #1,48,b:print #1,"EMPTY",0,0,0,0 if d1$="" next:close #1:close #2:return i$=left$(i$+chr$(32,30),30):a$=left$(d4$+chr$(32,24),24) f$=str$(f)+"%":f$=chr$(32,4-len(f$))+f$ p$=str$(p)+"%":p$=chr$(32,4-len(p$))+p$ d$=str$(d):d$=chr$(32,5-len(d$))+d$ if len(str$(b))<10 print "0"; print b")"i$"|"a$"|"f$"|"p$"|"d$"|" next:close #1:close #2:return create if in print \"You must first drop your insurance.":return if cr<9500 print \"You need at least 9,500 credits in your bank.":return print ' The name of your company can be up to 30 characters long. "Fee" is the percentage of credits the users must pay you on each of their calls. "Pay" is the percentage of credits your company will reimburse to a user who had some stolen from them. For instance, if a user lost 4,800 credits, and your payback percentage is 15%, your company will pay them 720 credits. The deductable is the minimum amount of credits the user MUST pay each call if the fee percentage is less than the deductable. If a user cannot afford the deductable, his coverage is dropped automatically. All paybacks are taken from your bank account. All fees are added to your bank account.' create1 input @3 \"Enter name of company: "i$:if len(i$)>30 goto create1 if len(i$)<2 return create2 input @1 "Fee: "f:if f>100 print \"Max is 100%"\:goto create2 if f<0 return create3 input @1 "Pay: "p:if p>100 print \"Max is 100%"\:goto create3 if p<0 return create4 input @1 "Deductable: "d:if d>32000 print \"Max is 32,000"\:goto create4 if d<0 return flag(5)=1:print \"Creating company..."; open #1,"b:insurance":position #1,48,0:input #1,a if a<1 position #1,48,0:print #1,1:position #1,48,1:print #1,i$,un,f,p,d if a<1 xx=1:goto create.end for b=1 to a:position #1,48,b:input #1,a$,x,x,x,x if a$="EMPTY" position #1,48,b:print #1,i$,un,f,p,d if a$="EMPTY" xx=b:b=a:next:goto create.end next:a=a+1:xx=a:position #1,48,0:print #1,a position #1,48,a:print #1,i$,un,f,p,d create.end close:print "done.":return view if not in print \"You have no insurance!":return print \"Your company's status:"\ open #1,"b:insurance":position #1,48,in:input #1,n$,u,f,p,d:close goto comp1 comp.view print \"Your current status:"\ open #1,"b:insurance":position #1,48,xx:input #1,n$,u,f,p,d:close comp1 print "Name of company: "n$ print " Fee: "f"%" print " Pay: "p"%" print " Deductable: "d return edit d=xx if flag(4) input @2 \"For company #"xx:if (xx<1) or (xx>nu) xx=d print \"Your current status:"\ open #1,"b:insurance":position #1,48,xx:input #1,n$,u,f,p,d print "Name of company: "n$ print " Fee: "f"%" print " Pay: "p"%" print " Deductable: "d print \"Change this? ";:gosub get.key if i$<>"Y" print "No":close:return print "Yes"\:if not info(5) goto edit2 input @3 "Name of company: "i$:if i$="" print n$:goto edit2 n$=left$(i$,30) edit2 input @1 "Fee: "f:if (f<1) or (f>100) goto edit2 edit3 input @1 "Pay: "p:if (p<1) or (p>100) goto edit3 edit4 input @1 "Deductable: "d:if (d<1) or (d>32000) goto edit4 print \"Changing status..."; position #1,48,xx:print #1,n$,un,f,p,d:close print "done.":return delete d=xx if flag(4) input @2 \"Delete company #"xx:if (xx<1) or (xx>nu) xx=d print \"Delete your company? ";:gosub get.key if i$<>"Y" print "No":return print "Yes":open #1,"b:insurance":position #1,48,xx print #1,"EMPTY",0,0,0,0:close flag(5)=0:return ; Reset account check open #1,"b:insurance":position #1,48,0:input #1,a for b=1 to a:position #1,48,b:input #1,i$,u,f,p,d if u=un xx=b:b=a:next:close:return next:close:print \"Records indicate you don't own an insurance company." open #1,"f:u."+str$(un):position #1,5,15:print #1,0:close in=0:xx=0:flag(5)=0:return ; Subroutines date1 q=val(left$(date$,2)):q1=val(mid$(date$,4,2)):q2=val(right$(date$,2)) m$="000031059090120151181212243273304334":if q>1 q3=val(mid$(m$,q*3-2,3)) q1=q1+q3:m$="46012356":q1=q1+val(mid$(m$,8-(94-q2),1)):q1=q1 mod 7 m$="BobMonTueWedThuFriSat":if q1>1 td$=mid$(m$,q1*3-2,3):else td$="Sun" ml$="085534469788":q3=0:for q4=1 to q-1:q3=q3+val(mid$(ml$,q4,1):next mt$="FebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember" if q>1 m$=mid$(mt$,q3+1,val(mid$(ml$,q4+1,1))):else m$="January" min$=mid$(time$,4,2):if len(time$)>8 tm$=time$:goto date2 if val(left$(time$,2))<12 tm$=left$(time$,2)+":"+min$+"AM":goto date2 q4=val(left$(time$,2)):tm$=str$(12-(24-q4))+":"+min$+"PM" date2 i$=td$+", "+m$+" "+mid$(date$,4,2)+" "+tm$ return ; User entry routine to.who print \"What user? [1-"nu;:input @2 ",Q]: "i$ if (i$="") or (i$="Q") d=0:return if left$(i$,1)="#" i$=mid$(i$,2):goto snd.num if val(left$(i$,1)) goto snd.num d$=i$:if (d$="SYSOP") or (d$=sys$) d=1:return gosub lower.case:d$=ab$ kill "l:matches":create "l:matches" open #2,"l:matches" open #1,"b:users":d=1:gf=0 snd.user position #1,64,d input #1,d4$,i$:if i$<>"." d4$=d4$+" "+i$ if d4$=d$ close #1:close #2:return if instr(d$,d4$) position #2,30,gf:print #2,d,d4$:gf=gf+1 if dnu) goto snd.usr2 open #1,"b:users" position #1,64,d:input #1,d4$,i$:close #1 if d4$="" goto snd.usr2 if i$<>"." d4$=d4$+" "+i$:d0$=d4$+"? " snd.num2 print \d0$; gosub get.key:if i$<>chr$(14) an=0:goto snd.num1 print chr$(8,len(d0$));chr$(32,len(d0$));chr$(8,len(d0$)); print "Do it anonymously? "; gosub get.key:if i$<>"Y" print "No":goto snd.num2 an=1 snd.num1 if i$<>"Y" d=0:print "No":else print "Yes" return get.key ww=0:wx=0 get.key1 gf=clock(2) if (gf<>0) and (clock(1)>gf) print \\"[ Time Limit Exceeded ]":pop:goto no.car gf=peek(-16384):if (gf=129) or (gf=150) get i$:print chr$(8);:return gf=key(0):if (gf>96) and (gf<123) gf=gf-32 if (gf>31) or (gf=13) i$=chr$(gf):return ww=ww+1:if flag(33)=0 goto get.key2 wx=wx+1:if wx>16 wx=1 print mid$("!/-\!/-\!\-/!\-/",wx,1);chr$(8); get.key2 if ww=2000 print chr$(7,2); if ww=4000 pop:goto no.car if (not info(0)) and (not info(5)) and (eu<>1) pop:goto no.car goto get.key1 lower.case if len(i$)=1 ab$=i$:return ab$=left$(i$,1):for wy=2 to len(i$):wx=asc(mid$(i$,wy,1)) if wx=32 ab$=ab$+" "+mid$(i$,wy+1,1):wy=wy+1:next:return if (wx<65) or (wx>96) ab$=ab$+chr$(wx):next:return ab$=ab$+chr$(wx+32):next:return