I am using a script at the moment which compares what's in the room with a list of viable targets, but there's some inconstancy with capitalisation (Elder instead of elder, etc) in the GMCP data. I was wondering if there was a way to auto-capitalise everything when assigning to a table...
Here's a snippet of the script:
autotarget.here = autotarget.here or {}
function autotargetHereAdd()
if gmcp.Char.Items.Add.location == "room" then
table.insert(autotarget.here, gmcp.Char.Items.Add.item)
end
end
I have tried using :title() around gmcp.Char.Items.Add.item to no avail. Will I need to loop through my table and update each entry?
Hiroma tells you, "I just got to listen to someone complain about your deadly axekick being the bane of their existence."
Archdragon Mizik Corten, Herald of Ruin says, "Man, that was a big axk."
Hellrazor Cain de Soulis, Sartan's Hammer says, "Your [sic] a beast."
Comments
if string1:lower() == string2:lower() then ...
Otherwise, I'm not sure why the capitalisation matters.
Archdragon Mizik Corten, Herald of Ruin says, "Man, that was a big axk."
Hellrazor Cain de Soulis, Sartan's Hammer says, "Your [sic] a beast."