a few questions regarding php, and triggers

Posted by Thecreator on Fri 01 Jun 2007 11:55 PM — 5 posts, 22,778 views.

#0
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~~
Australia Forum Administrator #1
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.
#2
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.
Australia Forum Administrator #3
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.
USA #4
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.