This is an example of how you can store an integer for later use using perl.
This script can add one to a global every time you tell it 'store'.
It's an overlooked concept, so i'd thought i'd post it.
Code:
sub EVENT_SAY
{
my $variable = 1;
my $storedvariable = $qglobals{variablesaved} ? $qglobals{variable saved} : 0;
if ($text=~/hail/i)
{
quest::say("Do you wish to [store] the variable + 1 and have me [return] it as two?");
}
if ($text=~/store/i)
{
$variable += 1;
quest::setglobal('storedvariable', $variable, 5, 'F');
quest::say("I have stored the variable plus one as $storedvariable.");
}
if ($text=~/return/i)
{
quest::say("My storedvariable is $storedvariable.");
}
}
Make sure quest globals are toggled on, on the NPC you try this on.