hi
When I run this in the Immediate window (ctrl + i)
it works without error.
But if I put it in a alias like this:
I get this error:
When I run this in the Immediate window (ctrl + i)
it works without error.
MyQuestTarget = "a cat"
MyQuestRoom = "A Side Alley"
MyQuestArea = "The Land of the Beer Goblins"
assert (package.loadlib ("mysql.dll", "luaopen_luasql_mysql")) ()
env = assert (luasql.mysql())
con = assert (env:connect ("aardwolf", "", "", ""))
cur = assert (con:execute ("SELECT * from lastkill WHERE room = '"..MyQuestRoom.."' AND zone = '"..MyQuestArea.."'"))
row = cur:fetch ({}, "a")
while row do
print ("\n------ new row ---------\n")
print ("Name:", row.name)
print ("Shortname:", row.shortname)
-- table.foreach (row, print)
-- reusing the table of results
row = cur:fetch (row, "a")
end -- do
-- close everything
cur:close()
con:close()
env:close()But if I put it in a alias like this:
<aliases>
<alias
match="testsql"
enabled="y"
send_to="12"
sequence="100"
>
<send>MyQuestTarget = "a cat"
MyQuestRoom = "A Side Alley"
MyQuestArea = "The Land of the Beer Goblins"
assert (package.loadlib ("mysql.dll", "luaopen_luasql_mysql")) ()
env = assert (luasql.mysql())
con = assert (env:connect ("aardwolf", "", "", ""))
cur = assert (con:execute ("SELECT * from lastkill WHERE room = '"..MyQuestRoom.."' AND zone = '"..MyQuestArea.."'"))
row = cur:fetch ({}, "a")
while row do
print ("\n------ new row ---------\n")
print ("Name:", row.name)
print ("Shortname:", row.shortname)
-- table.foreach (row, print)
-- reusing the table of results
row = cur:fetch (row, "a")
end -- do
-- close everything
cur:close()
con:close()
env:close()</send>
</alias>
</aliases>
I get this error:
Compile error
World: Aardwolf
Immediate execution
[string "Alias: "]:14: unfinished string near '"'