Results 1 to 7 of 7

Thread: Help me improve my script (Var Zam mage clicker)

  1. #1
    Join Date
    Nov 2015
    Posts
    43
    Mentioned
    1 Post(s)
    Quoted
    21 Post(s)

    Talking Help me improve my script (Var Zam mage clicker)

    Code:
    program ZamMageTrainer;
    {$DEFINE SMART}
    {$I Aerolib/Aerolib.simba}
    //{$i reflection/Reflection.simba}
    
    
    Procedure CountSpellXP
    
    var
      xp: Integer;
    
    
    begin
    
    end
    
    
    Procedure ClickSpell
    
    
       var
        p:TPoint;
    
    
    begin
    
    if  (getCurrentTab = TAB_MAGIC) then
    begin
    
    
    
    
    
      begin
        p := point(669, 255);    //Setting TPOINT to where spell is
        humanMMouse(p,random(10),random(10));
        wait(RandomRange(20,60));
    
    
        if waitUpTextMulti(['ast', 'Cu'],100) then //Waits and checks for uptext for 100ms!
        begin
          writeln('found spell!');
          wait(randomRange(10,50));
          fastClick(Mouse_left);
        end
    
    
        else
        begin
          writeln('Cannot find UpText!');
        end
    
    
    end
    
    end
    else
    begin
    FTab(TAB_MAGIC);
    WriteLn('Changing to magic tab')
    end
    end
    
    
    Procedure ClickEnemy
    var
      color_Item : TColEx;
      TPA : TPointArray;
      ATPA : T2DPointArray;
      pnt : TPoint;
      i : Integer;
    
    begin
      color_Item.create(2567281, 12, 0.04, 0.14);  //replace color, tolerance, hue and sat with respective values (from ACA)
      if color_Item.findAllIn(Area_MS, TPA) then
      begin //should be a begin here
         ATPA := ClusterTPAEx(TPA, 10, 10); //split these into 5x5 boxes, change these parameters as you like
         SortATPASize(ATPA, true); //sort big first, these are the ones who we will search first
         //DebugATPABounds(ATPA);  //SHOWS DEBUG SCREEN
    
         for i := 0 to high(ATPA) do
         begin
          pnt := MiddleTPA(ATPA[i]);  //set our pnt to the middle of the ATPA
          HumanMMouse(pnt, random(5), random(5)); //move the mouse to our point
          if isUpTextMulti(['Cas', 'onk', 'of', 'Zam']) then //if the uptext is what we want it to be
          begin
            Wait(RandomRange(20, 200));
            fastClick(Mouse_left);
            //FastClick(Mouse_right);
            //Wait(RandomRange(20, 200));
            //ChooseOptionMulti(['Cast', 'We','aken']);
            break; //("break" out of the for..to..do loop, we found our point)
          end;
        end;
      end
      else
      begin
        writeln('Could not find ZamMage!');
      end
    
    
    
    end
    
    
    
    procedure AntiBan;  // ANTIBAN taken from FoolPottatoMashAL foolmonstermashalpha
    begin
      writeln('Performing antiban');
      case random(400) of
    
        //0..10: examineInv();
        11..20: boredHuman();
        21..30: pickUpMouse();
        31..40: HoverSkill('magic', False);
        41..50: randomRClick();
        51..60: SleepAndMoveMouse(random(1000));
        61..70: randomFKeys(true);
        71..80: randomTab(true);
        81..90: checkMovingObjs(true);
        91..100: MMouseOffClient('random');
        101..110: MMouseOffClient('top');
        111..120: MMouseOffClient('bottom');
        121..130: MMouseOffClient('left');
        131..140: MMouseOffClient('right');
        141..150:RandomMovement;
        151..160:RandomTab(true);
        161..170:RandomRClick;
        171..180:compassMovement(20,60,False);
      end;
    end;
    
    
    begin
      initAL;
    
    
    
      repeat
        dismissedRandoms;
        ClickSpell;
        ClickEnemy;
        if (random(100) >=90) then AntiBan;
        wait(800+RandomRange(200,600));
    
      until(false)
    
    
    end.

    Please help me improve my script! I have a few questions:

    -Is there a way to do an if statement with a not in it? Like:
    Code:
    if  (getCurrentTab !(not)= TAB_MAGIC) then...
    -What other error checking could I add / how would I do this? - If I run out of runes it keeps clicking even though no spell is cast, learning how to tell if a spell was cast would also let me help finish the XP earned proggy

    -How would I go about dealing with randoms? Currently if a random appears nothing happens.


    Thank you all for any help!
    Last edited by Tog; 12-23-2016 at 10:26 AM.

  2. #2
    Join Date
    Feb 2013
    Posts
    342
    Mentioned
    8 Post(s)
    Quoted
    110 Post(s)

    Default

    Quote Originally Posted by Tog View Post

    -Is there a way to do an if statement with a not in it? Like:
    Code:
    if  (getCurrentTab !(not)= TAB_MAGIC) then...
    The not goes after the if,
    Code:
    if not getCurrentTab = TAB_MAGIC then
    FTab(TAB_MAGIC);
    WriteLn('Changing to magic tab')
    Hope this helps

  3. #3
    Join Date
    Jun 2007
    Posts
    106
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    Alternatively you could use
    Code:
    if getCurrentTab <> TAB_MAGIC then
    which looks a bit nicer.

    You might want to look into Pixelshift for checking your characters' movements.

    There are also a ton of antiban/random features in AL just search through the function list for such.

    I'm sure you can check whether or not you have the runes to cast, or if the spell is activated with color finding.

  4. #4
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Format script, remove unused procedures, might want to add some conditions to your execution block. You can check the quantity of runes in inv for a fail-safe, or check if you haven't received xp over a period of time

    could also shorten some things
    Simba Code:
    pnt := MiddleTPA(ATPA[i]);  //set our pnt to the middle of the ATPA
    HumanMMouse(pnt, random(5), random(5)); //move the mouse to our point

    // same thing but shorter

    HumanMMouse(MiddleTPA(ATPA[i]), random(5), random(5));

  5. #5
    Join Date
    Nov 2015
    Posts
    43
    Mentioned
    1 Post(s)
    Quoted
    21 Post(s)

    Default

    Quote Originally Posted by anoobis View Post
    Alternatively you could use
    Code:
    if getCurrentTab <> TAB_MAGIC then
    which looks a bit nicer.

    You might want to look into Pixelshift for checking your characters' movements.

    There are also a ton of antiban/random features in AL just search through the function list for such.

    I'm sure you can check whether or not you have the runes to cast, or if the spell is activated with color finding.

    Thank you for the link! I shall have a look
    -Is there some sort of documentation for aerolib? With each function and what it does? Where would be the best place to search through the functions to figure out which ones are available/ learn what they do?


    Thank you very much!




    _________________________


    Quote Originally Posted by jstemper View Post
    Format script, remove unused procedures, might want to add some conditions to your execution block. You can check the quantity of runes in inv for a fail-safe, or check if you haven't received xp over a period of time
    I think that checking XP would be a better option, as if the character gets stuck not casting spells (ie, someone else has hijacked the wiz) How do we check xp?

    Thank you

  6. #6
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    Quote Originally Posted by Tog View Post
    Thank you for the link! I shall have a look
    -Is there some sort of documentation for aerolib? With each function and what it does? Where would be the best place to search through the functions to figure out which ones are available/ learn what they do?


    Thank you very much!




    _________________________




    I think that checking XP would be a better option, as if the character gets stuck not casting spells (ie, someone else has hijacked the wiz) How do we check xp?

    Thank you
    I would check pixelshift instead of XP personally as xp requires you to change tabs which can seem bot like. It might be ok as a failsafe though.

  7. #7
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by Dan the man View Post
    I would check pixelshift instead of XP personally as xp requires you to change tabs which can seem bot like. It might be ok as a failsafe though.
    I was leaning more towards checking the big xp bar at the top of the screen, not so much the skills tab xps

Thread Information

Users Browsing this Thread

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

Posting Permissions

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