Scripting Problem

Have the following script:

local mydb = db:create("EnemiesAndAllies", {enemies={"name"}, allies={"name"}})

 

function addEnemy(person)

db:add(mydb.enemies, {name=person})

echo("Added " .. person .. " to enemy list!")

end

 

function addAlly(person)

db:add(mydb.allies, {name=person})

echo("Added " .. person .. " to Ally list!")

end

 

And then i have the aliases:

^adden (.*)$

it does:

addEnemy(matches[2])

 

 

Does not work but throws no errors, what am i doing wrong?

 

Comments

  • I finally got this to work. I used tables instead. Loading and saving them with scripts referrenced by the aliases. I wanted to manually add people to enemies and allies lists instead of just getting cityenemies list because some city enemies are from allied cities. So this is safer to use for highlighting. If anyone else is interested in this ill repost the scripts for it. Im sure it is probably crude. But it works good for me so far. Highlights allies in blue and enemies in green (because target is red).
Sign In or Register to comment.