|
yawdoolf Beginner
Joined: 21 Sep 2008 Posts: 10
|
|
|
|
yawdoolf Beginner
Joined: 21 Sep 2008 Posts: 10
|
Posted: Sun Oct 12, 2008 11:10 pm |
I've solved this problem by zs.cmd.execute (or zs.exec).
This command lets you do anything, but I don't think that it's efficient due to additional parsing.
I think that there could be functions zs.sys.x1() .. zs.sys.x99() returning two values (XStart XEnd).
Then Lua code could be like that:
Code: |
xstart, xend = zs.sys.x1()
zs.cmd.pcol(color, xstart, xend)
|
or
Code: |
zs.cmd.pcol(color, zs.sys.x1())
|
What do you think? |
|
|
|
Daagar Magician
Joined: 25 Oct 2000 Posts: 461 Location: USA
|
Posted: Mon Oct 13, 2008 3:06 am |
From what I'm seeing in the docs, it appears you can get at those predefined variables simply via zs.x1(), zs.x2(), etc. When using the zs object, it will look for commands first of that name, then functions, then predefined variables. So long as you haven't created any commands or functions with the name x1, zs.x1() should find it - or you can get at it specifically just as you described via zs.sys.x1().
|
|
|
|
yawdoolf Beginner
Joined: 21 Sep 2008 Posts: 10
|
Posted: Mon Oct 13, 2008 7:17 pm |
I doesn't work. I've just used "print(zs.sys.x1())" and got error.
Does it work with you? |
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Tue Sep 05, 2023 9:06 pm |
Thank you Daagar for putting me on a track to finding the solution. For anyone else searching for this, this does work in Lua for GMCP (if you have GMCP enabled and the GMCP package on your MUD is like this of course):
Code: |
local channel = zs.gmcp.Comm.Channel.Text.channel |
The predefined variable equivalent would be %gmcp.Comm.Channel.Text.channel in zScript. So this is an example as a guide.
Note, this does not work with the parentheses:
Code: |
local channel = zs.gmcp.Comm.Channel.Text.channel() |
|
|
|
|
|
|