ATCP Events

Share your scripts and packages with other Mudlet users.
Post Reply
User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

ATCP Events

Post by tsuujin »

Ok, so what I want to do is raise an event every time I receive the ATCP line, so that I can simply tie my combat system settings into that event.

How would I go about doing this? How do events really work? What events are defined, and how do you define a new one?

Lots of questions, I know, but thanks in advance!

naftali
Posts: 138
Joined: Wed Jan 20, 2010 8:42 pm

Re: Events

Post by naftali »

vadi posted some good sample scripts for this here: http://forums.mudlet.org/viewtopic.php?f=6&t=1243

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Events

Post by tsuujin »

think you could point out where in the script the event is actually invoked? I'm having trouble finding it in the xml code.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Events

Post by Vadi »


User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Events

Post by tsuujin »

Cool, thanks.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Events

Post by Heiko »

To see what atcp messages your MUD is using click on the statistics button in the trigger editor or display(atcp).
To send atcp messages to the MUD you can use sendATCP( msg, content ) (requires current development version few people have, but I put it here for future reference).
When an ATCP message is arriving it looks like this: "msg content" where msg may not contain spaces and content can contain any kind of data except the the telnet sequence to end telnet subnegotiation. The msg is written as a key into the global table atcp and content will be its value. Then Mudlet will check if your scripts have defined event handlers for this particular msg and raise events accordingly.

naftali
Posts: 138
Joined: Wed Jan 20, 2010 8:42 pm

Re: ATCP Events

Post by naftali »

Sending ATCP events? What would that be used for?

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: ATCP Events

Post by Vadi »

Other MUDs that implement ATCP allow stuff being sent to server via it.

Achaea only really use it for Client.Compose, which Mudlet does for you, so on all IRE muds sendATCP isn't useful.

Post Reply