Greetings all,
I am attempting to create a mob database with sqlite. The db is very simple - I just have two fields: mobname and roomname. Both fields go into the sqlite db. The problem is that one of the variables (MyRoom) is going into the db as the variable name itself. I am guessing this is a syntax thing? Any insight would be most appreciated. Here is what I am using:
And when I check the db, the "%2" or mobname goes in as correctly. But, for roomname, I get "MyRoom".
Thanks much in advance!
I am attempting to create a mob database with sqlite. The db is very simple - I just have two fields: mobname and roomname. Both fields go into the sqlite db. The problem is that one of the variables (MyRoom) is going into the db as the variable name itself. I am guessing this is a syntax thing? Any insight would be most appreciated. Here is what I am using:
<triggers>
<trigger
enabled="y"
expand_variables="y"
group="mobdb"
match="^You get (.*) gold coin? from the dead body of (.*)\.$"
regexp="y"
send_to="12"
sequence="100"
>
<send>local MyRoom
--RoomName set by another trigger elsewhere that captures roomname.
MyRoom = GetVariable("RoomName")
--ensure vars are correct
Note ("%2 is in ",MyRoom)
--begin db stuff
DatabaseOpen ("mobs", GetInfo (66) .. "mobs.db", 6)
-- insert a record
DatabasePrepare ("mobs", "INSERT INTO mobtable (mobname, roomname) VALUES ('%2','MyRoom')") --> returns 0 (SQLITE_OK)
DatabaseStep ("mobs") -- returns 101 (SQLITE_DONE)
DatabaseFinalize ("mobs") -- returns 0 (SQLITE_OK)
DatabaseClose ("mobs") -- close it </send>
</trigger>
</triggers>
And when I check the db, the "%2" or mobname goes in as correctly. But, for roomname, I get "MyRoom".
Thanks much in advance!