[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Displaying table in note or send not working for me
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Displaying table in note or send not working for me

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by TruckDriver22   Denmark  (22 posts)  [Biography] bio
Date Wed 13 Jan 2016 04:41 PM (UTC)

Amended on Tue 19 Jan 2016 03:57 PM (UTC) by TruckDriver22

Message
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.

Click bang... GAME OVER!
[Go to top] top

Posted by Fiendish   USA  (1,641 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Wed 13 Jan 2016 08:01 PM (UTC)
Message
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.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by TruckDriver22   Denmark  (22 posts)  [Biography] bio
Date Reply #2 on Tue 19 Jan 2016 04:31 AM (UTC)
Message
ok next time i have a question ill do that. so no help on this?

Click bang... GAME OVER!
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] bio
Date Reply #3 on Tue 19 Jan 2016 04:45 AM (UTC)
Message
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.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[Go to top] top

Posted by Nick Gammon   Australia  (21,321 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Tue 19 Jan 2016 06:10 AM (UTC)
Message
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?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by TruckDriver22   Denmark  (22 posts)  [Biography] bio
Date Reply #5 on Tue 19 Jan 2016 04:00 PM (UTC)
Message
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.

Click bang... GAME OVER!
[Go to top] top

Posted by Nick Gammon   Australia  (21,321 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Tue 19 Jan 2016 08:41 PM (UTC)

Amended on Tue 19 Jan 2016 08:42 PM (UTC) by Nick Gammon

Message
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

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


2,970 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]