Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Perlscript
➜ trouble with passing of variables
trouble with passing of variables
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Martijn
(20 posts) Bio
|
Date
| Mon 28 May 2007 11:17 PM (UTC) |
Message
| below is a crosspost from Scripts. I'm having some real problems with variables under perl, and was wondering if anyone knows what is going on, or may be able to help me find a workaround. I have switched to Python for scriping, but I'm still a little annoyed that what I though should be working, doesn't.
Quote:
with my limited knowledge of OLE/COM objects I thought activePERL would magicaly poof it and make everything allright. It seems not. Even my targetting system, which was working properly before has gone dodgy now. I have it now as
<aliases>
<alias
script="setTarget"
match="^target (\w+)"
enabled="y"
ignore_case="y"
regexp="y"
name="targetting"
></alias>
</aliases>
<script>
<![CDATA[
sub setTarget{
my ($theName, $theOutput, $wildcards) = @_;
my $target = GetAliasWildcard($theName, "1");
$world->note("setting target to ".$target);
$world->setVariable("target",$target);
my $fetchedTarget = $world.getVariable("target");
$world->note("target is now ".$fetchedTarget);
}
]]>
as it is now, imputting
target bigbadwolf
should output
setting target to bigbadwolf
target is now bigbadwolf
right?
wrong. It gives
setting target to bigbadwolf
target is now Win32::OLE=HASH(0xfaa1b4)bigbadwolf
I'm confused now...
| Top |
|
Posted by
| KP
(24 posts) Bio
|
Date
| Reply #1 on Thu 31 May 2007 09:54 PM (UTC) |
Message
| as usually, its just a small typo:
my $fetchedTarget = $world.getVariable("target");
should be:
my $fetchedTarget = $world->getVariable("target");
cheers,
KP | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
14,556 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top