Hello Guest it is October 04, 2023, 10:51:34 PM

Author Topic: put userdata in register  (Read 203 times)

0 Members and 1 Guest are viewing this topic.

Offline TonyM

  •  12 12
    • View Profile
put userdata in register
« on: May 26, 2023, 04:37:05 AM »
hello all, to try and fix my problem from another post (macro runs fine in screen but gets stuck on require luars part if the exact same code is run from a macro m6) I tried bypassing it by running part of the code from the screen ( the luars part) and then putting p in the register and later reading the register in the m6 macro, but it gives an error exected string but got userdata. i converted it to a string and that solved it but the macro the gets stuck on p:write because i assume the p is still a string and not userdata. is it possible to convert a string to userdata?

« Last Edit: May 26, 2023, 04:41:06 AM by TonyM »
Re: put userdata in register
« Reply #1 on: May 26, 2023, 09:55:07 AM »
If I understand you correctly:
The tonumber() method in Lua converts the value provided to it into a number. If this argument is a number or a convertible string, the tonumber() function returns the converted number. If it is not a number or a convertible string, it will return nil .