Scripting in PHP

Posted by Xavious on Wed 15 Apr 2015 05:40 PM — 4 posts, 18,243 views.

#0
I was pretty excited when I noticed PHP on the scripting drop down one day. However, it doesn't seem to be included after initially downloading MUSHclient. I stumbled upon this thread: http://www.gammon.com.au/forum/?id=5813

Does anyone know of a reliable place to download php5activescript.dll safely? I'm also curious if this is all that is required to support scripting in PHP.
Australia Forum Administrator #1
It supports selecting PHP as the script engine, however installing the PHPscript DLL is something you have to do.

I haven't used PHP for ages, I presume if you got the scripting engine from the PHP site it would (probably) work, still.

However, I recommend using Lua, which is built in, and is less likely to be flaky.
#2
Thanks for the response Nick. Learning Lua is on my to do list. I started out using VBScript ages ago, because at the time I was learning Visual Basic at school and it came naturally.

Now I program in PHP professionally and I figured I could leverage that professional experience to give me an edge in mud scripting.

I'll either take a chance on one of these sketchy dll download sites or just buckle down and learn Lua!
Australia Forum Administrator #3
I use PHP to do these web pages, and also for other projects I have to hand (like my home management system).

However having used Lua now I wouldn't attempt to use PHP for scripting in MUSHclient. For one thing, some things have Lua-only extensions (for example, trigger functions get style runs as an optional fourth argument).

Plus there are some Lua-only functions (in the "utils") table which do things like enumerate directories. Another big feature is the ability to serialize variables (including tables) making saving / restoring large numbers of variables easy.

Finally, Lua has co-routines which help you do things like send a message and wait for a response, without hanging the client.