| 
	
		|  |  
		| Fluffy Newbie
 
 
 Joined: 06 Jan 2008
 Posts: 8
 Location: Houston, TX
 
 | 
			
			  |  Posted: Sun Jan 06, 2008 8:13 am 
 Trigger Questions - Multi-Lines, and More!
 
 |  
				| Hello Guys and Gals.  Hope you don't mind, but I need to ask a few questions! 
 First off, multi-line triggers.. I've seen the function somewhere.. i am just not sure exactly where!  I did see someone respond to a question kind of like that somewhere down the forums, I will look more into the way he did it shortly ( I am not asking for anyone to code anything, just need to know what functions, or whatever to search for ).
 
 Next thing, and I looked quite a bit for this one.. I know that if I use #CAP windowname, the text will be sent to the window I specify, with color and everything, thats great!  However, I actually want a piece of the text to go to the window, which I know I can do with #WIN name "whatever", etc.  The only probably with the second option, is that its the color of any other #ECHO statement.  I know that I could color each letter whatever I want with the color function, but i was hoping to be able to do something like.. this, but have the items, gold, qp in color.. (this would be in my looting window)
 
 Loot - Sword of somethng Another
 QP   - 3,600
 Gold - 14,387
 Loot - Ranger's Leather bracers
 Loot - Helm of Greatness
 
 The messages to the left (loot, qp, gold, etc) don't need any coloring or anything, but the items have alot of different colors in the names.  I know its not *too* terribly important to color items for most people, but it helps me look at the window really quick to see if anything important dropped in all the spamming.
 
 Any help there would be *greatly* appreciated.
 
 
 Oh yeah, almost missed this next question..  oh ok i got it.. I think (sorry, took me almost 5 or so minutes to remember what I was about to say.. SIGH!!)
 -I have a set of skills, that take awhile to recharge sometimes.. its random on how long it will take.. doesnt matter really because I get a message saying when they recharge. My ponderment is this, Can I have a set of buttons, each one tied to a skill, that when I click them they depress and send the command (activate them yay!), and whenever the mud says they recharge, it toggles the state of the button back up so I know which skills are and arent active?  I know buttons exist.. just have never used them.. just a curious question!! Thanks!
 |  |  
	  |  |  
		|  |  
		| Rahab Wizard
 
 
 Joined: 22 Mar 2007
 Posts: 2320
 
 
 | 
			
			  |  Posted: Tue Jan 08, 2008 3:37 pm 
 |  
				| It would be helpful to ask different questions in different postings.  I can't help with the multi-line triggers, but I'll do my best on the other two. 
 Your second question, about coloring certain words in your capture window, is quite easy.  In the package editor, find your capture window.  Under that window, create a new trigger, with a pattern of "gold", and a value of "#cw gold".  With this trigger,  it will automatically color every appearance of the word "gold" the color gold.  Since it is within the capture window, it will only apply within that window.  You should be ab le to  expand this yourself.
 
 As for your third question about automatically resetting button states, the answer is yes.  I make all my buttons with the package editor.  To do this, you need to make a button of type "toggle".  The Caption is the text in the button, and the script text is the script you want to run when the button gets pushed.  After that gets set up, click on Options at the bottom of the script text.  Under Options, you want to set a Variable.  Put in the name of a variable (which you will have to create afterward), which will be used to control the button.  Don't include the @ in the variable name.  When you are done making the button, make the variable, perhaps in the same class as the button.  When the button gets pushed, the variable will be set to TRUE, and when toggled again will be set to FALSE.  The fun part is that if you change the variable some other way (like a trigger), the button will be toggled too!  So now all you need is a trigger for the recharge statement that changes the variable.
 |  |  
	  |  |  
		|  |  
		| Fang Xianfu GURU
 
  
 Joined: 26 Jan 2004
 Posts: 5155
 Location: United Kingdom
 
 | 
			
			  |  Posted: Tue Jan 08, 2008 6:42 pm 
 |  
				| Multistate triggers are generally much more useful than multi-line triggers. This trigger: 
 #trig {some text} {}
 #cond {some more text} {} {within|param=1}
 
 will match
 
 
 but not
 
 
 or
 
 
 
	
    | some text something else
 some more text
 |  
 It uses the "within lines" trigger option. That is, that the state must appear within a certain number of lines (in this case one) of the first state.
 |  |  
	  |  |  
		|  |  
		|  |  
		|  |  
  
	| 
 
 | 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
 
 |  |