How do I access a world variable from a plugin?

Posted by Nick Gammon on Sun 18 Jan 2009 05:58 AM — 3 posts, 11,163 views.

Australia Forum Administrator #0
See: http://www.gammon.com.au/scripts/doc.php?function=GetPluginVariable

Note the part about "If you are writing a plugin and want to find a "global" MUSHclient variable value ...".
Australia Forum Administrator #1
Also see: http://www.gammon.com.au/scripts/doc.php?function=GetWorldID

GetWorldID does not take an argument, it returns the world ID of the current world. Thus GetWorldID("HellMOO") is not meaningful.
Australia Forum Administrator #2
Also also see: http://www.gammon.com.au/scripts/doc.php?function=GetVariable

Quote:

If GetVariable is called from within a plugin, the variables for the current plugin are used, not the "global" MUSHclient variables.


Thus, GetVariable returned nil, because it returned the plugin variable, not the world variable, and you tried to add zero to it (for some reason).