Files
integration/luprex/lua/login.lua
2024-02-27 17:32:08 -05:00

57 lines
1.8 KiB
Lua

makeclass('login')
function login.initialize(actor, place)
dprint("login.initialize:", actor)
end
function login.interface(actor, place)
gui.menu_item("cb_becomeplayer", "Become a Player")
gui.menu_item("cb_p123", "Print 1, 2, 3")
gui.menu_item("cb_p123_nopredict", "Print 1, 2, 3 nopredict")
gui.menu_item("cb_uglytimedaemon","Start the Time Daemon")
gui.menu_item("cb_seedprng","Seed the PRNG")
end
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"
function login.cb_becomeplayer(actor, place, dialog)
actor.kind='P'
actor.Count={} setmetatable(actor.Count,NilIsZero)
actor.food={} setmetatable(actor.food,NilIsZero)
actor.spectra={} setmetatable(actor.spectra,NilIsZero)
actor.stack={}
actor.team='red'
tangible.setclass(actor, player)
tangible.animate(actor,{action="warp",plane="main",x=0,y=0,z=0})
end
function login.cb_p123(actor, place, dialog)
print("CB_P123 actor=", actor, " place=", place, " dialog=", dialog);
print(1);
print(2);
print(3);
end
function bechar()
local a = tangible.actor()
tangible.animate(a, nil, {bp="TangibleCharacter", xyz={0,0,90}})
end
makeclass("engio")
function engio.myfunction(actor, place, a, b, c)
print("Myfunction actor=", actor," place=", place)
pprint("A:", a)
pprint("B:", b)
pprint("C:", c)
end
function engio.move(actor, place, action, xyz, facing)
-- todo: sanity check the parameters.
dprint("engio.move ", action, " ", xyz[1], " ", xyz[2], " ", xyz[3])
tangible.animate(actor, nil, {action=action, xyz=xyz, facing=facing})
end