|
aeslynn Newbie
Joined: 08 Apr 2019 Posts: 4
|
Posted: Mon Apr 08, 2019 4:55 pm
Building up a raw telnet variable and accessing wildcards in #LUA |
Hello,
I had two questions that I'd love answered -- 1. Can you build up a raw telnet sequence to send to the server? i.e.
Code: |
$msdpReportableVariables = $msdpReportableVariables%char(2)HEALTH;#sendsb 69 $msdpReportableVariables |
. I did try the above code but it doesn't seem to work.
2. Can you access the %wildcards from a pattern in #LUA{}?
Thanks! |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4662 Location: Pensacola, FL, USA
|
Posted: Wed Apr 10, 2019 2:17 pm |
Nothing says you have to code entirely in Lua, you could easily just stick the lua you need inside a #LUA command, and use zscript for the rest, if you wanted.
I would use the %concat function to properly string them all together into a CMUD variable, which you can then access via lua code as zs.var.varName
Use: zs.param(n)
To reference the captured bits in a trigger. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
aeslynn Newbie
Joined: 08 Apr 2019 Posts: 4
|
Posted: Fri Apr 12, 2019 8:30 pm |
shalimar wrote: |
Nothing says you have to code entirely in Lua, you could easily just stick the lua you need inside a #LUA command, and use zscript for the rest, if you wanted.
I would use the %concat function to properly string them all together into a CMUD variable, which you can then access via lua code as zs.var.varName
Use: zs.param(n)
To reference the captured bits in a trigger. |
I'm a bit confused. %concat still doesn't seem to create the end variable correctly. As an example, I'm trying to create a variable that starts with
. Then, it iterates through a stringlist variable via #FORALL and should concat
. Finally, it should #sendsb the built variable.
I realize that #LUA {} works; however, I'm not sure how to access a wildcard from there. For example, a wildcard from a trigger whose match is in %2. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4662 Location: Pensacola, FL, USA
|
Posted: Sat Apr 13, 2019 1:38 am |
$var=%concat("%69 %char(1)REPORT", %expandlist(@someVar), "%char(2)%i")
See '#HELP %expandlist' to get it to spit out formatting how you want it.
use zs.param(2) to access %2 in lua |
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|