bug in IRC20021024

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

MacroSloth
decaying skeleton
decaying skeleton
Posts: 3
Joined: Thu Oct 31, 2002 4:18 pm

bug in IRC20021024

Post by MacroSloth » Thu Oct 31, 2002 8:50 pm

Hi,

Think I found a bug in IRC20021024. I encourage you to read the whole message even after you see some perl snippets, I believe this bug to lie in the MQ code, not the Perl module.

Consider the following code (please note that the code style button doesn't work in this browser):

test.mac:
---------
#event tell

sub Event_chat
/if $p0~~"tell" {
/perl eval tell()
}
/return

sub Main
:Loop
/doevents
/goto :Loop
/return

-----------

Then in the perl code:

sub tell {
$msg=MQPerl::ParseVars("\$p2");
print "here: $msg";
}


You will see that $p2 is blank... HOWEVER:
1) $p0 and $p1 aren't...
2) if you change test.mac to read as follows it will work:

test.mac:
---------
#event tell

sub Event_chat
/if $p0~~"tell" {
/perl eval tell()
/varset v1 $p2
}
/return

sub Main
:Loop
/doevents
/goto :Loop
/return

-----------


Please note that I have set a dummy variable (v1) to the value of p2. Doing this makes the MQPerl::ParseVars("\$p2") work correctly for some reason.


MacroSloth

Lurker_005
a lesser mummy
a lesser mummy
Posts: 51
Joined: Thu Oct 17, 2002 12:08 pm

Post by Lurker_005 » Thu Oct 31, 2002 9:24 pm

How is setting v1 AFTER the /perl eval doing anything different...

Is that a typo and the varset should be before the /perl eval?


RE: code brackets
just type {code} place code snippet here {/code}
{} instead of [] used to keep from activating the code tag

xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: bug in IRC20021024

Post by xyilla » Sat May 31, 2025 4:30 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: bug in IRC20021024

Post by xyilla » Sat May 31, 2025 5:07 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: bug in IRC20021024

Post by xyilla » Sat May 31, 2025 5:08 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: bug in IRC20021024

Post by xyilla » Sat May 31, 2025 5:09 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: bug in IRC20021024

Post by xyilla » Sat May 31, 2025 5:45 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: bug in IRC20021024

Post by xyilla » Sat May 31, 2025 5:46 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: bug in IRC20021024

Post by xyilla » Sat May 31, 2025 5:48 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: bug in IRC20021024

Post by xyilla » Sat May 31, 2025 5:49 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: bug in IRC20021024

Post by xyilla » Sat May 31, 2025 5:50 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: bug in IRC20021024

Post by xyilla » Sat May 31, 2025 5:51 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: bug in IRC20021024

Post by xyilla » Sat May 31, 2025 5:52 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: bug in IRC20021024

Post by xyilla » Sat May 31, 2025 5:53 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: bug in IRC20021024

Post by xyilla » Sat May 31, 2025 5:54 pm