View Full Version : Why would findnormalrandom() keep changing gametab to inventory
freezeyp
10-13-2012, 03:36 AM
Recently I start to make a super heating script and counter this problem, and finding that when i try to cast spell, findnormalrandom() will change gametab to inventory and screw up my process.
Try only calling findnormalrandoms when you are already in your inventory
To check for the random gift box. Call FindNonInventoryRandoms instead to make it skip checking that.
Le Jingle
10-13-2012, 03:50 AM
You might want to try,
_FindAllrandoms(false);
or
FindNonInventoryRandoms;
That way you will not check your inventory every time for inventory randoms.
What riwu said above is true, I created this function for me to use instead, basically just checks if you are already in the inventory it does FindNormalRandoms if you aren't then it just checks for non-inventory randoms.. Feel free to use it if you like, it doesn't make life that much easier, I just cbf'ed to write two different randoms searches.
function PRandoms: Boolean;
begin
if GetCurrentTab = Tab_Inv then
Result := FindNormalRandoms else
Result := FindNonInventoryRandoms;
end;
WT-Fakawi
10-13-2012, 07:36 AM
What riwu said above is true, I created this function for me to use instead, basically just checks if you are already in the inventory it does FindNormalRandoms if you aren't then it just checks for non-inventory randoms.. Feel free to use it if you like, it doesn't make life that much easier, I just cbf'ed to write two different randoms searches.
function PRandoms: Boolean;
begin
if GetCurrentTab = Tab_Inv then
Result := FindNormalRandoms else
Result := FindNonInventoryRandoms;
end;
Nice! A looong time ago I wanted to include this in SRL, but someone stopped me, saying: "if people really want this, they will come up with it themselves :)"
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.