pulling 2 lines of text with #event

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

NobodyImportant
a lesser mummy
a lesser mummy
Posts: 46
Joined: Sun Nov 02, 2003 8:42 pm

pulling 2 lines of text with #event

Post by NobodyImportant » Sat Jul 24, 2004 12:55 am

Is there any possible way to pull 2 lines of txt with an #Event?.. say..

Code: Select all

#Event nofoodanddrink "You are out of food./You are out of Drink."



just some way to pull 2 lines of text that are right above/below each other, with 1 event, or a way to look for the second event after the 1st has been found, but no before, basically 2 events, but it doesnt looks for the second until it finds the 1st.


Any help on this would be appreciated, thanks in advance.[/code]

Sparr
a hill giant
a hill giant
Posts: 159
Joined: Mon Jun 24, 2002 5:41 am

Post by Sparr » Sat Jul 24, 2004 1:52 am

#event outoffood "#*#You are out of food.#*#"
#event outofdrink "#*#You are out of drink.#*#"
--------------------
/declare outoffood int outer
/declare outofdrink int outer
--------------------
/call checkoffsets
--------------------
sub checkevents
/varset outoffood 0
/varset outofdrink 0
/doevents
/if (${outoffood}&&${outofdrink}) {
foo
}
/return
--------------------
sub event_outoffood
/varset outoffood 1
/return
sub event_outofdrink
/varset outofdrink 1
/return

SwiftyMUSE
Developer
Developer
Posts: 1205
Joined: Tue Sep 23, 2003 10:52 pm

Post by SwiftyMUSE » Sat Jul 24, 2004 2:33 am

Could you not use "You are out of #1#", and check for a parameter of "food." or "Drink."?

Sparr
a hill giant
a hill giant
Posts: 159
Joined: Mon Jun 24, 2002 5:41 am

Post by Sparr » Sat Jul 24, 2004 4:03 am

yes you could, but he wants to know when he gets BOTH messages. the only way to do that is to have a variable they can use to 'communicate' with each other

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Sat Jul 24, 2004 6:30 am

Never have to buy food/drink again on a caster who can summon food/drink. Useful.

Though I'd never be worried about both, myself. I'd just make it cast a stack of whichever one I needed and autoinventory it.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

dok
a ghoul
a ghoul
Posts: 127
Joined: Mon Mar 15, 2004 3:38 pm

Post by dok » Sat Jul 24, 2004 12:22 pm

Last i checked, you could assisgn multiple events to the same function.

#event FoodDrink "You are out of food."
#event FoodDrink "You are out of drink."
#event FoodDrink "#*#Summon Food"
#event FoodDrink "#*#Summon Drink"

All the above should call the same Function/Sub (Event_FoodDrink)