Question about Sub Event with ${Sender}

Third party software discussion goes here.
Tristhan
Posts: 293

Question about Sub Event with ${Sender}

Post#1 » Mon May 06, 2013 1:34 pm

Hiya,

i am using UF.

Sub Event_RaidInvite(Line,Sender)

/if (${Raid.Leader.Name.Equal[${Me.CleanName}]}) {
/delay 5
/tell ${Sender} OK
/say ${Sender} OK
/raidinvite ${Sender}
/delay 5
}

/return

I can trigger my Subevent RaidInvite but the ${Sender} wont get an Tell/Raidinvite.
Tho my Chatwindow says: You invite Sendername to join your raid, but the Sender dont get an Raidinvite. If i perform the command /raidinvite Sendername ingame it works perfect.
Same with Tell: You told ,'is not online at the momemt'.

Anyone have any idea how i can solve that/ what i am doing wrong ?

Noren
Posts: 1053

Re: Question about Sub Event with ${Sender}

Post#2 » Mon May 06, 2013 6:15 pm

echo out ${Param0}, 1, and 2 to show you which parameter holds the sender. Once you have the parameters that you need you can then use it for your raidinvite and tell commands.

Linideen1
Posts: 49

Re: Question about Sub Event with ${Sender}

Post#3 » Fri May 10, 2013 4:12 pm

Code: Select all

${Sender.Right[-2].Left[-1]}


That will fix ur problem, You have Extra spaces in the name that MQ adds when it Grab it.
That way of Echo'ing that Param Made it a pita to figure that out when I was trying to figure this out cause its hard to see the extra spaces, So do 1${Param1}1 and then u can see them.

Tristhan
Posts: 293

Re: Question about Sub Event with ${Sender}

Post#4 » Fri May 10, 2013 5:26 pm

Thank you, i will test both advice.

Tristhan
Posts: 293

Re: Question about Sub Event with ${Sender}

Post#5 » Wed Jul 03, 2013 10:08 am

Thank you Noren and Linideen1, the event is working :D


Another question about events:

----
#Event Test "#*#Test #2# #3#"

Sub Event_Test(Line, Sender, Toon1, Toon2)

/if (${Toon1.Equal[${Me.CleanName}]}) {
/echo OK Toon1
}

/if (${Toon2.Equal[${Me.CleanName}]}) {
/echo OK Toon2
}
----

Toon1 is working, but Toon2 doesnt work.
/echo ${Toon2} and ${Me.CleanName} are equal but still my /if (${Toon2.Equal[${Me.CleanName}]}) dont trigger.

Any idea/help ?
Thank you

conradd
Posts: 381

Re: Question about Sub Event with ${Sender}

Post#6 » Wed Jul 03, 2013 4:23 pm

Have you tried Linideen1's tip and try :

Code: Select all

/echo |${Toon2}|

to see if there isn't some not visible characters ?
"Shorties will rule the world !"
[CLR] Conradd <Drachenkinder>

Noren
Posts: 1053

Re: Question about Sub Event with ${Sender}

Post#7 » Wed Jul 03, 2013 8:26 pm

Tristhan wrote:Thank you Noren and Linideen1, the event is working :D


Another question about events:

----
#Event Test "#*#Test #2# #3#"

Sub Event_Test(Line, Sender, Toon1, Toon2)

/if (${Toon1.Equal[${Me.CleanName}]}) {
/echo OK Toon1
}

/if (${Toon2.Equal[${Me.CleanName}]}) {
/echo OK Toon2
}
----

Toon1 is working, but Toon2 doesnt work.
/echo ${Toon2} and ${Me.CleanName} are equal but still my /if (${Toon2.Equal[${Me.CleanName}]}) dont trigger.

Any idea/help ?
Thank you

I think the issue is that you're skipping over #1# and going right to using #2# and #3# for parameters.

When you do that, using an event like:
#Event Test "#*#Test #2# #3#"

you are passing Param0, Param2, and Param3 to your event's Sub Routine, which is expecting 4 parameters.

So, when we get to your event's Sub Routine:
Sub Event_Test(Line, Sender, Toon1, Toon2)

You are passing Param0, Param2, and Param3 in order. Rewritten it would look like this:
Sub Event_Test(Param0, Param2, Param3, Toon2)

Where Toon2 is NULL because there aren't 4 parameters to pass.

My advice: Use #1#. You need only rewrite the event line, not the routine, to something like: #Event Test "#1# #*#Test #2# #3#"

User avatar
Grey
Posts: 1101

Re: Question about Sub Event with ${Sender}

Post#8 » Wed Jul 03, 2013 10:15 pm

Noren wrote:
Tristhan wrote:Thank you Noren and Linideen1, the event is working :D


Another question about events:

----
#Event Test "#*#Test #2# #3#"

Sub Event_Test(Line, Sender, Toon1, Toon2)

/if (${Toon1.Equal[${Me.CleanName}]}) {
/echo OK Toon1
}

/if (${Toon2.Equal[${Me.CleanName}]}) {
/echo OK Toon2
}
----

Toon1 is working, but Toon2 doesnt work.
/echo ${Toon2} and ${Me.CleanName} are equal but still my /if (${Toon2.Equal[${Me.CleanName}]}) dont trigger.

Any idea/help ?
Thank you

I think the issue is that you're skipping over #1# and going right to using #2# and #3# for parameters.

When you do that, using an event like:
#Event Test "#*#Test #2# #3#"

you are passing Param0, Param2, and Param3 to your event's Sub Routine, which is expecting 4 parameters.

So, when we get to your event's Sub Routine:
Sub Event_Test(Line, Sender, Toon1, Toon2)

You are passing Param0, Param2, and Param3 in order. Rewritten it would look like this:
Sub Event_Test(Param0, Param2, Param3, Toon2)

Where Toon2 is NULL because there aren't 4 parameters to pass.

My advice: Use #1#. You need only rewrite the event line, not the routine, to something like: #Event Test "#1# #*#Test #2# #3#"


#EVENT Test "#*#Test #1# #2#"
Since you don't care whats before test and are looking for up to two param after the word test.
edit: I know the mq2 wiki documentation on param's is pretty weak but its still work reading it a couple times and looking at like modbot or on misc public mq2 forums you can find macros I have authored which have great examples of how to do this.

Tristhan
Posts: 293

Re: Question about Sub Event with ${Sender}

Post#9 » Thu Jul 04, 2013 8:26 am

Thank you again, i will test it.
Really helpful and I appreciate the fast reply.

Return to “Third party software”

Who is online

Users browsing this forum: No registered users and 1 guest