Macro info request

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

fwiggles
a hill giant
a hill giant
Posts: 161
Joined: Mon Jun 17, 2002 8:29 pm

Macro info request

Post by fwiggles » Tue Jun 03, 2003 8:50 pm

ok, i have read through the readme and it is very blunt in this case. I am curious of how to use #event chat. i have got the basics down from looking at the clericbot macro and others. i was wondering if anyone would care to take the time and write something up that explains this more indepth. And if possible be able to add it to the readme to help future people who don't get it =P
[color=red]Latest survey shows that 3 out of 4 people make up 75% of the world's population.[/color]

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Tue Jun 03, 2003 11:15 pm

Salutations,
If you understand it kind of, what do you need to know about the rest? is there something specifically you want to know?

fwiggles
a hill giant
a hill giant
Posts: 161
Joined: Mon Jun 17, 2002 8:29 pm

Post by fwiggles » Wed Jun 04, 2003 12:23 am

well ya, for instance the p0 p1 p2, i understood those in general being when you do /macro blah.mac blah blah blah, that it would set the p0 p1 p2 variables from there, but then it seems that they are used in the Sub Event_Chat as p0 being the form of chat p1 being the person who sent it and p2 being the actual message (order could be wrong, just don't feel like reading back over my macro). and also, i don't understand what the hell the ~~ thing is. I saw it in the pizza making macro in the readme. My guess is that it means that it is contained somewhere in the message? like

/if "$p1"~~"der"

and the message is der fer ber lol, would it answer true?
[color=red]Latest survey shows that 3 out of 4 people make up 75% of the world's population.[/color]

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Wed Jun 04, 2003 1:26 am

Salutations,
Every function has it's own $p# variables. sub main has the ones that are passed via the commandline. This means that if you create sub mySubroutine and call it with /call mySubroutine $p0 $p1 $p2 $p3 $p4 $p5 $p6, you will preserve your orignial variables, however if you call it with /call mySubroutine "soandso" "How are you?" then $p0 will be "soandso" and $$p1 will be "How are you?"
As for ~~, you are correct.

fwiggles
a hill giant
a hill giant
Posts: 161
Joined: Mon Jun 17, 2002 8:29 pm

Post by fwiggles » Wed Jun 04, 2003 5:12 pm

ahh i get it now, thanks for the clarification!
[color=red]Latest survey shows that 3 out of 4 people make up 75% of the world's population.[/color]