PDA

View Full Version : Help with Pray Potion checker



The Legendary
04-11-2015, 09:31 PM
I use this Pray Potions checker Function so That I can turn it on/off from the setup menu. The only Problem I can't figure it out, is that this function only see pray potion(3) and if there is no more potion(3) then it teleport me out :/. I have check multiple times if all 3 DTM matches Pray Potion(1)(2)(3) in inventory and yes it matches.

I want it to be that Once potion(3), Potion(2), and Potion(1) are all gone then it will teleport;

I know i can put: "if not checkpraypotion then begin teleport; end;" but if i turn the praypotion check off from the setup menu. It will always teleport me so
I don't want that. :D

Function CheckPrayPotion:Boolean;
Var
Three,Two,One,X,Y:Integer;
Begin
Case Lowercase(CheckPrayPotions) of
'on' :
Begin
Wait(100);
One:=DTMFromString('mGQAAAHicY2RgYGBhY2BoZWRg0NvWw QACjCACABqeAf8=');
Two:=DTMFromString('mGQAAAHicY2RgYGhjZWBoZWRgiL2yg gEEGEEEACpfAu0=');
Three:=DTMFromString('mGQAAAHicY2RgYGhjZWBYycjA4HR pIQMIMIIIACr/Au0=');
If Not FindDTM(One,X,Y,563,157,753,416)Or
Not FindDTM(Two,X,Y,563,157,753,416)Or
Not FindDTM(Three,X,Y,563,157,753,416)Then
Begin
Writeln('There is no more Pray Pot in inventory');
Begin
Teleport;
Result:=True;
end
End Else
Writeln('There are still Pray Pot in inventory');
FreeDTM(One);
FreeDTM(Two);
FreeDTM(Three);
End; end; end;

KeepBotting
04-11-2015, 09:41 PM
CheckPrayPotion is using or operators. So if you're out of (3)'s or (2)'s or (1)'s, it's going to execute the remaining code.

Turn it into three if..then statements, like so:

{ . . . }
if not findDtm(three, x, y, 563, 157, 753, 416) then
if not findDtm(two, x, y, 563, 157, 753, 416) then
if not findDtm(one, x, y, 563, 157, 753, 416) then
{ . . . }


That'll check for (3)'s, (2)'s, and (1)'s in order, and continue only if all of them aren't found

The Legendary
04-11-2015, 10:12 PM
This problem have me over thinking about it.
Such a simple fix^_^
Thanks a lot.