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 ➜ a few questions regarding php, and triggers

a few questions regarding php, and triggers

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


Posted by Thecreator   (2 posts)  Bio
Date Fri 01 Jun 2007 11:55 PM (UTC)
Message
Hello,
I've got a couple questions.
First, I've got a trigger, that appends %0 to a notepad.
I have four to be exact, and set the label to tells.
Now, when I do this, it gives me an error, apparently, I can't append with multiple triggers to the same notepad.
Is there a way to accomplish this?

Next, I've got a couple more questions.
Would someone happen to have some sample php scripts I could look at?
Also, Where could I get the dll I have to use for php 5?
Finally, How do I register a command to call a script?
I seen the scripting tutorial, but I use a screen reader.
For those of you who don't know, a screen reader is for those who are blind, it takes what is on the screen, and produces it in a voice output, and all the examples and outputs shown in the scripting tutorials were pictures, which my reader can't process.

Thanks for all the help,
~~TheCreator~~
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 02 Jun 2007 03:38 AM (UTC)
Message
You can't have multiple triggers with the same name.

To do what you want, use "send to script" instead, and use AppendToNotepad, see:

http://www.gammon.com.au/scripts/doc.php?function=AppendToNotepad

As for the PHP tutorials, I would use Lua, that comes built in to MUSHclient, and you will get more support more easily on this forum, because of that.

- Nick Gammon

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

Posted by Thecreator   (2 posts)  Bio
Date Reply #2 on Sat 02 Jun 2007 04:57 AM (UTC)
Message
Hello,
The triggers have different names, but I want four different triggers to append to the same notepad, which it is not letting me do.

Also, there are reasons why I do not wish to use lua.
1, I don't really like it's syntax, though I should try to learn it.
Second, I really don't have the time to be trying to learn it, and I already know php.
I'd rather code in something I already know.
If I can't get something working that is supposed to be working, or that is supposed to be implemented in the program, it's senseless for me to even use the thing.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #3 on Sat 02 Jun 2007 05:28 AM (UTC)
Message
It is letting you do it, if you followed my suggestion. The only thing it doesn't let you do is name 4 triggers the same. It is like trying to have 4 files of the same name in the same directory.

Here is an example trigger, using Lua, you may need to modify it slightly to follow the PHP syntax:


<triggers>
  <trigger
   enabled="y"
   match="something"
   send_to="12"
   sequence="100"
  >
  <send>
AppendToNotepad ("chats", "%0\n")
</send>
  </trigger>
</triggers>


Since this trigger doesn't have a name, you can make more like it, to match different things.

- Nick Gammon

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

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #4 on Sat 02 Jun 2007 07:15 AM (UTC)
Message
Quote:
Also, there are reasons why I do not wish to use lua.

This is the best part about MUSHclient, in my opinion... choice. If you don't like Lua, just use php or whatever scripting language with which you are most familiar. All of the inbuilt functions have a nearly identical syntax, so it's even easy to translate scripts/plugins from one language to another if you know them both decently well.

I think the main reason why Nick seems to like Lua so much is just that it is a very powerful, simple language. The syntax can be a bit odd at times if you are used to other languages, but it is very easy to learn if you put a week's effort in. Also, note how many extra features there are for Lua because of its versatility. There are some things for MUSHclient that you just can't do easily with any other language.

That being said, on my laptop, I have scripts running in Lua, Jscript, and VBscript, so I'm certainly not going to say that anyone should limit themselves to a specific language.

It is much easier to fight for one's ideals than to live up to them.
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.


17,629 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.