Hi, I have read through many different posts on the forums trying to figure out how to do what I want to do. This includes the nice tutorial/help on lua tables, as well as other posts asking about tables, and I still can not quite grasp all the components I need.
What I would like to do is capture a bunch if information after typing : group
example text after command:
Your group of 10 members consists of:
Member Hits Move Position Fly Inv Water iMT Here Light Mem
---------------------------------------------------------------------------------
Bob perfect rested standing Y N N N Y 0 0
Rob good rested standing Y N Y Y Y 0 0
Lob bad rested sitting Y N Y Y Y 2 0
This trigger works well for capturing the information and storing into a table (groupArr) as a single string. But, ultimately what I would like to do is form sub-tables for each character name with the information so that i can access each given information provided individually.
Example: make a trigger to check to see if Bob is flying, or sitting, or in bad condition so that i can fly whoever needs flying or heal someone who is at bad health.
for k,v in pairs(groupArr) do
if v.here == "Y" and v.mv == "fatigue" then
if k == "%1" then
print(k)
end
end
end
this is a test alias to see if this all did what I wanted to do. The goal is to eventually make a trigger that checks the group and then casts spells like fly if someone needs it. In this case I am checking both their movement and if they are in the room so i can refresh their movement. It seems to work. If anyone has a better suggestion i would love to hear it because I am still fairly new at this.
Thanks for all the help so far, these forums have helped a ton
Hello. I have been using one of the examples Fiendish gave:
groupArr["%1"] = {"%2","%3","%4","%5","%6","%7","%8","%9","%10","%11"}
It works great for all the stuff I wanted this table to do. However, I was wondering if there was a way send this table information to a mini-window. I am not looking for anything too fancy. I have watched and read the examples like http://gammon.com.au/forum/bbshowpost.php?id=9965, but all of these examples use a wait to capture the information as a single line. I am not really sure how to insert something like the above table into the windowtext.