View Single Post
  #4  
Old 06-02-2011, 12:34 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

Quote:
Originally Posted by revloc02c View Post
That info Akkadius was very helpful, thanks.

I can't get this to work, here's my plugin:
Code:
sub NewbieBot_say {
	my $qglobals = plugin::var('qglobals');
	my $client = plugin::val('$client');
	$client->Message(315, "TEST 1");
	$client->SetGlobal("newbie_charm", 1, 5, "F");
	$client->Message(315, "TEST 2");
	if ($qglobals->{"newbie_charm"}) { 
			$client->Message(315, "It exists!"); 
		}
		else {
			$client->Message(315, "It DOES NOT exists!"); 
		}
	my $test = $qglobals->{"newbie_charm"};
	$client->Message(315, "$test");
	$client->Message(315, "TEST 3");
}

return 1;
And here's the output:
Code:
TEST 1
TEST 2
And that's it. Somehow I am not getting it to interpret $qglobals->{"newbie_charm"}; correctly. I checked the database and it is getting in there correctly from line 5. But as soon as I try to access it, nuthin. Can anyone see the problem?
From the sounds of it, your Perl script has compilation errors, as in it isn't getting past line 7 to parse the $qglobals object.

Did you source the plugins SVN first? Because it has a line commit global.pl that allows the parsing of $qglobals from within plugins.
Reply With Quote