Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ phpscript

phpscript

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Yoblew   (4 posts)  Bio
Date Thu 06 Aug 2009 08:33 PM (UTC)
Message
Is php still useable within Mushclient? I see the option for it in the dropdown and i can output the version, so i know i at least that have part setup, and i read a thread on the globals, but is it something thats worth pursuing to use? I use php on a daily basis so i'd like to give it a go but if i've got to go to some extremes to make it work i'll just use perl or lua.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 06 Aug 2009 09:48 PM (UTC)
Message
As far as I know, it works.

However different script engines, when shoe-horned into the Windows Script Interface, work with varying degrees of success. I think for a while PHP had an annoying side-effect that it would simply close the client and exit the entire process, if there was a syntax error in your script.

Personally, I would recommend using Lua instead. The structure of Lua is similar enough to PHP (and C for that matter) that it isn't too hard to pick up. I speak as someone who writes a lot of code in Lua, and also maintains my web pages in PHP.

There are some functions and functionality only available in Lua. For example, triggers get a table of all the style runs in the matching line. There are also some script extensions in Lua, like getting all the files in a directory.

The other advantage of Lua is, since it is bundled with MUSHclient, if you write a script or plugin in Lua, you can be sure other players can use it. If you use PHP, they have to install that first.

Oh, and the help files which come with MUSHclient have help built into them for all the standard Lua libraries, so you can quickly look up the syntax of things like string.find.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Yoblew   (4 posts)  Bio
Date Reply #2 on Fri 07 Aug 2009 02:31 PM (UTC)
Message
Thanks for the reply Nick. I think im starting to see some of the...nuances of using php as i started writing for it. I've used lua quite a bit back when i played WoW, so its not that i dislike it, i just thought it would be fun to do in php. However the tiny differences between actual php on a webpage/script and using it within mush are starting to drive me nuts. Most of it i assume is my general lack of knowledge regarding MUSH itself. I'm gonna keep pressing on with it for now. I think more then anything i need to learn how to use Mush itself.

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.


11,830 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.