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

Gammon Software Solutions forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Sending a command to another world

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Sending a command to another world

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Nylian   (12 posts)  [Biography] bio
Date Thu 21 Jun 2012 10:20 PM (UTC)  quote  ]

Amended on Thu 21 Jun 2012 10:28 PM (UTC) by Nylian

Message
So I am currently using this to send chat to another window.

Template:faq=23 Please read the MUSHclient FAQ - point 23.


What if I wanted to make an alias that send a lua command to that window? Specifically DeleteOutput()


I have attempted to use this, but it doesn't seem to recognize the command. (It's a dummy world, connecting to 0.0.0.0 named "chat")


-- --------------------------------------------------
-- Example showing sending a message to another world
-- --------------------------------------------------

function SendToWorld (name, message)

local otherworld

  otherworld = GetWorld (name)

  if otherworld == nil then
    Note ("World " .. name .. " is not open")
    return
  end

  Send (otherworld, message)

  -- alternative syntax:   otherworld:Send (message)

end -- of SendToWorld

SendToWorld ("MyOtherWorld", "say Hi there")



I can't seem to get it to work.

Thanks for the help
[Go to top] top

Posted by Digs   USA  (17 posts)  [Biography] bio
Date Reply #1 on Thu 21 Jun 2012 11:34 PM (UTC)  quote  ]
Message
Try this alias.


<aliases>
  <alias
   match="MyOtherWorld_clear"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>local otherworld = GetWorld ("MyOtherWorld")

if otherworld then
  otherworld:DeleteOutput()
end</send>
  </alias>
</aliases>
[Go to top] top

Posted by Digs   USA  (17 posts)  [Biography] bio
Date Reply #2 on Thu 21 Jun 2012 11:59 PM (UTC)  quote  ]
Message
Or rather this alias, since you did say that your dummy world was named "chat".


<aliases>
  <alias
   match="chat_clear"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>local otherworld = GetWorld ("chat")

if otherworld then
  otherworld:DeleteOutput()
end</send>
  </alias>
</aliases>
[Go to top] top

Posted by Nylian   (12 posts)  [Biography] bio
Date Reply #3 on Fri 22 Jun 2012 10:43 PM (UTC)  quote  ]
Message
Thank you VERY much, I was putting "chat" in too many places. Makes much more sense now.

Appreciated!
[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.


508 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]