Hi I wonder how to combine my Enemy table with GMCP output to create bind.
Like
Shiori and Calerian appers from west.
then script do
bind f2: send("kick ob_" .. 299170)
Enemy = {
{describe = "big pink orc", name = "Shiori", guild = "SC"},
{describe = "small white elf", name = "Calerian", guild = "OK"},
}
lua display(gmcp.objects.data)
{
["299170"] = {
team_leader = false,
defense_target = false,
attack_target = false,
desc = "Shiori",
attack_num = false,
team = false,
hp = 6,
living = true,
enemy = false
},
["12868"] = {
team_leader = false,
defense_target = false,
attack_target = false,
desc = "Calerian",
attack_num = false,
team = false,
hp = 6,
living = true,
enemy = false
}
}
I have something like this but is not woking:
function Bind_gmcp()
echo("\n0")
for k, v in pairs(gmcp.objects.data) do
echo("\n1 - "..v["desc"])
if v["desc"] and Enemy[v["describe"]]
or Enemy[v["name"]]
then
echo("\n2")
scripts.people.bind_attack_obj = k
scripts:print_log("**** F2: Zaatakuj <yellow>" .. v["desc"] .. "<tomato> ****")
echo("\n3")
end
end -- for
echo("\n4")
end -- function
Please help.