Clutch
2015-04-27 14:27:20
Okay so below I have my main loot function. You'll see at the top I have my right-click strings labeled "LOOT_ITEM_STRINGS =". This works fine…
If you look at the "procedure loot" you'll see it calls on iLoot - this picks up the models so it will right-click them. This also works just fine…
If you look even further below in my "procedure mainLoop" you'll see iLoot again - with a list of the Models. Again, all of these are correct no problems there.. BUT when I try to use anything but 50 different or statements for my reaction it will never detect them. The way it is setup now, it works, and it works well but I would like to shorten that up and make it look more clean.
I've tried everything I could think of so far, length(iLoot) … length(ogl.getModels(iLoot) … adding iLoot as it's own const/var opposed to how I have it as a glModelArray so it'd be iLoot:=(TCardinalArray([1234, 4567, 7890]) etc. etc. I just can't understand why when I try all these other options it won't ever detect the models and call on my loot procedure. Yet the sloppy way I have it below, it works fine. Any insight on this would be appreciated!
Yes, Clarity mentioned in other threads about just grabbing the loot Beam ID's but this has proven more difficult and time consuming then expected even with WriteLn it doesn't always pick up the loot beams and instead shows the coords as x=0 y=0 cuz there's too many items on top of it. Regardless I plan on eventually implementing this but in the meantime would like to have a better understanding on whats going on here with what I currently have.
If you look at the "procedure loot" you'll see it calls on iLoot - this picks up the models so it will right-click them. This also works just fine…
If you look even further below in my "procedure mainLoop" you'll see iLoot again - with a list of the Models. Again, all of these are correct no problems there.. BUT when I try to use anything but 50 different or statements for my reaction it will never detect them. The way it is setup now, it works, and it works well but I would like to shorten that up and make it look more clean.
I've tried everything I could think of so far, length(iLoot) … length(ogl.getModels(iLoot) … adding iLoot as it's own const/var opposed to how I have it as a glModelArray so it'd be iLoot:=(TCardinalArray([1234, 4567, 7890]) etc. etc. I just can't understand why when I try all these other options it won't ever detect the models and call on my loot procedure. Yet the sloppy way I have it below, it works fine. Any insight on this would be appreciated!
program ClutchRorarii;
{$include_once ogLib/lib/core/core.simba}
var
LOOT_ITEM_STRINGS = ['Take Ascension KeyStone', 'Take Ascension Grips', 'Take Sirenic'];
Mob := 3227299924;
iLoot, allModels, funcModelArray: glModelArray;
restore, pouch, Food: glTextureArray;
funcPointArray: tPointArray;
funcPointArrayIndex: uInt32=0;
clientCenter: TPoint;
canThreshold, canRotateCamera, canEscape, canSummon, canRestore, canLoot, canEat, canTerminate, canOvl, canFight: countDown = [0];
procedure doNothing;
begin
if actionBar.getLifePoints() > 90 then {this is just here to be here}
actionBar.setQuickPrayer(False)
else if actionBar.getLifePoints() < 90 then
actionBar.setQuickPrayer(True)
else if actionBar.setRegenerate(False) then
actionBar.setRegenerate(True);
end;
procedure Loot;
var
clickPoint: TPoint;
begin
if inventory.isFull() then {eats food if inventory is full}
inventory.clickItem(112710)
else
begin {detects my models for loot and picks them up}
clickPoint := clientCenter.closest(iLoot)[0].randomizePointEllipse(15);
mouse.rightClickOption(clickPoint, LOOT_ITEM_STRINGS);
canLoot.setTime(random(1000, 2000));
canFight.setTime(random(2000, 5000));
end;
end;
Procedure mainLoop;
var
Reaction : Procedure() =@doNothing;
begin
food := ogl.getTextures([72420, 112710]);
pouch := ogl.getTextures(133365);
iLoot := ogl.getModels(TCardinalArray([1327173775, 744893591, 416945094, 2425121800, 3058172354, 1850752908]));
if (actionBar.getLifePoints()< 20) or (food.isEmpty()) then
Reaction:=@Escape
{else if canTerminate.isFinished() then
Reaction:=@Terminate}
else if (actionBar.getSummoningPoints() > 10) and (length(ogl.getTextures(133365))) and (canSummon.isFinished()) then
Reaction:=@Summon
else if length(ogl.getModels(1327173775)) or length(ogl.getModels(744893591)) or length(ogl.getModels(416945094)) or length(ogl.getModels(2425121800)) or length(ogl.getModels(3058172354)) or length(ogl.getModels(1850752908)) then
Reaction:=@Loot
Reaction();
end;
begin
ogl.setup();
ogl.setDebugMode('models');
writeLN(ogl.GetModels());
Initialize;
repeat
{writeLN(ogl.GetModels());}
mainLoop;
until False;
end. Yes, Clarity mentioned in other threads about just grabbing the loot Beam ID's but this has proven more difficult and time consuming then expected even with WriteLn it doesn't always pick up the loot beams and instead shows the coords as x=0 y=0 cuz there's too many items on top of it. Regardless I plan on eventually implementing this but in the meantime would like to have a better understanding on whats going on here with what I currently have.