Programmable Sleep Clock v3.31

<< < (41/59) > >>

J. M. Pescado:
Quote from: dizzy on 2006 November 08, 16:58:37

I think I've come up with a way to do automatic class bed setting. I've verified that the Lua code works, anyway:

Code:

local bed = GetPrimitiveParameter(0)
local g = GlobalObjManager:getObjectGUIDFromObjectId(bed)
SetTemp(0, GetConstantWithGuid(g, 4097, 2))

All you'd have to do is pass the bed objectId to the Lua, and this would give you the Energy rating.

Oh? Now that's interesting. What LUA is this?

dizzy:
I have a demonstration of how to do Lua like that in my new (lua-tester2b) hack I just posted.

twojeffs:
Oh, shiney! Thanks for pointing that out, Dizzy. I need that for ACR so I can abandon my half-assed workaround I had to do for sleepage after woohoo. ;D

ETA: Ah, so that's a custom lua function you wrote. Easy enough to define as a local lua object in the controller though. I'll have to give it a shot.

J. M. Pescado:
Do I need to install some janky program to mess with this LUA stuff or can this be done in NOTEPAD? I hate installing crap.

twojeffs:
You can define it as a local function and just include the code to run in the text file. I've seen examples of that in the code. Unfortunately I don't remember where at the moment. I'll have to dig one up to verify how it's done. That way you don' t need to compile an actual lua file at all.

Navigation

[0] Message Index

[#] Next page

[*] Previous page