2021-12-28 13:56:16 -05:00
|
|
|
makeclass('login')
|
2021-06-02 15:00:14 -04:00
|
|
|
|
|
|
|
|
function login.interface(actor, place)
|
2021-12-28 14:07:15 -05:00
|
|
|
gui.menu_item("cb_becomeplayer", "Become a Player")
|
|
|
|
|
gui.menu_item("cb_p123", "Print 1, 2, 3")
|
2022-04-25 17:17:41 -04:00
|
|
|
gui.menu_item("cb_p123_nopredict", "Print 1, 2, 3 nopredict")
|
2022-04-25 12:20:29 -04:00
|
|
|
gui.menu_item("cb_uglytimedaemon","Start the Time Daemon")
|
2022-05-18 19:02:46 -04:00
|
|
|
gui.menu_item("cb_seedprng","Seed the PRNG")
|
2022-03-29 15:47:44 -04:00
|
|
|
end
|
2021-06-02 15:00:14 -04:00
|
|
|
|
2022-05-18 19:02:46 -04:00
|
|
|
function login.cb_seedprng(actor,place,dialog)
|
|
|
|
|
local result=http.get{method='GET',host='www.random.org',path='/cgi-bin/randbyte',params={nbytes='32',format='f'},verifycertificate=false}
|
|
|
|
|
pprint(result)
|
|
|
|
|
end -- "GET /cgi-bin/randbyte?nbytes=16384&format=f HTTP/1.0\nHost: www.random.org\n\n"
|
|
|
|
|
|
|
|
|
|
|
2021-12-28 14:07:15 -05:00
|
|
|
function login.cb_becomeplayer(actor, place, dialog)
|
2022-03-16 15:47:46 -04:00
|
|
|
actor.kind='P'
|
2022-03-29 16:37:32 -04:00
|
|
|
actor.Count={} setmetatable(actor.Count,NilIsZero)
|
2022-05-21 00:39:58 -04:00
|
|
|
actor.food={} setmetatable(actor.food,NilIsZero)
|
|
|
|
|
actor.spectra={} setmetatable(actor.spectra,NilIsZero)
|
2022-05-18 19:02:46 -04:00
|
|
|
actor.stack={}
|
2022-05-21 12:49:54 -04:00
|
|
|
actor.team='red'
|
2021-06-02 15:00:14 -04:00
|
|
|
tangible.setclass(actor, player)
|
2022-02-03 16:23:14 -05:00
|
|
|
tangible.animate(actor,{action="warp",plane="main",x=0,y=0,z=0})
|
2022-03-29 15:47:44 -04:00
|
|
|
end
|
2021-06-02 15:00:14 -04:00
|
|
|
|
2021-11-23 16:10:48 -05:00
|
|
|
|
2024-02-13 16:49:24 -05:00
|
|
|
function bechar()
|
2023-09-28 14:22:33 -04:00
|
|
|
local a = tangible.actor()
|
2024-02-13 16:49:24 -05:00
|
|
|
tangible.animate(a, nil, {bp="TangibleCharacter", xyz={0,0,90}})
|
2023-10-24 15:49:43 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
makeclass("engio")
|
|
|
|
|
function engio.myfunction(actor, place, a, b, c)
|
2023-10-31 13:31:42 -04:00
|
|
|
print("Myfunction actor=", actor," place=", place)
|
|
|
|
|
pprint("A:", a)
|
|
|
|
|
pprint("B:", b)
|
|
|
|
|
pprint("C:", c)
|
2023-10-24 15:49:43 -04:00
|
|
|
end
|
2024-02-07 15:59:17 -05:00
|
|
|
|
2024-02-13 16:49:24 -05:00
|
|
|
function engio.move(actor, place, action, xyz)
|
2024-02-07 15:59:17 -05:00
|
|
|
-- todo: sanity check the action and xyz.
|
2024-02-13 16:49:24 -05:00
|
|
|
dprint("engio.move ", action, " ", xyz)
|
2024-02-07 15:59:17 -05:00
|
|
|
tangible.animate(actor, nil, {action=action, xyz=xyz})
|
|
|
|
|
end
|