Hello, I'm trying to create a script to grab a password after I execute a spell. Then I need to whisper that password to the face to open a door.
Two problems:
1- when I capture the password and capture it as a variable, there's a leading space in front of it which the door wont' accept. How do I truncate the first empty space?
2- I can't seem to do a Send command (using Lua) with additional text along with the variable. I'm sure it's syntax, but if I can't do a Send command with additonal text combined with the variable, how do I combine two variables together into one string?
Trigger: The runes have moved to form the word:*
Code:
require "wait"
wait.make (function ()
SetVariable ("password", "%1")
SetVariable ("password", (string.format ("%.9s", (GetVariable ("password")))))
Note (GetVariable ("password"))
Send ("rub orb")
wait.time (06)
Send ("whisper face Your name is" (GetVariable ("password")))
end)
The %.9s truncates the last letter, but I'm trying to truncate the first letter.
And I get an script error for the Send ("whisper... line.
Thanks for any help!
Two problems:
1- when I capture the password and capture it as a variable, there's a leading space in front of it which the door wont' accept. How do I truncate the first empty space?
2- I can't seem to do a Send command (using Lua) with additional text along with the variable. I'm sure it's syntax, but if I can't do a Send command with additonal text combined with the variable, how do I combine two variables together into one string?
Trigger: The runes have moved to form the word:*
Code:
require "wait"
wait.make (function ()
SetVariable ("password", "%1")
SetVariable ("password", (string.format ("%.9s", (GetVariable ("password")))))
Note (GetVariable ("password"))
Send ("rub orb")
wait.time (06)
Send ("whisper face Your name is" (GetVariable ("password")))
end)
The %.9s truncates the last letter, but I'm trying to truncate the first letter.
And I get an script error for the Send ("whisper... line.
Thanks for any help!