I have a plugin script similar to the following (just a snippit of the problem areas):
Problem is when Start() finds a valid value in DBTable, and sends it to SetTablename(), the script seems to stop working as it should...Notes and Tells that the script should send to the mud window stop working. Variables are still set and updated, however.
It seems like the problem is on the "SetVariable" line (debugging and commenting out code), but I can't figure out how to fix it. Any ideas?
<trigger
enabled="y"
keep_evaluating="y"
match="^Welcome back, (.+)\.$"
name="TriggerWelcomeBack"
regexp="y"
send_to="12"
sequence="100"
>
<send>
SetTableName("%<1>")</send>
</trigger>
function SetTableName(TableName)
TableName = string.gsub (TableName, "[^%a%d]", "_") --replace all non-letters or numbers with _
if TableName ~= dbTable then
dbTable = TableName
SetVariable ("DBTable", dbTable)
end
ColourNote("Cyan","black", "Using "..dbTable.."'s data as the Current Data for People_Met Plugin.")
end --function
function Start()
dbTable = "Table"
local dbTableCheck = GetVariable("DBTable")
if dbTableCheck ~= nil and dbTableCheck ~= "" then
SetTableName(dbTableCheck)
end
end --function
function OnPluginInstall ()
Start()
end -- OnPluginInstall
function OnPluginEnable ()
Start()
end -- OnPluginEnable
Problem is when Start() finds a valid value in DBTable, and sends it to SetTablename(), the script seems to stop working as it should...Notes and Tells that the script should send to the mud window stop working. Variables are still set and updated, however.
It seems like the problem is on the "SetVariable" line (debugging and commenting out code), but I can't figure out how to fix it. Any ideas?