|
Cronyx Beginner
Joined: 19 Jan 2002 Posts: 12 Location: USA
|
Posted: Sat Jan 19, 2002 7:57 pm
Colors and Triggers |
*waves* Hi, new to the forum here. Just bought zmud about a week ago and love it. Got a quick question though, I seem to be rather ill-addept at setting triggers, perhaps one of you could help. I've got this line of text I want to alter how it displays to me, to get my attention if other stuff is scrolling too fast.
Somewhere on the muck, Player has connected.
Somewhere on the muck, Player has disconnected.
The game has a kind of built in buddy list. Anyway... These are the two strings. I want to change the "Player" part to bright blue, and "connected" to green, and "disconnected" to red.
I also want to create a button, that when I push it, it sets me afk, so that first and foremost, it will page the player who messaged me that I am AFK and they are recieving an automatic message, and they should msg me with the (case sensative) message of "WALRUS" to get my attention, at which point it would play a wav file on my end to let me know somebody wants my attention.
Here's the string when I get "paged"...
Player pages, "This is a message" to you.
The game's syntax for sending pages is as follows
page player = This is a message
What would also be kinda cool is a zmud timer, say... 10 minutes or so, that would automaticly "press" that afk button to start this up.
One other thing... would it be possible to also include in the canned message how long I've been gone? like...
page player = I'm AFK at the moment, page me with "WALRUS" to beep me but only if it's important. (Idle for HH:MM)
I suppose zmud would need to be counting how long the afk trigger had been active for that.
Thanks a lot all.
"There is a very fine line between genius and insanity. I have erased this line." -- Oscar Levant |
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Sat Jan 19, 2002 9:27 pm |
quote: The game has a kind of built in buddy list. Anyway... These are the two strings. I want to change the "Player" part to bright blue, and "connected" to green, and "disconnected" to red.
#CLASS {PlayerColor}
#trigger {Somewhere on the muck, (%w) has connected.} {#sub {Somewhere on the muck, ~<color blue~>%1~</color~> has ~<color green~>connected.~</color~>}}
#trigger {Somewhere on the muck, (%w) has disconnected.} {#sub {Somewhere on the muck, ~<color blue~>%1~</color~> has ~<color red~>disconnected.~</color~>}}
#CLASS 0
- Charbal
I may get around to posting on the AFK answering machine. For now, check out: http://pub59.ezboard.com/fwotmud60802frm6.showMessage?topicID=46.topic |
|
|
|
Cronyx Beginner
Joined: 19 Jan 2002 Posts: 12 Location: USA
|
Posted: Sat Jan 19, 2002 9:49 pm |
Thanks a lot Charbal, really appriciate it. Get to the other request whenever you have time, no rush. Or anyone else can help me out, I'm not picky :)
"There is a very fine line between genius and insanity. I have erased this line." -- Oscar Levant |
|
|
|
Cronyx Beginner
Joined: 19 Jan 2002 Posts: 12 Location: USA
|
Posted: Mon Jan 21, 2002 1:55 am |
I'm still looking for anyone who can help me with the "afk answering machine" as Charbal so eliquantly put it. If anyone could give me some code to start out with based on the above information, or all of it if it's not too much trouble, I'd deeply appriciate it. Thanks
"There is a very fine line between genius and insanity. I have erased this line." -- Oscar Levant |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Jan 21, 2002 2:53 am |
quote:
I'm still looking for anyone who can help me with the "afk answering machine" as Charbal so eliquantly put it. If anyone could give me some code to start out with based on the above information, or all of it if it's not too much trouble, I'd deeply appriciate it. Thanks
"There is a very fine line between genius and insanity. I have erased this line." -- Oscar Levant
Using a simple push button:
CAPTION -- AFK @AFK.word
CODE --
#IF (@AFK.state) {
;You are coming back now, so you are not AFK
@AFK.state = 0
@AFK.word = OFF
@AFK.time = 0
} {
;You are leaving, so you are AFK
@AFK.state = 1
@AFK.word = ON
@AFK.time = %secs //this is the predefined variable corresponding to seconds after midnight
}
Then create a trigger to field the pages:
#trigger {(%w) pages, "(%*)" to you.} {#if (@AFK.state) {
page %1 "= I am AFK or otherwise busy elsewhere. Send me a page with the message of WALRUS (case sensitive) to get my attention"
#PLAY "c:zmudyourpathafk.wav"
} {#noop I'm assuming that since you are not AFK, you'll handle these as they appear}}
I've set the AFK values and captured the time when you go AFK, but I'll leave you the challenge of figuring out the elapsed time.
Oh, and like they say, all this is considered untested.
li'l shmoe of Dragon's Gate MUD |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Mon Jan 21, 2002 3:05 pm |
Since Cronyx wants the sound to play only when someone sends the case sensitive WALRUS page, I suggest a small change to Matt's script:
#trigger {(%w) pages, "(%*)" to you.} {#if (@AFK.state) {
page %1 "= I am AFK or otherwise busy elsewhere. Send me a page with the message of WALRUS (case sensitive) to get my attention"} {#noop I'm assuming that since you are not AFK, you'll handle these as they appear}}
#trigger {%w pages, "WALRUS" to you.} {#PLAY "c:zmudyourpathafk.wav"} "" {case}
I just moved the command to play the sound to another trigger.
Now, to automatically go AFK would require for you to have a trigger that would know when you enter a command. This is easily done with an OnInput trigger set to match everything. This trigger would set a counter variable to zero.
You would also have an Alarm trigger set to fire every second and this alarm increments the counter variable by one each time it fires. When the counter reaches what would be 10 minutes (600), you set off the button.
To set off the button through code, you need to first give the button a variable for its Variable field. @AFK.state would work nicely for this. After that, all you need is to set this variable to either 1 or 0.
If you get stuck or have any mroe questions, feel free to come back and ask here.
Kjata |
|
|
|
Cronyx Beginner
Joined: 19 Jan 2002 Posts: 12 Location: USA
|
Posted: Wed Jan 23, 2002 8:58 pm |
Thanks for all the help with the code guys, it's really appriciated. Just have a few more questions... For the triggers, do I need to stick that in any particular class for it and the button to work together? I'm not entirely familiar with the menus and such, would it be easier for me to imput all of this over the command line? It would be great if it was in a format where I could just copy/paste all the code over the command line that way, like Charbal's code was, as I'm not really sure what fields to write all this code into. I'm learning.. slowly heh, just as I figure out what all the syntax is, but it's a slow process. Other than some very minor mirc scripting and some tcltk for my eggdrop bot, this is the only code I've ever worked with.
Thanks again for all the help and patience!
"There is a very fine line between genius and insanity. I have erased this line." -- Oscar Levant |
|
|
|
undergod Wanderer
Joined: 27 Jun 2001 Posts: 82
|
Posted: Wed Jan 23, 2002 9:22 pm |
All the lines that start with "#" are input directly into the command line. So you can just copy and paste it right into there you type everything else. One of the beauties of ZMud imho.
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Wed Jan 23, 2002 11:21 pm |
The syntax for the #TRIGGER command is:
#TRIGGER {pattern} {commands} classname options
where classname and options are optional. If you look at the triggers that were posted, one of them has neither classname nor options. The other has options and it also has classname but it is set to "". This means that the trigger will be created in the current class. In this case, the current class is the root class because we have not changed it by using the #CLASS command. The root class is the class that contains all your other classes and settings. Think of it as My Computer. The trigger that doesn't have neihter classname nor options is also created in the root class because that is the default if you do not specify classname.
So, if you want to create a trigger inside a specific class, just put the name of the class after commands. If the class doesn't already exist, zMUD creates it.
All of this is applies when you create triggers using #TRIGGER in the command line. If you want you can also put the trigger inside some class using the Settings Editor. This method is a lot like moving files between folders on your computer.
First, you click on the Classes button to open the settings editor with a view that allows you to see all the classes you have. Now you click the New button and it creates a new class with no name. Give this class a name. Afterwards, close the Settings Editor and now click on the Triggers button. Again, the Settings Editor is opened but now with a viw so you can see triggers. zMUD always displays classes, no matter which of the buttons in the toolbar you press, so that is no problem. Now, you just look for the trigger you want to put in the new class and drag & drop it inside the class you just created. Just as if you were moving a file from one folder to the another.
Kjata |
|
|
|
Cronyx Beginner
Joined: 19 Jan 2002 Posts: 12 Location: USA
|
Posted: Thu Jan 24, 2002 2:00 am |
*rubs his forehead* I'm retarted... Okay, I truend phrasing on (of course), and pasted the following into the command line..
#IF (@AFK.state) {;
You are coming back now, so you are not AFK
@AFK.state = 0
@AFK.word = OFF
@AFK.time = 0
} {
;You are leaving, so you are AFK
@AFK.state = 1
@AFK.word = ON
@AFK.time = %secs //this is the predefined variable corresponding to seconds after midnight
}
#trigger {(%w) pages, "(%*)" to you.} {#if (@AFK.state) {
page %1 "= I am AFK or otherwise busy elsewhere. Send me a page with the message of WALRUS (case sensitive) to get my attention"} {#noop I'm assuming that since you are not AFK, you'll handle these as they appear}}
#trigger {%w pages, "WALRUS" to you.} {#PLAY "D:cronyxwavHalf-Lifecustomactivitydet.wav"} "" {case}
It didn't give me any errors... but I dont seem to have a button either, nor have I noticed really any effects for ill or good. I have a feeling I'm supposed to be doing something else, or I pasted something in the wrong place. I went to make a new button, but I'm not sure what kind to make. I'm assuming toggle, so that I can turn AFK on and off. Can you tell me like step by step what to do (including /exactly/ what to click on, and where to paste what) for this code? After I know how to do that, I can figure out /why/ it works, and apply that to stuff I do later, I seem to learn best that way.
PS: I want the button to say AFK: On (and) AFK: Off (toggle button)
PSPS: Can I have this button show up only for a hand full of my characters, and not the others? I dont know if this is true, but I think I may have made it easier to do that by how I organize my accounts.. In the connect window, I make folders based on the name of the mud/muck/mush/mu**/, and then inside those folders, I put all the logins for that spesific mud. Could I set these things, like triggers and buttons and other things I have made, to be spesific to those folders? Like have this AFK button show up on every account in a given folder, but not on accounts in other folders.
Thanks for putting up with me :P
"There is a very fine line between genius and insanity. I have erased this line." -- Oscar Levant |
|
|
|
Cronyx Beginner
Joined: 19 Jan 2002 Posts: 12 Location: USA
|
Posted: Fri Jan 25, 2002 9:37 pm |
<bumps back up to the top>
"There is a very fine line between genius and insanity. I have erased this line." -- Oscar Levant |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Jan 26, 2002 8:43 am |
I didn't do the button because I'm not familiar with the #BUTTON command syntax (and I figured you could create it on your own as desired).
Also, there's a couple ways you could have done it (ie, the one I modeled my triggers after was a simple push button where the caption would toggle between AFK ON and AFK OFF). You could've used a toggle-style button as well.
Just to walk you through it the long way, though, try this (this creates the simple push button):
1)open up the Settings Window (there should be a button named Settings on the main character window.
2)in the settings window, locate and navigate to the folder you want the button to appear in.
3)click the New button and select Button from the list of choices.
4)the button should get created and the relavent properties shown in the settings editor. Where it says "Caption", put AFK: @AFK.word.
5)click on the Position tab (if I got the name wrong, it's the middle one). Position it as desired using the four dimensions on the left (height, width, top, left).
li'l shmoe of Dragon's Gate MUD |
|
|
|
iljhar GURU
Joined: 10 Oct 2000 Posts: 1116 Location: USA
|
Posted: Mon Jan 28, 2002 1:40 am |
K, here's the push button version:
#BUTTON 1 {AFK: @AFK.word} {#IF (@AFK.state) {;You are coming back now, so you are not AFK;#VARIABLE AFK.state 0;#VARIABLE AFK.word OFF;#VARIABLE AFK.time 0} {;You are leaving, so you are AFK;#VARIABLE AFK.state 1;#VARIABLE AFK.word ON;#VARIABLE AFK.time %secs //this is the predefined variable corresponding to seconds after midnight};#VARIABLE afk} {AFK: @AFK.word} {#VARIABLE AFK.state 0;#VARIABLE AFK.word OFF;#VARIABLE AFK.time 0} {} {} {} {} {} {} {} {} {} {} {} {} {} "" {} {} {}
Here's the toggle button version:
#BUTTON 1 {AFK: @AFK.word} {#VARIABLE AFK.state 1;#VARIABLE AFK.word ON;#VARIABLE AFK.time %secs //this is the predefined variable corresponding to seconds after midnight} {AFK: @AFK.word} {#VARIABLE AFK.state 0;#VARIABLE AFK.word OFF;#VARIABLE AFK.time 0} {} {1} {} {} {} {} {} {} {} {} {} {} {} "" {} {} {}
Iljhar |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|