Results 1 to 3 of 3

Thread: Help with Pray Potion checker

  1. #1
    Join Date
    Apr 2015
    Location
    Falador
    Posts
    41
    Mentioned
    2 Post(s)
    Quoted
    18 Post(s)

    Cool Help with Pray Potion checker

    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.

    Simba Code:
    Function CheckPrayPotion:Boolean;
     Var
     Three,Two,One,X,Y:Integer;
       Begin
        Case Lowercase(CheckPrayPotions) of
        'on' :
       Begin
        Wait(100);
         One:=DTMFromString('mGQAAAHicY2RgYGBhY2BoZWRg0NvWwQACjCACABqeAf8=');
          Two:=DTMFromString('mGQAAAHicY2RgYGhjZWBoZWRgiL2yggEEGEEEACpfAu0=');
           Three:=DTMFromString('mGQAAAHicY2RgYGhjZWBYycjA4HRpIQMIMIIIACr/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;
    Last edited by The Legendary; 04-13-2015 at 07:54 AM.

  2. #2
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    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:
    Simba Code:
    { . . . }
    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
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

  3. #3
    Join Date
    Apr 2015
    Location
    Falador
    Posts
    41
    Mentioned
    2 Post(s)
    Quoted
    18 Post(s)

    Default

    This problem have me over thinking about it.
    Such a simple fix^_^
    Thanks a lot.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •