urbit/main/app/talk/core.hook

691 lines
23 KiB
Plaintext
Raw Normal View History

2014-12-10 23:09:01 +03:00
::
:::: /hook/core/talk/app
::
/? 314
2015-02-14 03:37:40 +03:00
/- *console, *rodeo
/+ console, rodeo
2014-12-10 23:09:01 +03:00
::
::::
::
!:
2015-01-01 23:43:50 +03:00
=> |% :: structures
++ town :: all client state
2015-02-14 03:37:40 +03:00
$: %0 :: version
seat=console-share :: command lines
live=(unit span) :: present story
2015-01-01 23:43:50 +03:00
stories=(map span story) :: all stories
== ::
++ grip :: subscription state
|* nub=$+(* *) :: wrapped state
2015-01-04 09:24:48 +03:00
$| $? %warm :: activated
%cool :: activating
%dead :: inoperative
%cold :: inactive
== [%live p=nub] :: operating
2015-01-01 23:43:50 +03:00
++ terminal :: terminal state
$: present=presence :: presence state
== ::
2015-01-26 04:38:03 +03:00
++ story :: station content
$: poe=posture :: security posture
desc=@t :: description
link=(grip bridge) :: connection
2015-01-01 23:43:50 +03:00
count=@ud :: message counter
2015-01-26 04:38:03 +03:00
mike=(pair ,? (set partner)) :: passive/voice
2015-01-01 23:43:50 +03:00
quiet=? :: !verbose
2015-01-26 04:38:03 +03:00
past=(list partner) :: past received auds
2015-01-01 23:43:50 +03:00
== ::
2015-01-04 09:24:48 +03:00
++ bridge :: remote state
$: xm=config :: configuration
am=register :: presence
2015-01-01 23:43:50 +03:00
== ::
++ work :: general action
$% [%ask (unit work)] :: help (about)
[%exp twig] :: compute
[%mor (list work)] :: sequence
[%rub work-adjust] :: configure story
[%say speech] :: publish in voice
2015-01-26 04:38:03 +03:00
[%who (unit partner)] :: show presence
2015-01-04 09:24:48 +03:00
[%wry work-construct] :: configure system
2014-12-12 00:32:59 +03:00
== ::
2015-01-01 23:43:50 +03:00
++ work-adjust :: adjust story
$% [%dark p=(set ship)] :: toggle blacklist
[%lite p=(set ship)] :: toggle whitelist
2015-01-26 04:38:03 +03:00
[%love p=(set partner)] :: toggle partners
[%whom p=? q=(set partner)] :: active/voice
2015-01-01 23:43:50 +03:00
[%wind p=@dr] :: rewind by date
2014-12-10 23:09:01 +03:00
== ::
2015-01-01 23:43:50 +03:00
++ work-construct :: configure system
$% [%make p=span] :: create story
[%raze p=span] :: destroy story
[%tune p=span] :: switch to story
2014-12-10 23:09:01 +03:00
== ::
++ gift
$% [%mean ares]
[%nice ~]
2015-02-14 03:37:40 +03:00
[%rush %console-effect console-effect]
2014-12-10 23:09:01 +03:00
==
++ hapt ,[p=ship q=path]
++ move ,[p=bone q=(mold note gift)]
++ note
$? $: %g
$% [%mess p=hapt q=ship r=cage]
[%nuke p=hapt q=ship]
[%show p=hapt q=ship r=path]
2015-01-21 02:00:54 +03:00
[%took p=hapt q=ship]
2014-12-17 21:05:38 +03:00
== ==
2015-01-01 23:43:50 +03:00
$: %t
$% [%wait p=@da]
== == ==
++ gall-sign :: subscription result
2014-12-10 23:09:01 +03:00
$% [%mean p=ares]
[%nice ~]
$: %rush
$= p
2015-01-01 23:43:50 +03:00
$% [%txt p=cord] :: input text
[%type p=?] :: typing notify
2015-01-15 22:32:04 +03:00
[%rodeo-report p=report]
2014-12-10 23:09:01 +03:00
== ==
2015-01-01 23:43:50 +03:00
==
++ sign
$? [%g gall-sign] :: from %gall
$: %t :: from %time
2014-12-17 21:05:38 +03:00
$% [%wake ~] :: timer wakeup
2014-12-10 23:09:01 +03:00
== == ==
--
!:
::::
::
2015-01-06 02:59:57 +03:00
=> |% :: tools
2015-01-06 23:31:36 +03:00
++ hy :: messenger
2015-02-15 13:25:57 +03:00
|_ [[moz=(list move)] hide]
2015-01-06 23:31:36 +03:00
++ hy-abet moz :: resolve core
2015-02-14 03:37:40 +03:00
++ hy-transmit :: send to radio
2015-01-06 23:31:36 +03:00
|= cod=command
%_ +>
moz :_ moz
2015-01-15 22:32:04 +03:00
[0 %pass /command %g %mess [our /rodeo] our [%rodeo-command !>(cod)]]
2015-01-06 23:31:36 +03:00
==
::
2015-02-15 13:25:57 +03:00
++ hy-general :: serve all peers
2015-02-14 03:37:40 +03:00
|= fec=console-effect
2015-01-06 23:31:36 +03:00
%_ +>
moz
2015-02-14 03:37:40 +03:00
=+ oss=(~(tap in (~(get ju pus) /console)))
2015-01-06 23:31:36 +03:00
|- ^- (list move)
?~ oss moz
2015-02-14 03:37:40 +03:00
[`move`[i.oss %give %rush %console-effect fec] $(oss t.oss)]
2015-01-06 23:31:36 +03:00
==
::
++ hy-subscribe :: send %show
|= [way=path hoc=path]
2015-01-15 22:32:04 +03:00
%_(+> moz :_(moz [0 %pass way %g %show [our /rodeo] our hoc]))
2015-01-06 23:31:36 +03:00
::
++ hy-unsubscribe :: send %nuke
|= way=path
2015-01-15 22:32:04 +03:00
%_(+> moz :_(moz [0 %pass way %g %nuke [our /rodeo] our]))
2015-01-06 23:31:36 +03:00
::
++ hy-display :: print to console
2015-02-15 13:25:57 +03:00
|=(tay=(list tank) (hy-general %tan tay))
2015-01-06 23:31:36 +03:00
::
++ hy-print :: simple print
|=(tep=tape (hy-display [%leaf tep]~))
::
++ hy-accept :: set prompt
2015-02-15 13:25:57 +03:00
|=(asq=cord (hy-general %pro & %gar (tuba (trip asq))))
2015-01-06 23:31:36 +03:00
--
::
2015-01-01 23:43:50 +03:00
++ parse :: command parser
2015-01-04 09:24:48 +03:00
|= our=ship
2015-01-01 23:43:50 +03:00
=+ vag=(vang | [&1:% &2:% '0' |3:%])
|%
++ come :: keyword command
|* [a=@tas b=_rule]
;~((glue (plus ace)) (cold a (jest a)) b)
::
++ gone :: parse unit
|* a=_rule
;~(pose (stag ~ a) (easy ~))
::
++ posh :: parse each
|* [a=_rule b=_rule]
;~(pose (stag %& a) (stag %| b))
::
++ ship ;~(pfix sig fed:ag) :: ship
++ shiz :: ship set
%+ cook
|=(a=(list ^ship) (~(gas in *(set ^ship)) a))
(most ;~(plug com (star ace)) ship)
::
2015-01-26 04:38:03 +03:00
++ stat :: partner
2015-01-01 23:43:50 +03:00
%+ posh
2014-12-18 21:37:36 +03:00
;~ plug
2015-01-01 23:43:50 +03:00
ship
2015-01-04 09:24:48 +03:00
;~(pose ;~(pfix fas urs:ab) (easy (main our)))
2015-01-01 23:43:50 +03:00
==
2015-01-27 07:12:06 +03:00
;~ pose
;~(pfix pat (stag %twitter urs:ab))
2014-12-18 21:37:36 +03:00
==
2015-01-01 23:43:50 +03:00
::
2015-01-26 04:38:03 +03:00
++ staz :: partner set
2015-01-01 23:43:50 +03:00
%+ cook
2015-01-26 04:38:03 +03:00
|=(a=(list partner) (~(gas in *(set partner)) a))
2015-01-01 23:43:50 +03:00
(most ;~(plug com (star ace)) stat)
::
++ step :: rollback interval
%+ sear
|= a=coin
?. ?=([%$ %dr @] a) ~
(some `@dr`+>.a)
nuck:so
::
++ text (boss 256 (star prn)) :: utf8 text
++ tome
%+ stag %lin
;~ pose
(stag %| ;~(pfix pat text))
(stag %& text)
==
::
++ work :: all commands
%+ knee *^work |. ~+
;~ pose
;~ pfix zap
%+ stag %wry
;~ pose
(come %make urs:ab)
(come %raze urs:ab)
(come %tune urs:ab)
==
==
::
;~ pfix cen
%+ stag %rub
;~ pose
(come %dark shiz)
(come %lite shiz)
(come %whom (stag %& staz))
(come %wind step)
==
==
::
;~(pfix wut (stag %ask (gone work)))
;~(pfix tis (stag %who (gone stat)))
;~(pfix cen (stag %exp wide:vag))
::
%+ cook
2015-01-26 04:38:03 +03:00
|= [a=(set partner) b=(unit ,[%lin p=? q=@t])]
2015-01-01 23:43:50 +03:00
^- ^work
=. b ?~(b ~ ?:(=(0 q.u.b) ~ b))
=+ c=[%rub %whom %& a]
?~(b c [%mor c [%say u.b] ~])
;~ plug
staz
(gone ;~(pfix (star ace) tome))
==
::
(stag %say tome)
==
--
2015-01-06 02:59:57 +03:00
::
2015-01-26 04:38:03 +03:00
++ swatch :: print partner set
|= [our=ship tou=(set partner)]
2015-01-06 02:59:57 +03:00
=+ tuo=(~(tap in tou))
|- ^- tape
?~ tuo ~
=+ ted=$(tuo t.tuo)
=+ ^= ind ^- tape
?- -.i.tuo
%& =+ sip=(scow %p p.p.i.tuo)
?: =((main p.p.i.tuo) q.p.i.tuo)
sip
:(welp sip "/" (trip q.p.i.tuo))
2015-01-27 07:12:06 +03:00
%| ['@' (trip p.p.i.tuo)]
2015-01-06 02:59:57 +03:00
==
?~ ted ind
(welp ind `tape`[',' ' ' ted])
::
2015-01-01 23:43:50 +03:00
++ stog :: toggle set
|* [tog=(set) tag=(set)]
=+ got=(~(tap in tog))
|- ^+ tag
?~ got tag
%= $
got t.got
tag ?: (~(has in tag) i.got)
(~(del in tag) i.got)
(~(put in tag) i.got)
==
--
2014-12-10 23:09:01 +03:00
!:
::::
::
2015-01-01 23:43:50 +03:00
|_ [hid=hide town]
2015-02-15 13:25:57 +03:00
++ hype :: global messenger
|=([moz=(list move)] ~(. hy moz hid))
::
2015-01-01 23:43:50 +03:00
++ sy
2015-02-15 13:25:57 +03:00
|_ $: $: ost=bone :: cause
man=span :: u.live
2015-01-01 23:43:50 +03:00
moz=(list move) :: pending moves
== ::
story :: current story
==
2014-12-18 05:29:32 +03:00
::
2015-01-01 23:43:50 +03:00
++ sy-abet :: resolve core
2015-01-04 09:24:48 +03:00
^- [(list move) _+>]
[(flop moz) +>(stories (~(put by stories) man +<+))]
::
2015-01-04 09:24:48 +03:00
++ sy-subscribe :: story subscribe
2015-01-06 02:59:57 +03:00
?> =(%cold link)
=+ cub=?.(=(0 count) (scot %ud count) (scot %da (sub lat.hid ~d1)))
=. + (sy-message "subscribe <{(trip cub)}>")
%_ +
2015-01-04 09:24:48 +03:00
link %cool
2015-01-06 23:31:36 +03:00
moz =< hy-abet
%+ hy-subscribe:(hype moz)
2015-02-14 03:37:40 +03:00
/story/[man]
2015-01-07 04:27:02 +03:00
:~ %afx
2015-01-06 23:31:36 +03:00
man
?: =(0 count)
2015-01-21 02:53:44 +03:00
:: ~& [%story-init man `@da`(sub lat.hid ~d1)]
2015-01-06 23:31:36 +03:00
(scot %da (sub lat.hid ~d1))
(scot %ud count)
==
==
2015-01-01 23:43:50 +03:00
::
2015-01-04 09:24:48 +03:00
++ sy-unsubscribe :: story unsubscribe
2015-01-06 02:59:57 +03:00
?: =(& ?=(?(%cold %dead) link)) .
2015-01-01 23:43:50 +03:00
%_ .
2015-01-04 09:24:48 +03:00
link %cold
2015-02-14 03:37:40 +03:00
moz hy-abet:(hy-unsubscribe:(hype moz) /story/[man])
2015-01-01 23:43:50 +03:00
==
::
++ sy-serial :: make serial no
^- [serial _.]
[(shaf %serial eny.hid) .(eny.hid (shax eny.hid))]
::
++ sy-audience :: speech audience
%- ~(gas by *audience)
2015-01-26 04:38:03 +03:00
%+ turn `(list partner)`[[%& our.hid man] (~(tap in q.mike))]
|=(a=partner [a *envelope %pending])
2015-01-01 23:43:50 +03:00
::
2015-02-14 03:37:40 +03:00
++ sy-awake :: introduce prompt
%_ .
moz
=< hy-abet
:- hy-accept:(hype moz)
(crip (sy-prompt q.mike))
==
::
++ sy-voice :: set targets
|= [pas=? tou=(set partner)]
?: &(!p.mike pas) +>
%_ +>.$
mike [pas tou]
moz hy-abet:(hy-accept:(hype moz) (crip (sy-prompt tou)))
==
::
2015-01-01 23:43:50 +03:00
++ sy-message :: print message
|= msg=tape
2015-01-06 23:31:36 +03:00
%_(+> moz hy-abet:(hy-print:(hype moz) ":{(trip man)}: {msg}"))
2015-01-06 02:59:57 +03:00
::
++ sy-present
|= [msg=tape tay=(list tank)]
=. tay (welp tay `(list tank)`[%leaf "::"]~)
=. tay :_(tay [%leaf ":{(trip man)}: {msg}:: "])
2015-01-23 04:24:04 +03:00
%_(+>.$ moz hy-abet:(hy-display:(hype moz) tay))
2015-01-06 02:59:57 +03:00
::
++ sy-prompt
2015-01-26 04:38:03 +03:00
|= tou=(set partner)
2015-01-06 02:59:57 +03:00
^- tape
;: welp
(scow %p our.hid)
2015-01-15 22:10:29 +03:00
?:(=(man (main our.hid)) "" `tape`:(welp "/" (trip man)))
2015-01-06 02:59:57 +03:00
?~ tou "& "
2015-01-07 04:27:02 +03:00
`tape`:(welp "(" (swatch our.hid tou) ")& ")
2015-01-06 02:59:57 +03:00
==
2015-01-01 23:43:50 +03:00
::
++ sy-voice :: set targets
2015-01-26 04:38:03 +03:00
|= [pas=? tou=(set partner)]
2015-01-06 02:59:57 +03:00
?: &(!p.mike pas) +>
2015-01-06 23:31:36 +03:00
%_ +>.$
mike [pas tou]
moz hy-abet:(hy-accept:(hype moz) (crip (sy-prompt tou)))
==
2015-01-01 23:43:50 +03:00
::
++ sy-rollback
|= lon=@dr
!!
::
2015-01-04 09:24:48 +03:00
++ sy-work :: run user command
2015-01-01 23:43:50 +03:00
|= job=work
^+ +>
?- -.job
2015-01-27 07:35:03 +03:00
%ask ~|(%sy-work-ask-stub !!)
%exp ~|(%sy-work-exp-stub !!)
2015-01-01 23:43:50 +03:00
%mor
|- ^+ +>.^$
?~ +.job +>.^$
$(+.job t.+.job, +>.^$ ^$(job i.+.job))
::
%rub
2015-01-04 09:24:48 +03:00
?: ?=(%whom +<.job)
(sy-voice +>.job)
?: ?=(%wind +<.job)
~& %rub-wind-stub
!!
=+ suz=sy-live
?~ suz (sy-message "not connected")
?- +<.job
2015-01-26 04:38:03 +03:00
%lite sz-abet:(sz-cordon:u.suz [%white +>.job])
%dark sz-abet:(sz-cordon:u.suz [%black +>.job])
2015-01-04 09:24:48 +03:00
%love sz-abet:(sz-sources:u.suz +>.job)
2014-12-12 00:32:59 +03:00
==
2015-01-04 09:24:48 +03:00
::
2015-01-01 23:43:50 +03:00
%say
=^ sir +>.$ sy-serial
2015-01-06 23:31:36 +03:00
%= +>.$
moz
=< hy-abet
%- ~(hy-transmit hy moz hid)
2015-01-26 04:38:03 +03:00
[%publish [[sir sy-audience [lat.hid ~ +.job]] ~]]
2015-01-06 23:31:36 +03:00
==
2015-01-01 23:43:50 +03:00
::
2015-01-27 07:35:03 +03:00
%wry ~|(%sy-work-wry !!)
%who ~|(%sy-work-who-stub !!)
2014-12-16 01:00:00 +03:00
==
2015-01-04 09:24:48 +03:00
::
++ sy-gram :: apply telegram
2015-01-06 23:31:36 +03:00
|= [num=@ud gam=telegram]
2015-01-04 09:24:48 +03:00
^+ +>
%= +>
moz
2015-01-06 23:31:36 +03:00
=< hy-abet
2015-02-15 13:25:57 +03:00
%- hy-general:(hype moz)
2015-01-04 09:24:48 +03:00
=* sta r.q.gam
2015-01-27 07:35:03 +03:00
?+ -.r.sta ~|([%strange-gram -.r.sta] !!)
2015-01-04 09:24:48 +03:00
::
2015-01-06 23:31:36 +03:00
%lin
:- %txt
2015-02-14 03:37:40 +03:00
%- trip
2015-01-06 23:31:36 +03:00
%+ rap 3
2015-01-07 04:27:02 +03:00
:~ (scot %ud num) ')'
2015-01-26 04:38:03 +03:00
(scot %p p.gam) ?:(p.r.sta ': ' ' ')
q.r.sta
2015-01-04 09:24:48 +03:00
==
==
==
::
++ sy-grams :: apply telegrams
|= [num=@ud gaz=(list telegram)]
^+ +>
2015-01-21 02:53:44 +03:00
:: ~& [%sy-grams [num count] (lent gaz)]
2015-01-06 02:59:57 +03:00
?: (gth num count)
(sy-message(count 0) "message gap: {<num>} at {<count>}")
2015-01-04 09:24:48 +03:00
=. .
?: =(num count) .
.(num count, gaz (slag (sub count num) gaz))
2015-01-06 02:59:57 +03:00
=+ las=(add count (lent gaz))
2015-01-04 09:24:48 +03:00
|- ^+ +>.^$
2015-01-06 02:59:57 +03:00
?~ gaz +>.^$(count las)
2015-01-06 23:31:36 +03:00
$(gaz t.gaz, count +(count), +>.^$ (sy-gram num i.gaz))
2015-01-04 09:24:48 +03:00
::
++ sy-error :: report error
|= ars=ares
%= +>
moz
2015-01-06 23:31:36 +03:00
=< hy-abet
%- hy-print:(hype moz)
?~(ars "connection error" "disaster: (trip p.u.ars)")
2015-01-04 09:24:48 +03:00
==
::
++ sy-sign :: subscription sign
|= res=gall-sign
^+ +>
2015-01-06 02:59:57 +03:00
:: ~& [%sy-sign res]
2015-01-04 09:24:48 +03:00
?- -.res
%mean
=. link %dead
(sy-error p.res)
::
%nice :: misordered, ignore
:: ?. ?=(%cool link)
2015-01-06 02:59:57 +03:00
:: ~& [%sy-sign-nice-bad link]
2015-01-04 09:24:48 +03:00
:: +>.$
::+>(link %warm)
+>.$
::
2015-01-21 02:00:54 +03:00
%rush :: direct update
2015-01-04 09:24:48 +03:00
?: ?=(?(%cold %dead) link)
2015-01-06 02:59:57 +03:00
~& [%sy-sign-rust-bad `@tas`link]
2015-01-04 09:24:48 +03:00
+>.$
2015-01-15 22:32:04 +03:00
?> ?=(%rodeo-report +<.res)
2015-01-04 09:24:48 +03:00
?: ?=(%cool link)
:: XX workaround for inverted nice
$(link %warm)
=+ suz=sy-live
?~ suz (sy-message "not connected")
sz-abet:(sz-apply:u.suz +>.res)
==
::
++ sy-live :: as connected
^- (unit ,_sz)
?: ?=([%live *] link)
`~(. sz p.link)
?.(?=(%warm link) ~ `~(. sz *bridge))
::
++ sz :: story, connected
|_ big=bridge
++ sz-abet %_(+> link [%live big]) :: resolve to ++sy
++ sz-amok
|= why=?(%cold %cool %dead %warm)
%_(+>+> link why)
::
++ sz-cordon :: design cordon
2015-01-26 04:38:03 +03:00
|= con=control
2015-01-04 09:24:48 +03:00
^+ +>
=. cordon.xm.big
2015-01-26 04:38:03 +03:00
?: =(p.cordon.xm.big p.con)
[p.con (stog q.con q.cordon.xm.big)]
con
2015-01-06 23:31:36 +03:00
+>.$(moz hy-abet:(hy-transmit:(hype moz) [%design man ~ xm.big]))
2015-01-04 09:24:48 +03:00
::
++ sz-sources :: design sources
2015-01-26 04:38:03 +03:00
|= src=(set partner)
2015-01-04 09:24:48 +03:00
^+ +>
=. sources.xm.big (stog src sources.xm.big)
2015-01-06 23:31:36 +03:00
+>.$(moz hy-abet:(hy-transmit:(hype moz) [%design man ~ xm.big]))
2015-01-04 09:24:48 +03:00
::
++ sz-config :: apply config
|= cof=config
2015-01-06 02:59:57 +03:00
=. +>+> (sy-present "config" >cof< ~)
:: ~& [%sz-config cof]
%_(+> xm.big cof, +> (sy-voice %& sources.cof))
2015-01-04 09:24:48 +03:00
::
++ sz-group :: apply register
|= rex=register
=. +>+> (sy-present "register" >rex< ~)
2015-01-04 09:24:48 +03:00
%_(+> am.big rex)
::
++ sz-apply :: apply report
|= rad=report
^+ +>
?- -.rad
2015-01-27 07:35:03 +03:00
%house ~|(%sz-apply-house !!)
2015-01-04 09:24:48 +03:00
%grams +>(+> (sy-grams +.rad))
%config (sz-config +.rad)
%group (sz-group +.rad)
==
--
2015-01-01 23:43:50 +03:00
--
++ ny :: top configuration
2015-02-15 13:25:57 +03:00
|_ [ost=bone moz=(list move)]
2015-01-01 23:43:50 +03:00
++ ny-abet :: resolve core
2015-01-04 09:24:48 +03:00
^- [(list move) _+>]
[(flop moz) +>]
2015-01-01 23:43:50 +03:00
::
++ ny-amid :: integrate story
|= nov=_sy
2015-01-04 09:24:48 +03:00
=^ zom +>+> sy-abet:nov
2015-02-14 03:37:40 +03:00
+>.$(moz (weld (flop zom) moz))
2015-01-01 23:43:50 +03:00
::
++ ny-tune :: connect to story
|= man=span
^+ +>
?: =(`man live)
2015-01-06 23:31:36 +03:00
+>(moz hy-abet:(hy-print:(hype moz) "already tuned to {(trip man)}"))
2015-01-01 23:43:50 +03:00
?. (~(has by stories) man)
2015-01-06 23:31:36 +03:00
+>(moz hy-abet:(hy-print:(hype moz) "no story {(trip man)}"))
2015-01-01 23:43:50 +03:00
=. +> ny-stop
=. live `man
2015-01-06 02:59:57 +03:00
:: ~& [%tune-start man]
2015-02-15 13:25:57 +03:00
(ny-amid sy-subscribe:sy-awake:(need (novel ost moz)))
2015-01-01 23:43:50 +03:00
::
++ ny-stop :: disconnect story
^+ .
?~ live .
2015-02-15 13:25:57 +03:00
(ny-amid(live ~) sy-unsubscribe:(need (novel ost moz)))
2015-01-01 23:43:50 +03:00
::
++ ny-tell :: hear from server
2015-01-26 04:38:03 +03:00
|= sap=(map span (pair posture cord))
2015-01-01 23:43:50 +03:00
^+ +>
2015-01-26 04:38:03 +03:00
=. +> ?.(&(?=(^ live) !(~(has by sap) u.live)) +> ny-stop)
2015-01-01 23:43:50 +03:00
=. stories
2015-01-26 04:38:03 +03:00
=+ pas=(~(tap by sap))
=+ ros=(skim (~(tap by stories)) |=([a=span *] (~(has by sap) a)))
2015-01-01 23:43:50 +03:00
%- ~(gas by *(map span story))
|- ^- (list (pair span story))
2015-01-26 04:38:03 +03:00
?~ pas
%+ turn ros
|= [a=span b=story]
=+ hig=(~(get by sap) a)
[a ?~(hig b b(poe p.u.hig, desc q.u.hig))]
2015-01-01 23:43:50 +03:00
=+ sor=$(pas t.pas)
2015-01-26 04:38:03 +03:00
?: (~(has by stories) i.pas)
sor
=+ soy=*story
[[p.i.pas soy(poe p.q.i.pas, desc q.q.i.pas)] sor]
2015-01-01 23:43:50 +03:00
?^ live +>.$
?~ stories +>.$
2015-01-04 09:24:48 +03:00
?: (~(has by `(map span story)`stories) (main our.hid))
(ny-tune (main our.hid))
2015-01-01 23:43:50 +03:00
(ny-tune p.n.stories)
::
++ ny-work :: user command
|= jaw=work-construct
^+ +>
2015-01-26 04:38:03 +03:00
?- -.jaw
%raze +>(moz hy-abet:(hy-transmit:(hype moz) [%design p.jaw ~]))
%tune (ny-tune p.jaw)
%make
%= +>
moz
2015-02-15 13:25:57 +03:00
=< hy-abet
(hy-transmit:(hype moz) [%design p.jaw [~ ~ %default %black ~]])
2015-01-26 04:38:03 +03:00
==
2014-12-18 21:37:36 +03:00
==
2015-01-01 23:43:50 +03:00
--
2014-12-12 00:32:59 +03:00
::
2015-01-01 23:43:50 +03:00
++ novel :: live story
2015-02-15 13:25:57 +03:00
|= [ost=bone moz=(list move)]
2015-01-01 23:43:50 +03:00
^- (unit ,_sy)
?~ live ~
2015-02-15 13:25:57 +03:00
`~(. sy [ost u.live moz] (~(got by stories) u.live))
2014-12-18 02:40:43 +03:00
::
2015-01-06 02:59:57 +03:00
++ peer
|= [ost=bone you=ship pax=path]
^- [(list move) _+>]
2015-02-15 13:25:57 +03:00
=+ nuv=(novel ost ~)
2015-02-14 03:37:40 +03:00
?~ nuv
:_ +>.$
[ost %give %rush %console-effect %pro & %$ (tuba "no story ")]~
sy-abet:sy-awake:u.nuv
2015-01-06 02:59:57 +03:00
::
2015-02-14 03:37:40 +03:00
++ submit
2015-02-15 13:25:57 +03:00
|= [ost=bone txt=cord]
2014-12-10 23:09:01 +03:00
^- [(list move) _+>]
2015-01-04 09:24:48 +03:00
=+ jub=(rush txt work:(parse our.hid))
2015-01-01 23:43:50 +03:00
?~ jub
2015-01-06 23:31:36 +03:00
[hy-abet:(hy-print:(hype ~) "invalid input") +>.$]
2015-01-01 23:43:50 +03:00
?: ?=(%wry -.u.jub)
2015-02-15 13:25:57 +03:00
ny-abet:(~(ny-work ny ost ~) +.u.jub)
=+ nuv=(novel ost ~)
2015-01-06 23:31:36 +03:00
?~ nuv [hy-abet:(hy-print:(hype ~) "not tuned to any story") +>.$]
2015-01-04 09:24:48 +03:00
sy-abet:(sy-work:u.nuv u.jub)
2014-12-10 23:09:01 +03:00
::
++ pour
|= [ost=bone pax=path sih=*]
^- [(list move) _+>]
2015-01-27 07:30:22 +03:00
~| sign=sih
2014-12-12 00:32:59 +03:00
=> .(sih ((hard sign) sih))
2014-12-18 05:29:32 +03:00
:: ~& talk-pour/sih
2014-12-11 00:10:30 +03:00
?~ pax ~& talk-pour-strange-path/pax !!
2015-01-06 02:59:57 +03:00
?+ i.pax ~& talk-pour-strange-path/pax
~& sign/sih
!!
%command
?+ +<.sih !!
%nice [~ +>.$]
2015-02-14 03:37:40 +03:00
%mean ~|([%pour-mean-command +>.sih] !!)
2015-01-21 02:00:54 +03:00
==
2014-12-10 23:09:01 +03:00
::
2014-12-12 00:32:59 +03:00
%server
2015-01-01 23:43:50 +03:00
?+ +<.sih !!
%nice [~ +>.$]
2015-01-27 07:35:03 +03:00
%mean ~|(%talk-server-crash !!)
2015-01-21 02:00:54 +03:00
%rush
2015-01-15 22:32:04 +03:00
?> ?=([%rodeo-report %house *] p.sih)
2015-02-15 13:25:57 +03:00
=^ moz +>.$ ny-abet:(~(ny-tell ny ost ~) +.p.p.sih)
2015-01-21 02:00:54 +03:00
:_ +>.$
:_(moz [ost %pass pax %g %took [our.hid /rodeo] our.hid])
2015-01-04 09:24:48 +03:00
==
2014-12-12 00:32:59 +03:00
::
2015-01-04 09:24:48 +03:00
%time
:_ +>.$
2015-01-15 22:10:29 +03:00
:: ~& [%talk-pour-time lat.hid `@da`(add ~s10 lat.hid)]
:~ [0 %pass /time %t %wait (add ~s10 lat.hid)]
2014-12-11 00:10:30 +03:00
==
2015-01-04 09:24:48 +03:00
::
2015-02-14 03:37:40 +03:00
%story
2015-01-04 09:24:48 +03:00
?> ?=([@ *] t.pax)
2015-01-21 02:00:54 +03:00
?. =(& &(?=(^ live) =(u.live i.t.pax)))
2015-01-04 09:24:48 +03:00
~& [%talk-wrong-story live i.t.pax]
[~ +>.$]
?> ?=(%g -.sih)
2015-02-15 13:25:57 +03:00
=^ moz +>.$ sy-abet:(sy-sign:(need (novel ost ~)) +.sih)
2015-01-21 02:00:54 +03:00
:_ +>.$
:_(moz `move`[ost %pass pax %g %took [our.hid /rodeo] our.hid])
2014-12-10 23:09:01 +03:00
==
::
2015-02-14 03:37:40 +03:00
++ prep
|= old=(unit (unit town))
2014-12-10 23:09:01 +03:00
^- [(list move) _+>]
2015-02-14 03:37:40 +03:00
?: ?=([~ ~ *] old)
[~ +>(+<+ u.u.old)]
2014-12-10 23:09:01 +03:00
:_ +>
2015-02-14 03:37:40 +03:00
:~ [0 %pass /time %t %wait (add ~s10 lat.hid)]
2014-12-10 23:09:01 +03:00
^- move
2015-01-01 23:43:50 +03:00
:* 0 %pass /server
2014-12-11 22:03:49 +03:00
%g %show
2015-01-15 22:32:04 +03:00
[our.hid /rodeo] our.hid
2014-12-12 00:32:59 +03:00
/
2014-12-11 22:03:49 +03:00
==
2014-12-10 23:09:01 +03:00
==
2015-02-14 03:37:40 +03:00
::
++ poke-console-action
|= [ost=bone her=ship act=console-action]
=+ moz=`(list move)`[ost %give %nice ~]~
?+ -.act [moz +>.$]
%det [moz +>.$(seat abet:(~(receive cs seat) `console-change`+.act))]
%ret =+ sed=buf.seat
2015-02-15 13:25:57 +03:00
=^ zom +>.$ (submit ost (crip (tufa sed)))
2015-02-14 03:37:40 +03:00
=^ cal seat =<([- abet:+] (~(transmit cs seat) [%set ~]))
:_ +>.$
:* [ost %give %rush %console-effect %nex ~]
[ost %give %rush %console-effect %det cal]
[ost %give %rush %console-effect %txt (tufa sed)]
(weld zom moz)
==
==
2014-12-10 23:09:01 +03:00
--