innsraka.blogg.se

Mudlet lua version
Mudlet lua version











mudlet lua version
  1. #MUDLET LUA VERSION FULL#
  2. #MUDLET LUA VERSION CODE#
  3. #MUDLET LUA VERSION SERIES#

Note that you can also use external Scripts.

#MUDLET LUA VERSION CODE#

I'm not sure what you mean by "masive crashes", so you may try to adjust the timeout=X value (up or down) in the code above to try to get rid of those crashes.- first sword for alias,name in pairs(venoms) do if (alias = matches) then envenom(s1, name) end if (alias = matches) then envenom(s2, name) end end Loop:iteration() - NOTE: instead of your "client:_ioloop_iteration()" call

mudlet lua version

Here is a better code example: local loop = require("mqtt.ioloop").get(true, ) - NOTE: you can try to adjust this timeout value In this case, the best option will be to implement a "connector" based on that sockets: įinally, if you have only timers - your way is also can work. Lua is the structure, but what 'makes things happen' is the functions provided by the client. It's possible that it has its own sockets implementation. Certainly they both use Lua, but it is like trying to convert zMud Lua to MUSHclient (or vice-versa). The other way is to use the networking capabilities of your Mudlet Lua environment. So the entire CPU time of the separate thread will be used for network communication. I'm not familiar with the Mudlet Lua environment, but if you can run a separate OS thread with the "n_ioloop(client)" call in this - this can be the best option. The ioloop and its ":run_until_clients()" method (or "n_ioloop(client)" wrapper) is the right thing to do that.

mudlet lua version

To make the MQTT connection work, something in your code should periodically pull packets from the server and monitor a connection state. I guess my question is: Am i doing it wrong? Can i run the ioloop wihtout it crashing the main thread? Or if i need to run the ioloop manually, is this the correct way to do it, by manually calling _ioloop_iteration() at a fixed interval? Or is there a better way, calling some method that will check the inbound queue, fire the callbacks then exit without looping?

#MUDLET LUA VERSION SERIES#

Extended color table: Adds two sets of colors, Aetolian color (specially-named colors that match Aetolia's standard output) and the 'dead' series (super dark colors, great for backgrounds). From time to time, I like to share things I've made on Mudlet. I did try to run the client:_ioloop_iteration() at 100ms instead, but then i had masive crashes again. January 2013 edited April 2014 in Scripts.

#MUDLET LUA VERSION FULL#

I would have preferred to run it faster though, as the client is "sluggish" when receiving external messages (understandably) with a 1 second period. A modern open source MUD client with a graphical user inteface and full built in Lua scripting support for all major platforms. Now i can publish, and subscribe to messages in Mudlet. This works ok'ish when i run it at 1 second period. Normally when you create a variable, it is set globally and you can not use that. I managed to get past this issue, by not running ioloop, but rather setting up a timer that run the client:_ioloop_iteration() at a fixed interval. Tables in Lua are basically advanced variables.

mudlet lua version

If i run the ioloop the way the examples describe, I will basically crash the mudclient as the ioloop is blocking the "main thread" from executing. Best of all, the Lua API is seamlessly integrated in Mudlet and shared by all aliases, triggers, scripts, keybindings, buttons and other Mudlet components. And i have almost gotten it to work the way i want it to using luamqtt. This allows Mudlet to leverage the existing community and large ecosystem of existing packages for Lua without the many drawbacks of creating a Mudlet specific scripting language. I am trying to implement mqtt support into a mudclient (Mudlet) that has lua as its backend script language.













Mudlet lua version