Results 1 to 3 of 3

Thread: Help With Letting Script Know It's Time To Bank And Summon Another Familiar

  1. #1
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    180
    Mentioned
    14 Post(s)
    Quoted
    101 Post(s)

    Question Help With Letting Script Know It's Time To Bank And Summon Another Familiar

    So I'm trying to write a script where after a certain time it will need to go back to bank, end the procedure its doing and withdraw a pouch, summon it, then begin doing other procedures.

    Is their an easy way to do this?
    I was thinking like just putting a wait command but, way too many things can go wrong with that.

    Any help is appreciated!

  2. #2
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Simba Code:
    var
      summonTimer: TTimeMarker;

    procedure checkTimers();
    begin

      if summonTimer.getTime() > 300000 then
      begin
        writeLn('5 minutes have passed, time to bank');
        goToBank();

        // bank stuff + summon familiar

        summonTimer.reset();
        summonTimer.start(); //reset & start the timer
      end;

    end;

    procedure mainLoop();
    begin
      repeat

        //all your stuff

        checkTimers();

      until l33t;
    end;

  3. #3
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    180
    Mentioned
    14 Post(s)
    Quoted
    101 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    Simba Code:
    var
      summonTimer: TTimeMarker;

    procedure checkTimers();
    begin

      if summonTimer.getTime() > 300000 then
      begin
        writeLn('5 minutes have passed, time to bank');
        goToBank();

        // bank stuff + summon familiar

        summonTimer.reset();
        summonTimer.start(); //reset & start the timer
      end;

    end;

    procedure mainLoop();
    begin
      repeat

        //all your stuff

        checkTimers();

      until l33t;
    end;
    You're awesome will be trying to implement this, thank you!


    edit: Ok @themayor, so I havent been able to test out the timer as I cant get to 47 minutes yet but it compiles.
    I need help with something else, resetting integer variables. Or how to make it so that the deposit feature works and doesn't withdraw and stuff when I dont want it it
    obviously will be adding picking up of the fruit afterwards but right now just want to get the deposit feature to work without it repeating the whole script again. I was thinking of making a depositCount, and when its below 1 it will withdraw and the required items like potions and scrolls when its above 1 it will just deposit the fruit and continue doing the loop, but when I do depositCount.reset it says unknown. I've declared depositCount a global variable

    here is what I have so far
    PHP Code:
    program ABitPoorFruitFallV01;

    {
    $DEFINE SMART}
    {
    $I SRL-6/SRL.simba}
    {
    $I SPS/lib/SPS-RS3.Simba}


    /////////////////////////////////////////
    // Change who you're banking with here //
    //                                     //
      
    var                                  //
        
    bankerinteger BANK_NPC_BLUE;   //
    //                                     //
    //  BANK_NPC_BLUE                      //
    //  BANK_NPC_GREY                      //
    //  BANK_NPC_GREEN                     //
    //  BANK_NPC_DRAYNOR                   //
    //  BANK_BOOTH                         //
    //  BANK_CHEST_SW                      //
    //  BANK_CHEST_SHANTAY                 //
    //  BANK_CHEST_DUEL                    //
    //  BANK_CHEST_CW                      //
    //  BANK_CHEST_GROTTO                  //
    //  BANK_CHEST_LUMBRIDGE               //
    //  BANK_TABLE_BURTHORPE               //
    //                                     //
    ////////////////////////////////////////

    procedure declarePlayers();
    begin
      setLength
    (players1);
      
    with players[0] do
      
    begin
        loginName 
    := 'username';
        
    password := 'password';
        
    isActive := true;
        
    isMember := true;
      
    end
      currentPlayer 
    := 0;
    end;

    var
      
    BOinteger;
      
    depositCountinteger;
      
    timesUsedFruitFallinteger;
      
    potionTimerTTimeMarker;

    procedure antiBan();   //Straight outta includes (imma noob)
    begin
      
    if not isLoggedIn() then
        begin
          writeLn
    ('Not logged in, exiting');
        
    end;

    begin
      
    case random(100of
        1..25
    begin
                writeLn
    ('Performing AntiBan, Hovering Over Skills');
                
    hoverRandomSkill();
               
    end;

        
    26..46begin
                  writeLn
    ('Performing AntiBan, Bored Human');
                  
    BoredHuman;
                  
    wait(randomRange(2000,4000));
                  
    minimap.setAngle(MM_DIRECTION_NORTH);
                  
    mainScreen.setAngle(MS_ANGLE_HIGH);
                
    end;

        
    47..67begin
                  writeLn
    ('Performing AntiBan, Move Mouse Like A Downy');
                  
    smallRandomMouse();
                
    end;

        
    68..88begin
                  writeLn
    ('Performing AntiBan, I Fell Asleep On The Computer Oh No!');
                  
    sleepAndMoveMouse(2000 random(3000));
                
    end;

        
    89..99begin
                  writeLn
    ('Performing AntiBan, Are We 99 Yet');
                  
    pickUpMouse();
                
    end;
        
    end;
      
    end;
    end;

    procedure doWePerformAntiBan();
    begin
      writeLn
    ('AntiBan or nah?');
      case 
    Random(10of
      1..6
    begin
              writeLn
    ('Nah, no AntiBan');
            
    end;

      
    7..9begin
              writeLn
    ('Yah, Performing AntiBan');
              
    antiBan();
            
    end;
      
    end;
    end;

    procedure openBank();
    begin
      
    if not isLoggedIn() then
        begin
        writeLn
    ('Not logged in, retrying');
        
    players[currentPlayer].login();
        
    exitSquealOfFortune();
        
    minimap.setAngle(MM_DIRECTION_NORTH);
        
    mainScreen.setAngle(MS_ANGLE_HIGH);
        
    end;

      if  
    BACKPACK_SLOT_HIGH 28 then
        
    if  depositCount 1 then
          
    exit;


      if 
    isLoggedIn() then
        
    if depositCount 1 then
        begin
          writeLn
    ('Opening bank screen');
          
    bankScreen.open(banker);
          
    wait(randomRange(500,800));
          
    inc(depositCount) + 1
        end
    ;

          if 
    not (bankScreen.isOpen()) then
            
    exit;
    end;

    procedure withdrawItems();
    begin
      
    if not isLoggedIn() then
        
    exit;

      if 
    not bankScreen.isOpen then
        
    exit;

      if 
    depositCount >= 1 then
        
    exit;

      if 
    bankScreen.isOpen then
        begin
          wait
    (randomRange(700,900));
          
    bankScreen.clickButton(BANK_BUTTON_PRESET_2);
        
    end;
    end;

    procedure depositProcedure();
    begin

      
    if depositCount >= 1 then
        
    exit;

      if 
    not BACKPACK_SLOT_HIGH 28 then
        
    exit

      if 
    BACKPACK_SLOT_HIGH 28 then
        begin
         openBank
    ();
         
    wait(randomRange(600,900));
          if 
    not bankScreen.isOpen then
            
    exit
          if 
    bankScreen.isOpen then
            begin
              openbank
    ();
              
    bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
              
    withdrawItems();
            
    end;
         
    end;
    end;

    var
      
    pouchesSummonedinteger;

    procedure summonPouch();
    begin

      
    if not (bankScreen.close()) then
        
    exit;

      if (
    bankScreen.Close()) then
        begin
          tabBackPack
    .mouseSlot(2MOUSE_LEFT);
          
    doWePerformAntiBan();
          
    inc(pouchesSummoned) + 1;
        
    end;
    end;

    procedure walkOutSideBank();
    var
      
    pathToOutSideBankTPointArray;
    begin
      wait
    (randomRange(700,1000));

      if 
    not isLoggedIn() then
        
    exit;

      
    pathToOutSideBank := [Point(210183), Point(179197)]

      if 
    SPS.walkPath(pathToOutSideBankthen
        minimap
    .waitPlayerMoving()
      else
        
    writeLn('Could not make it outside, too fat');
    end;

    procedure useSummoningPotion();
    begin

      
    if potionTimer.getTime() < 29000  then
        
    exit;

      if 
    potionTimer.getTime() > 29000  then
        begin
          wait
    (randomRange(500,600));
          
    actionBar.clickSlot(1);
        
    end;
    end;

    procedure useFruitFall();
    begin
      repeat
        wait
    (randomRange(1000,1200));
        
    potionTimer.start();
        
    actionBar.mouseIcon(AB_BAR_SUMMONINGMOUSE_LEFT);
        
    inc(timesUsedFruitFall) + 1;
      
    until potionTimer.getTime() > 29000 or BACKPACK_SLOT_HIGH 28

       
    if not potionTimer.getTime() > 29000 then
        begin
          wait
    (randomRange(100,200));
        
    end;

       if 
    potionTimer.getTime() > 29000 then
        begin
          writeLn
    ('Out of special moves drinking pot');
          
    useSummoningPotion();
          
    wait(randomRange(100,250));
          
    potionTimer.reset();
          
    potionTimer.start();
        
    end;

       if 
    BACKPACK_SLOT_HIGH 28 then
        begin
          depositProcedure
    ();
        
    end;
    end;

    var
      
    summonTimerTTimeMarker;

    procedure checkTimers();
    begin

      
    if not summonTimer.getTime() > 2820000 then
        
    exit;

      if 
    summonTimer.getTime() > 2820000 then
      begin
        writeLn
    ('47 minutes have passed, time to re-summon');
        
    openBank();
        
    withdrawItems();
        
    summonPouch();
        
    summonTimer.reset();
        
    summonTimer.start(); //reset & start the timer
      
    end;

    end;
















    // main loop
    begin
      smartPlugins 
    := ['d3d9.dll'];
      
    clearDebug();
      
    smartEnableDrawing := true;
      
    setupSRL();
      
    declarePlayers();
      
    SPS.setup('FRUIT_FALL_EDGE'RUNESCAPE_OTHER);
      
    openBank();
      
    withdrawItems();
      
    summonPouch();
      
    walkOutSideBank();
      
    useSummoningPotion();
      
    useFruitFall();


      if 
    not isLoggedIn() then
      begin
        players
    [currentPlayer].login();
        
    exitSquealOfFortune();
        
    minimap.setAngle(MM_DIRECTION_NORTH);
        
    mainScreen.setAngle(MS_ANGLE_HIGH);
      
    end;
    end
    Last edited by Adieux; 08-08-2014 at 10:36 PM. Reason: need more info

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
  •