Displaying table in note or send not working for me

Posted by TruckDriver22 on Wed 13 Jan 2016 04:41 PM — 7 posts, 30,493 views.

Denmark #0
my bash_table has a few names it and it works on triggers but it wont display cannot seem to figure out why.

i fill it with another alias that uses this to capture

<aliases>
  <alias
   name="pkmode"
   match="pkmode (?P&lt;bashed&gt;([A-z][a-z]+))"
   enabled="y"
   group="autobash"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>EnableTrigger("punch",true)
EnableTrigger("repunch",true)
EnableTriggerGroup("autobash",true)
EnableTriggerGroup("Tankmode",false)
EnableTriggerGroup("Assistmode",false)
EnableTriggerGroup("Bashmode",false)
EnableTriggerGroup("disarm",false)
EnableTimer("rescuecasters",false)
EnableTimerGroup("assistbot101",false)
EnableTimer("assist",false)
EnableTimerGroup("Assistmode",false)
Note("pkmode")
bash_table = bash_table or {}
bash_table.%&lt;bashed&gt; = true
Alertbox = assert (GetWorld ("Alertbox"),"Alertbox not open")  
-- gets the world
Alertbox:ColourNote("black", "white", "Basher AUTO BASHING %&lt;bashed&gt;")</send>
  </alias>
</aliases>


then i would assume this would display the table
but it shows it as empty.
alias
pklist..is

<aliases>
  <alias
   match="pklist"
   enabled="y"
   send_to="12"
   keep_evaluating="y"
   sequence="100"
  >
  <send>bash_table = bash_table or {}
Note(table.concat (bash_table, ","))
t_t = 
  {
  "the", 
  "quick", 
  "brown", 
  "fox", 
  "jumped",
}

Note(table.concat (t_t, ","))</send>
  </alias>
</aliases>


--- thanks in advance for any help with this as it has been a journey getting as far as i have carefully going threw many post in here by nick and others.
Amended on Tue 19 Jan 2016 03:57 PM by TruckDriver22
USA Global Moderator #1
Template:copying
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.
Denmark #2
ok next time i have a question ill do that. so no help on this?
USA #3
For us to help you, we need to be able to read the info the way the client sees it rather than trying to guess at white space and bracket matches and such.
Australia Forum Administrator #4
TruckDriver22 said:

ok next time i have a question ill do that. so no help on this?


Do you have a problem with editing your question and making it easier for people to help you? Next time you'll do that, eh? Why not this time?
Denmark #5
I have put in the coding and added my entire alias.
that wasn’t so hard at all. when i actually have time to look at things.
Australia Forum Administrator #6
The table.concat function works on numerically-keyed tables.

So, your example of:


t_t = 
  {
  "the", 
  "quick", 
  "brown", 
  "fox", 
  "jumped",
}

Note(table.concat (t_t, ","))


... works like this:


the,quick,brown,fox,jumped


However with alpha keys (as you seem to be using) it won't:


bash_table = {
  fox = true,
  naga = true,
  }
Note(table.concat (bash_table, ","))


Output:





One approach is to copy the items from your table to a temporary table for displaying:


bash_table = {
  fox = true,
  naga = true,
  }

temp = { }
for k, v in pairs (bash_table) do
  table.insert (temp, k)
end -- for

table.sort (temp)
Note(table.concat (temp, ","))


Output:


fox,naga