Hello Guest it is March 28, 2024, 11:42:48 AM

Author Topic: Screen load script question  (Read 3676 times)

0 Members and 1 Guest are viewing this topic.

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Screen load script question
« Reply #10 on: April 14, 2017, 05:48:36 PM »
So I have just read through this thread and puzzles me why you are trying to send the register name?? this will always stay the same if using the register plugin, you cannot change it.

In my own screen I use

Code: [Select]
function GetRegister(regname)
    local hreg = mc.mcRegGetHandle(inst, string.format("Custom_Gui/%s", regname))
    return mc.mcRegGetValueString(hreg)
end

function WriteRegister(regname, regvalue)
    local hreg = mc.mcRegGetHandle(inst, string.format("Custom_Gui/%s", regname))
    mc.mcRegSetValueString(hreg, tostring(regvalue))
end

so just change string.format("Custom_Gui/%s" to the reg you are using string.format("iRegs0/%s" and all should work fine

DazTheGas
New For 2022 - Instagram: dazthegas

Offline gorf23

*
  •  183 183
    • View Profile
Re: Screen load script question
« Reply #11 on: April 15, 2017, 02:14:37 PM »
mine is close to yours I did get it to work now I put in a module and can call it from a button or m code now
guess that was the part I wasn't getting...

Daz you should do a video on setting up modules that can be called  from buttons or m code  that would save a lot of people like me so
much trouble and maybe a lot less questions..

Thanks for all your help..
Gary