mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-11 16:09:31 +03:00
fixed backlog, heartbeat, private messages in chat
This commit is contained in:
parent
f9f5f7c29d
commit
dcd09da912
@ -1,15 +1,17 @@
|
||||
!:
|
||||
=> |%
|
||||
++ axle
|
||||
$% [%0 p=(map path ,[p=(list zong) q=(set ship)])]
|
||||
$% [%0 p=(map path ,[p=(list zong) q=(map ship feel)])]
|
||||
==
|
||||
++ blitz
|
||||
$% [%zong p=zong]
|
||||
[%user p=ship]
|
||||
[%user p=user]
|
||||
==
|
||||
++ feel ,[liv=? tim=@da]
|
||||
++ idad ,[p=@p q=@t]
|
||||
++ iron
|
||||
$% [%zongs p=(list zong)]
|
||||
[%users p=(list ship)]
|
||||
[%users p=(list idad)]
|
||||
==
|
||||
++ gift
|
||||
$% [%rush blitz]
|
||||
@ -23,6 +25,10 @@
|
||||
==
|
||||
++ move ,[p=bone q=(mold note gift)]
|
||||
++ note ,~
|
||||
++ user
|
||||
$% [%in p=idad]
|
||||
[%out p=idad]
|
||||
==
|
||||
++ zing
|
||||
$% [%backlog p=path q=?(%da %dr %ud) r=@]
|
||||
[%hola p=path]
|
||||
@ -34,6 +40,21 @@
|
||||
--
|
||||
|= *
|
||||
|_ [hid=hide vat=axle]
|
||||
++ grab
|
||||
|= sta=path
|
||||
(fall (~(get by p.vat) sta) *[p=(list zong) q=(map ship feel)])
|
||||
::
|
||||
++ ident
|
||||
|= you=ship
|
||||
((hard ,@t) .^(%a (scot %p our.hid) %name (scot %da lat.hid) (scot %p you) ~))
|
||||
::
|
||||
++ since
|
||||
|= [ya=p=(list zong) tim=@da]
|
||||
%- flop
|
||||
|- ^- (list zong)
|
||||
?: |(?=(~ p.ya) (lth p.i.p.ya tim)) ~
|
||||
[i.p.ya $(p.ya t.p.ya)]
|
||||
::
|
||||
++ peer
|
||||
|= [ost=bone you=ship pax=path]
|
||||
^- [(list move) _+>]
|
||||
@ -45,17 +66,18 @@
|
||||
?. ?=(~ +.pax)
|
||||
$(sta `path`[-.pax sta], pax `path`+.pax)
|
||||
=. sta (flop sta)
|
||||
=+ ya=(grab sta)
|
||||
?+ -.pax ~
|
||||
%mensajes
|
||||
:_ ~
|
||||
:* ost %give %rust %zongs
|
||||
%- flop
|
||||
(scag 5 p:(fall (~(get by p.vat) sta) [p=*(list zong) q=*(set ship)]))
|
||||
==
|
||||
[ost %give %rust %zongs (since p.ya tim:(fall (~(get by q.ya) you) *feel))]
|
||||
%amigos
|
||||
:_ ~
|
||||
:* ost %give %rust %users
|
||||
(~(tap in q:(fall (~(get by p.vat) sta) [p=*(list zong) q=*(set ship)])))
|
||||
%+ turn
|
||||
%+ skim (~(tap by q.ya))
|
||||
|= [ship [p=? @da]] p
|
||||
|= [p=ship [? @da]] [p (ident p)]
|
||||
==
|
||||
==
|
||||
::
|
||||
@ -64,29 +86,36 @@
|
||||
^- [(list move) _+>]
|
||||
?- -.zig
|
||||
%backlog
|
||||
=+ ya=(fall (~(get by p.vat) p.zig) [p=*(list zong) q=*(set ship)])
|
||||
=+ ya=(grab p.zig)
|
||||
:_ +>.$
|
||||
%+ send (welp p.zig /mensajes)
|
||||
%^ yend you (welp p.zig /mensajes)
|
||||
:* %give %rust %zongs
|
||||
?: ?=(%ud q.zig)
|
||||
%- flop
|
||||
%+ scag r.zig
|
||||
p:(fall (~(get by p.vat) p.zig) [p=*(list zong) q=*(set ship)])
|
||||
p.ya
|
||||
=+ ^= tim ?-(q.zig %da r.zig, %dr (sub lat.hid r.zig))
|
||||
%- flop
|
||||
|- ^- (list zong)
|
||||
?: |(?=(~ p.ya) (lth p.i.p.ya tim)) ~
|
||||
[i.p.ya $(p.ya t.p.ya)]
|
||||
(since p.ya tim)
|
||||
==
|
||||
%hola
|
||||
=+ ya=(fall (~(get by p.vat) p.zig) [p=*(list zong) q=*(set ship)])
|
||||
?: (~(has in q.ya) you)
|
||||
[~ +>.$]
|
||||
=. p.vat (~(put by p.vat) p.zig [p.ya (~(put in q.ya) you)])
|
||||
[(send (welp p.zig /amigos) %give %rush %user you) +>.$]
|
||||
=+ ya=(grab p.zig)
|
||||
=^ outs q.ya
|
||||
%+ ~(rib by q.ya) *(list move)
|
||||
|= [p=[p=ship q=feel] q=(list move)]
|
||||
=+ liv=(gth ~m3 (sub lat.hid tim.q.p))
|
||||
:_ [p.p liv tim.q.p]
|
||||
?: |(liv !liv.q.p) q
|
||||
%- welp :_ q
|
||||
(send (welp p.zig /amigos) %give %rush %user %out p.p (ident p.p))
|
||||
=. p.vat (~(put by p.vat) p.zig [p.ya (~(put by q.ya) you [& lat.hid])])
|
||||
:_ +>.$
|
||||
?: (~(has by q.ya) you)
|
||||
outs
|
||||
%+ welp outs
|
||||
(send (welp p.zig /amigos) %give %rush %user %in you (ident you))
|
||||
%mess
|
||||
=+ zog=`zong`[%mess lat.hid you q.zig]
|
||||
=+ ya=(fall (~(get by p.vat) p.zig) [p=*(list zong) q=*(set ship)])
|
||||
=+ ya=(grab p.zig)
|
||||
=. p.vat (~(put by p.vat) p.zig [[zog p.ya] q.ya])
|
||||
[(send (welp p.zig /mensajes) %give %rush %zong zog) +>.$]
|
||||
==
|
||||
@ -94,10 +123,14 @@
|
||||
++ send
|
||||
|= [pax=path msg=(mold note gift)]
|
||||
^- (list move)
|
||||
%- turn :_ |=(ost=bone [ost msg])
|
||||
^- (list bone)
|
||||
%+ ~(rep by sup.hid) *(list bone)
|
||||
|= [p=[p=bone q=[ship path]] q=(list bone)] ^- (list bone)
|
||||
?. =(pax +.q.p) q
|
||||
[p.p q]
|
||||
%+ turn (~(tap in (~(get ju pus.hid) pax)))
|
||||
|=(ost=bone [ost msg])
|
||||
++ yend
|
||||
|= [you=ship sta=path msg=(mold note gift)]
|
||||
^- (list move)
|
||||
%+ turn
|
||||
%+ skim (~(tap in (~(get ju pus.hid) sta)))
|
||||
|= b=bone =(you p:(fall (~(get by sup.hid) b) *(pair ship path)))
|
||||
|= b=bone
|
||||
:- b msg
|
||||
--
|
||||
|
@ -6,7 +6,11 @@
|
||||
=> +
|
||||
=> ^/===/lib/pony
|
||||
=+ ^= flag
|
||||
$? [%haus p=@p]
|
||||
$? %leet
|
||||
%monitor
|
||||
%noob
|
||||
%quiet
|
||||
[%tower p=@p]
|
||||
[%s p=path]
|
||||
==
|
||||
=+ flags=*(list flag)
|
||||
@ -15,13 +19,19 @@
|
||||
$% [%all p=mess] :: say
|
||||
[%back p=?(%da %dr %ud) q=@] :: backlog
|
||||
[%how ~] :: help
|
||||
[%priv p=@p q=mess] :: private
|
||||
[%who ~] :: who
|
||||
== ::
|
||||
++ idad ,[p=@p q=@t] :: identity
|
||||
++ mess :: message
|
||||
$% [%do p=@t] :: act
|
||||
[%exp p=@t q=tank] :: code
|
||||
[%say p=@t] :: say
|
||||
== ::
|
||||
++ user :: amigos
|
||||
$% [%in p=idad] :: coming on the air
|
||||
[%out p=idad] :: signing off
|
||||
== ::
|
||||
++ station path ::
|
||||
++ zing :: client to server
|
||||
$% [%backlog p=path q=?(%da %dr %ud) r=@] ::
|
||||
@ -34,17 +44,16 @@
|
||||
--
|
||||
=> |%
|
||||
++ chat
|
||||
|= now=@da
|
||||
%+ cook |=(a=^chat a)
|
||||
;~ pose
|
||||
(cold [%how ~] wut)
|
||||
(cold [%who ~] tis)
|
||||
(stag %back (dat now))
|
||||
(stag %back dat)
|
||||
(stag %priv ;~(plug ;~(pfix sig fed:ag) ;~(pfix ace mess)))
|
||||
(stag %all mess)
|
||||
==
|
||||
::
|
||||
++ dat
|
||||
|= now=@da
|
||||
%+ cook
|
||||
|= p=coin
|
||||
?. ?=(~ -.p) [%ud 5]
|
||||
@ -76,71 +85,132 @@
|
||||
++ text (boss 256 (star prn))
|
||||
--
|
||||
|%
|
||||
++ idt
|
||||
|= from=idad
|
||||
?: |(!(lien flags |=(a=flag ?=(%noob a))) =("" q.from))
|
||||
(scow %p p.from)
|
||||
%- trip
|
||||
%^ cat 3 %^ cat 3 (scot %p p.from) ' ' q.from
|
||||
++ rend
|
||||
|= [from=@p msg=^mess] :: roo=^room
|
||||
|= [from=idad msg=^mess pre=tape] :: roo=^room
|
||||
^- tank
|
||||
?- -.msg
|
||||
%do =+ mes=?:(=(0 p.msg) "remains quietly present" (trip p.msg))
|
||||
:- %leaf
|
||||
"{<from>} {mes}"
|
||||
"{pre}{(idt from)} {mes}"
|
||||
%exp :~ %rose
|
||||
[" " "" ""]
|
||||
:- %leaf
|
||||
"{<from>} {(trip p.msg)}"
|
||||
"{pre}{(idt from)} {(trip p.msg)}"
|
||||
q.msg
|
||||
==
|
||||
%say [%leaf "{<from>}: {(trip p.msg)}"]
|
||||
%say [%leaf "{pre}{(idt from)}: {(trip p.msg)}"]
|
||||
==
|
||||
--
|
||||
::
|
||||
==
|
||||
=> %= .
|
||||
-
|
||||
:- :* ami=*(set ship)
|
||||
:- :* ami=*(map ,@p ,@t) ::
|
||||
bud=(sein `@p`-<) :: chat server
|
||||
dun=| :: done
|
||||
mon=*? :: leet mode
|
||||
nub=*? :: monitor mode
|
||||
giz=*(list gift) :: stuff to send
|
||||
sta=*station :: station
|
||||
sub=*(list path) :: subscriptions
|
||||
tod=*(map ,@p ,@ud) :: outstanding, friend
|
||||
wak=_@da :: next heartbeat
|
||||
==
|
||||
[who=`@p`-< how=`path`->]
|
||||
==
|
||||
|= [est=time *]
|
||||
|= args=(list flag)
|
||||
=. flags args
|
||||
=. wak est
|
||||
=. bud
|
||||
?: (lien args |=(a=flag ?=(%haus -.a)))
|
||||
(roll args |=([p=flag q=@p] ?:(?=(%haus -.p) p.p q)))
|
||||
?: (lien args |=(a=flag &(?=(^ a) ?=(%tower -.a))))
|
||||
(roll args |=([p=flag q=@p] ?:(&(?=(^ p) ?=(%tower -.p)) p.p q)))
|
||||
bud
|
||||
=. nub (lien args |=(a=flag ?=(%noob a)))
|
||||
=. mon (lien args |=(a=flag ?=(%monitor a)))
|
||||
=. sta
|
||||
?: (lien args |=(a=flag ?=(%s -.a)))
|
||||
(roll args |=([p=flag q=station] ?:(?=(%s -.p) p.p q)))
|
||||
?: (lien args |=(a=flag &(?=(^ a) ?=(%s -.a))))
|
||||
(roll args |=([p=flag q=station] ?:(&(?=(^ p) ?=(%s -.p)) p.p q)))
|
||||
sta
|
||||
|- ^- bowl
|
||||
=< abet:init
|
||||
|%
|
||||
++ abet `bowl`[(flop giz) ?:(dun ~ [~ hope vent(giz ~)])]
|
||||
++ hope
|
||||
:_ (turn sub |=(pax=path [[%gr pax] [%gr ~]]))
|
||||
[/up [%up %text ["& " ""]]]
|
||||
:^ [/up %up %text ["& " ""]]
|
||||
[/wa %wa wak]
|
||||
[/ya %lq %ya]
|
||||
%+ welp
|
||||
(turn sub |=(pax=path [[%gr pax] [%gr ~]]))
|
||||
%+ turn (~(tap by tod))
|
||||
|= [p=@p q=@ud]
|
||||
[[%ra (scot %p p) ~] [%ow ~]]
|
||||
::
|
||||
++ iden
|
||||
|= her=@p
|
||||
(fall (~(get by ami) her) *@t)
|
||||
::
|
||||
++ init (joke:(subs:(subs (welp sta /amigos)) (welp sta /mensajes)) %hola sta)
|
||||
::
|
||||
++ jake
|
||||
|= [her=@p msg=^mess]
|
||||
^+ +>
|
||||
%= +>.$
|
||||
giz :_(giz [%sq her %ya [%ra (scot %p her) ~] msg])
|
||||
tod (~(put by tod) her +((fall (~(get by tod) her) 0)))
|
||||
==
|
||||
::
|
||||
++ init (subs:(subs:(joke %hola sta) (welp sta /mensajes)) (welp sta /amigos))
|
||||
++ joke :: send message
|
||||
|= msg=zing
|
||||
^+ +>
|
||||
+>(giz :_(giz [%xz [bud %radio] who %zing msg]))
|
||||
::
|
||||
++ join
|
||||
|= you=ship
|
||||
|= you=user
|
||||
^+ +>
|
||||
%+ show(ami (~(put in ami) you))
|
||||
%leaf
|
||||
"{(scow %p you)} comes on the air"
|
||||
?- -.you
|
||||
%in
|
||||
=. ami (~(put by ami) p.you)
|
||||
?. mon +>.$
|
||||
(show %leaf "{(idt p.you)} comes on the air")
|
||||
%out
|
||||
=. ami (~(del by ami) p.p.you)
|
||||
?. mon +>.$
|
||||
(show %leaf "{(idt p.you)} signs off")
|
||||
==
|
||||
++ joyn
|
||||
|= yall=(list ship)
|
||||
|= yall=(list idad)
|
||||
^+ +>
|
||||
%- shew(ami (~(gas in ami) yall))
|
||||
(turn yall |=(you=ship [%leaf "{(scow %p you)} comes on the air"]))
|
||||
=. ami (~(gas by ami) yall)
|
||||
?. mon +>.$
|
||||
(shew (turn yall |=(you=idad [%leaf "{(idt you)} is on the air"])))
|
||||
::
|
||||
++ nice :: got response
|
||||
|= [her=@p kay=cape]
|
||||
^+ +>
|
||||
=. +>
|
||||
=+ dyt=(need (~(get by tod) her))
|
||||
%_ +>.$
|
||||
tod
|
||||
?: =(1 dyt)
|
||||
(~(del by tod) her)
|
||||
(~(put by tod) her (dec dyt))
|
||||
==
|
||||
?- kay
|
||||
%good +>
|
||||
%dead (show %leaf "server {(scow %p her)} choked")
|
||||
==
|
||||
::
|
||||
++ priv
|
||||
|= [now=@da her=@p mes=^mess]
|
||||
^+ +>
|
||||
(show (rend [her (iden her)] mes "(private) "))
|
||||
::
|
||||
++ said :: server message
|
||||
|= duz=(list zong)
|
||||
@ -152,7 +222,7 @@
|
||||
%- show
|
||||
^- tank
|
||||
?- -.i.duz
|
||||
%mess (rend q.i.duz r.i.duz)
|
||||
%mess (rend [q.i.duz (iden q.i.duz)] r.i.duz "")
|
||||
== ==
|
||||
::
|
||||
++ shew |=(tax=(list tank) +>(giz [[%lo tax] giz])) :: print to screen
|
||||
@ -163,18 +233,23 @@
|
||||
^+ +>
|
||||
+>(sub [pax sub], giz :_(giz [%zz /g [%gr pax] %show [bud %radio] who pax]))
|
||||
::
|
||||
++ take (joke(wak (add ~m1 (max wak est))) %hola sta) :: beat heart
|
||||
++ toke :: user action
|
||||
|= [now=@da txt=@t]
|
||||
^+ +>
|
||||
?: =(0 txt) +>
|
||||
=+ rey=(rush txt (chat now))
|
||||
=+ rey=(rush txt chat)
|
||||
?~ rey
|
||||
(show %leaf "invalid input")
|
||||
?- -.u.rey
|
||||
%all (joke %mess sta p.u.rey)
|
||||
%back (joke %backlog sta p.u.rey q.u.rey)
|
||||
%how (shew (turn (lore ^:@/===doc%/help/txt) |=(a=@t [%leaf (trip a)])))
|
||||
%who (show %rose [", " "" ""] (turn (~(tap in ami)) |=(p=ship >p<)))
|
||||
%priv (jake p.u.rey q.u.rey)
|
||||
%who
|
||||
%^ show %rose [", " "" ""]
|
||||
%+ turn (~(tap by ami))
|
||||
|= p=idad [%leaf (idt p)]
|
||||
==
|
||||
::
|
||||
++ vent :: handle event
|
||||
@ -184,12 +259,20 @@
|
||||
=< abet
|
||||
?+ -.pax ~& [%chat-vent-unknown -.nut] +>.$
|
||||
%gr ?> ?=(%gr -.nut)
|
||||
?+ p.nut ~& %vent-rush-logo-fail +>.$
|
||||
%user (join ((hard ship) q.nut))
|
||||
%users (joyn ((hard (list ship)) q.nut))
|
||||
?+ p.nut ~& %chat-vent-logo-fail +>.$
|
||||
%user (join ((hard user) q.nut))
|
||||
%users (joyn ((hard (list idad)) q.nut))
|
||||
%zong (said [((hard zong) q.nut) ~])
|
||||
%zongs (said ((hard (list zong)) q.nut))
|
||||
==
|
||||
%up ?>(?=(%up -.nut) (toke now p.nut))
|
||||
%ra ?> &(?=(%ow -.nut) ?=(^ t.pax))
|
||||
(nice (need (slaw %p i.t.pax)) p.nut)
|
||||
%wa ?>(?=(%wa -.nut) take)
|
||||
%ya ?> ?=(%lq -.nut)
|
||||
=+ n=((soft ^mess) r.nut)
|
||||
?~ n
|
||||
~& %chat-mess-fail +>+
|
||||
(priv now p.nut u.n)
|
||||
==
|
||||
--
|
||||
|
@ -1,33 +1,25 @@
|
||||
prompts:
|
||||
& broadcast message to room
|
||||
| banner message
|
||||
& broadcast message to station
|
||||
~ship private message to ship
|
||||
|
||||
type the prompt, then the message. ex: to send to ~hoclur-bicrel, type
|
||||
"~hoclur-bicrel hello mars". your prompt will be changed automatically.
|
||||
"~hoclur-bicrel hello mars". default is &.
|
||||
|
||||
actions:
|
||||
@ send message in third person (irc /me)
|
||||
# evaluate expression (ex: "#(add 2 2)")
|
||||
-~hoclur-bicrel [~bacdyl-soltus ...] add ship(s) to kill list (hides messages)
|
||||
+~hoclur-bicrel [~bacdyl-soltus ...] remove ship(s) from kill list
|
||||
! exit
|
||||
|
||||
list vessels:
|
||||
= show ships in current room
|
||||
=== show ships in haus (all rooms)
|
||||
=%mars [%urf ...] show ships in specified room(s)
|
||||
= show ships in current station
|
||||
|
||||
command-line parameters:
|
||||
[%haus ~hoclur-bicrel] select haus server (default: ticketing ship)
|
||||
[%r %mars] select a room (default: %mars)
|
||||
%time display timestamps for messages
|
||||
%all always display entrance and exit notices
|
||||
%monitor display entrance and exit notices except in backlog
|
||||
%never never display entrance and exit notices
|
||||
%leet only display ship names
|
||||
%nub display ship and textual names
|
||||
[%tower ~hoclur-bicrel] select haus server (default: ticketing ship)
|
||||
[%s /mars] select a station (default: /)
|
||||
%monitor display entrance and exit notices
|
||||
%quiet do not display entrance and exit notices
|
||||
%leet only display ship names
|
||||
%nub display ship and textual names
|
||||
|
||||
only one of %all, %monitor, and %never may be specfied. default behavior is
|
||||
%never. only one of %leet and %nub may be specified. default behavior is %leet.
|
||||
only one of %monitor and %quiet may be specfied. default behavior is %quiet.
|
||||
only one of %leet and %noob may be specified. default behavior is %leet.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user