$include $lib/gary'smufutils-lists $include $lib/gary'smufutils-misc $include $lib/alynna $include $lib/www_utils $include $lib/rp $include $muf/Scrp/registry $def .tell descr @ swap notify_descriptor $def .tell2 descr2 @ swap notify_descriptor $def VERSION prog "_version" getpropstr $def }chunk }array "" array_join descr @ swap notify_descriptor var cookies var player (-----------------------------------) (-------------VARIBLES=-------------) (-----------------------------------) lvar descr lvar user lvar host lvar params (-----------------------------------) (------------ACTUAL CODE------------) (-----------------------------------) : load_info "|" explode pop atoi descr ! host ! user ! params ! ; : exitfixup[ str:input -- str:output ] input @ "`EXITS`" instr 25 = not if input @ exit then 0 var! x input @ "" "`EXITS`" subst input ! "" var! output input @ "[\[[1;33m" explode_array foreach var! val pop x @ not if val @ output ! x @ ++ x ! continue then val @ "]" split swap { over "" }cat swap strcat "]" strcat swap strcat "[" swap strcat output @ swap strcat output ! repeat output @ ; : webnotify[ int:descr str:text -- ] { "^normal^" text @ strcat dup "<" instring 9 = not if fixup exitfixup else "" "^normal^" subst then "
" }cat .tell "" .tell ; : main (s -- ) command @ "listen" instring if var! text systime trigger @ "Last Web Presence" getstatint - 60 > if exit then trigger @ "Web Descr" getstatint dup descr? not if pop trigger @ "Web Descr" 0 setstat exit then var! descr2 descr2 @ text @ webnotify trigger @ trigger @ "Web Listen#/101" text @ setprop trigger @ "Web Listen#/101/Timestamp" systime_precise setprop 90 var! x begin trigger @ "Web Listen#/" x @ 1 + intostr strcat getpropstr trigger @ "Web Listen#/" x @ intostr strcat rot setprop trigger @ "Web Listen#/" x @ 1 + intostr strcat "/Timestamp" strcat getprop tofloat trigger @ "Web Listen#/" x @ intostr strcat "/Timestamp" strcat rot setprop trigger @ "Web Listen#/" x @ 1 + intostr strcat "/Displayed?" strcat getprop toint trigger @ "Web Listen#/" x @ intostr strcat "/Displayed?" strcat rot setprop x @ 1 + x ! x @ 101 = until exit then load_info event_wait pop dup var! data "data" array_getitem "HeaderData" array_getitem "Cookie" array_getitem dup string? not if pop { }dict else "; " explode_array { swap foreach swap pop "=" split repeat }dict then cookies ! params @ "Update" instring not if "" .tell else { "" }chunk then hash @ not if cookies @ "Session" array_getitem hash ! then rpsys { "Web Logins/" hash @ "/Last Connect" }cat systime setprop rpsys { "Web Logins/" hash @ "/Player" }cat getprop toint dup 0 = swap dbref dup player ! player? not or if "You should login to play." .tell "Click Here" .tell ( exit ) random 5 % case 0 = when #7887 end 1 = when #7559 end 2 = when #7610 end 3 = when #7616 end 4 = when #7631 end endcase player ! rpsys { "Web Logins/" hash @ "/Player" }cat player @ setprop then params @ "BackLog" instring 1 = if "" .tell "" .tell "" .tell player @ "Command Recall" getstatint 1 - 1 greater player @ "Command Recall" rot setstat exit then params @ "NextLog" instring 1 = if player @ "Command Recall" getstatint 1 + 10 lesser player @ "Command Recall" rot setstat "" .tell "" .tell "" .tell exit then params @ "Who" instring 1 = if "" .tell "" .tell "" .tell "" .tell #0 "Web/Cookie Tabs#" array_get_proplist foreach .tell pop repeat "" .tell "" .tell "" .tell "
" .tell "
" .tell "

Room

" .tell online_array dup array_union foreach var! cur pop cur @ location player @ location dbcmp not if continue then { cur @ name "
" }cat .tell repeat "
" .tell "
" .tell "

Online

" .tell online_array dup array_union foreach var! cur pop cur @ descrleastidle dup -1 = if pop else descridle 600 > if continue then then { cur @ name "
" }cat .tell repeat "
" .tell "
" .tell "" .tell exit then params @ "Update" instring if player @ "@alisten/Web" prog tostr setprop { "" "" "" "" player @ "Web Descr" descr @ setstat ( Alynna: ) "" "" }chunk 90 100 1 for var! x { "^normal^" player @ "Web Listen#/" x @ intostr strcat getpropstr strcat dup "<" instring 9 = not if fixup exitfixup else "" "^normal^" subst then "
" }chunk repeat systime_precise var! time begin ( systime_precise player @ "Web Listen#/100/timestamp" getprop tofloat - 1.0 > not if continue then ) 0 var! found 1 100 1 for var! x ( Player @ "Web Listen#/" x @ intostr strcat "/Displayed?" strcat getprop not if Player @ "Web Listen#/" x @ intostr strcat "/Timestamp" strcat getprop tofloat dup time @ > if 1 found ! time ! { "^normal^" player @ "Web Listen#/" x @ intostr strcat getprop tostr strcat dup "<" instring 9 = not if fixup exitfixup else "" "^normal^" subst then "
" }chunk { "" }chunk Player @ "Web Listen#/" x @ intostr strcat "/Displayed?" strcat 1 setprop else pop then ) player @ "Last Web Presence" systime setstat repeat ( found @ if systime_precise time ! then ) 1 sleep repeat { "
" "" }chunk { "" }chunk exit then params @ "Message" instring if params @ "=" debug_line split swap pop dup "&Submit" instring if "&Submit=Submit" split pop then cleanup ( "Public " swap strcat ) dup "*&" smatch if dup strlen 1 - strcut pop then ( "(WEB)" strcat ) dup " " instring 1 = if 1 strcut swap pop "+" swap strcat then dup text ! player @ toint dbref swap force player @ toint dbref "Last Web Action" systime setstat player @ toint dbref "Last Web Presence" systime setstat player @ "Web Command Log#/11" text @ setprop 1 var! x begin player @ "Web Command Log#/" x @ 1 + intostr strcat getpropstr player @ "Web Command Log#/" x @ intostr strcat rot setprop x @ 1 + x ! x @ 11 = until player @ "Command Recall" 10 setstat exit then #261 descr @ "Play" wwwUtils.displayheader ( #0 "_connect/" array_get_propvals foreach var! val var! cur player @ toint dbref me ! me @ "Queued Event." command ! "_Connect/" cur @ strcat #0 "Connect" propqueue repeat ) player @ toint dbref player ! player @ player? not if #7887 player ! then ( player @ toint dbref "look" force ) "" .tell 0 sleep player @ location #-1 { "^cyan^" player @ name " has connected." }cat ansi_notify_except player @ toint dbref "Last Web Presence" systime setstat player @ toint dbref "Last Web Action" systime setstat "" .tell #0 "Web/Form Without Reload Play#" array_get_proplist foreach .tell pop repeat ( "" ) "" .tell "" .tell "" .tell "" .tell "" .tell "" .tell "
" .tell "" .tell "" .tell "" .tell "
Command:
Back Next
" .tell "
" .tell "" .tell descr @ wwwUtils.displayfooter ; ( "" .tell ) ( "" .tell )