Page 1 of 1
Way to simulate inputs?
Posted: November 29th, 2016, 9:09 pm
by LGP123
I just wanted to know if there were ways to simulate inputs (from keyboard) or maybe a way to insert any character a bit like with alt code but using luascript.
Edit: I found that there was a way with santa_ryan's control suit
. But maybe you guys know other ways ?
Re: Way to simulate inputs?
Posted: November 29th, 2016, 10:15 pm
by balala
I'm not sure what "santa_ryan's control suit" represents, but the following function can do what you asked:
Code: Select all
function makeString(l)
if l < 1 then return nil end -- Check for l < 1
local s = "" -- Start string
for i = 1, l do
s = s .. string.char(math.random(32, 126)) -- Generate random number from 32 to 126, turn it into character and add to string
end
return s -- Return string
end
function Update()
SKIN:Bang('!SetVariable', 'Rand', makeString(1))
end
This code returns into the Rand variable of your skin, a randomly chosen char.
Re: Way to simulate inputs?
Posted: November 30th, 2016, 9:45 am
by FreeRaider
LGP123 wrote:I just wanted to know if there were ways to simulate inputs (from keyboard) or maybe a way to insert any character a bit like with alt code but using luascript.
Edit: I found that there was a way with santa_ryan's control suit
. But maybe you guys know other ways ?
Can you indicate the skin you found, so as to allow others to have already a solution?
Re: Way to simulate inputs?
Posted: November 30th, 2016, 10:22 am
by LGP123