Results 1 to 6 of 6

Thread: Semi-advanced Eldevin Combat Bot

  1. #1
    Join Date
    Jan 2016
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Red face Semi-advanced Eldevin Combat Bot

    Hello viewers, I wanted to state that this work wasn't completely mine! I borrowed a script from BUGBUSTER, and made it fit to my needs.
    First I started changing the cords to fit to my screen, and changing the keys to fit to my game style. Then I starting think, and scripting ways to improve the bot. To ensure I live, or to notify me if something happens while my bot is running. Simple stuff like that, I'll let you guys see the differences.

    Here's my first script released to the public!:

    Code:
    program EldevinCombat30;
    
    (*  Pascal programming language
        ___________________________
    
        Name: Eldevin Combat 3.0
        Date: 02/01/2016
        Next: V3.1 on/before 02/05/2016
    
        Created by: Kevin
        Base Credits: EldevinFighterReloaded
    *)
    
    (* Calls *)
    {$I SRL-OSR/SRL.simba}
    //{$I SRL-OSR/SRL/misc/al_functions.simba}
    
    (* Procedures *)
    procedure JAM_InteractKeys(Action: string; SleepTime: Integer);
    begin
      TypeSendEx(Action, False);
      Sleep(Sleeptime + random(150));
    end;
    
    procedure JAM_InteractNPC(Action: string);
    begin
      TypeSendEx('\', False);
      Sleep(250 + Random(25));
      TypeSendEx(Action, False);
      Sleep(250 + Random(50));
    end;
    
    (* Functions *)
    
    (* JAM Traits *)
    function JAM_HighHP: Boolean; //Checks if health is full.
    begin
      result := (GetColor(371, 924) = 857797 );
    end;
    
    function JAM_MidHP: Boolean; //Checks if health is below fifty percent.
    begin
      result := (GetColor(400, 920) = 1776412 );
    end;
    
    function JAM_LowHP: Boolean; //Checks if health is below twenty-five percent.
    begin
      result := (GetColor(440, 920) = 1776412 );
    end;
    
    function JAM_Dead: Boolean; //Checks if health is empty.
    begin
      result := (GetColor(471, 916) = 1908513 );
    end;
    
    function JAM_Mana: Boolean; //Checks if mana is low.
    begin
      result := (GetColor(500, 920) = 1776412 );
    end;
    
    function JAM_LogBackIn: Boolean; //Checks if player needs to log back in.
    begin
      result := (GetColor(110, 180) = 1710361 );
    end;
    
    (* NPC Traits *)
    function NPC_HighHP: Boolean; //Checks if NPC health is high.
    begin
      result:= (GetColor(520,180) = 1313692 );
    end;
    
    function NPC_LowHP: Boolean; //Checks if NPC health is low.
    begin
      result := (GetColor(395, 180) = 1710361 );
    end;
    
    (* Main Loop *)
    procedure MainLoop;
    begin
      if JAM_LowHP() then //If players health is low, heal until full.
      begin
        WriteLn('Players health is low, begin healing loop.');
        repeat
          if JAM_Dead() then //If player dies, alerts host.
          begin
            WriteLn('Player has died, alerting host, then terminates script.');
            MoveMouse(115, 30);
            Wait(500);
            ClickMouse(115, 30, mouse_Left);
            Wait(1000);
            MoveMouse(550, 100);
            Wait(500);
            ClickMouse(550, 100, mouse_Left);
            Wait(1000);
            TerminateScript()
          end;
          JAM_InteractKeys('-', 1100);
          JAM_InteractKeys('0', 2300);
          JAM_InteractKeys('5', 1500);
          JAM_InteractKeys('0', 2300);
          JAM_InteractKeys('6', 1300);
        until (JAM_HighHP);
      end;
      if JAM_MidHP() then //If players health is past caution, heal.
      begin
        WriteLn('Health is below caution point, restoring now.');
        JAM_InteractKeys('0', 2500);
        JAM_InteractKeys('5', 1500);
        JAM_InteractKeys('2', 2000);
      end;
      if JAM_LogBackIn() then //If player has logged out, logs back in.
      begin
        WriteLn('Player logged out, logging back in.');
        MoveMouse(670, 670);
        Wait(500);
        ClickMouse(670, 670, mouse_Left);
        Sleep(15000);
      end;
      if JAM_Mana() then //If players mana is low, restore.
      begin
        WriteLn('Players mana is low, restoring.');
        JAM_InteractKeys('`', 1000);
      end;
      if NPC_LowHP() then //After you complete a kill, heal (could drain mana fast).
      begin
        WriteLn('Begin caution healing, may drain mana.');
        JAM_InteractKeys('0', 2500);
      end;
      if NPC_HighHP() then //If NPC health is high, use different ability.
      begin
        WriteLn('NPC health is high, activating secondary attack.');
        Wait(1000);
        JAM_InteractKeys('e', 250);
        JAM_InteractKeys('2', 1500);
      end;
      //After processing, begins combat.
      begin
        WriteLn('Processing Complete, begin combat.');
        Wait(500);
        JAM_InteractNPC('e');
        Wait(500);
        JAM_InteractNPC('1');
      end;
    end;
    
    begin //Repeats the process, if the script is still active.
      MouseSpeed := 25;
      SetDesktopAsClient();
      Sleep((2000 + random(200)));
      ActivateClient();
      repeat
        MainLoop();
        Sleep(500);
      until (false);
    end;
    I am aware that the comments in here make it "messy", but they help newcomers see what's going on. I know there are multiple things I can change, and improve. But I am still working on this, and I plan to improve it even more!

    In the future I do not plan on relying on cords or colors as much, I also plan to let it Email me if I were to die, or logout. So then I could use my Remote Desktop, to reactivate it from wherever I am. This is V3.0.

    Thanks for any feedback, feel free to leech with some credit!(:
    Last edited by Jaspartan; 02-02-2016 at 12:24 AM. Reason: Test Twice Before Post, lol.

  2. #2
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Hello,

    not sure what script doing.
    congrats on good first script.

    starter feedback, try using Wait() instead of Sleep() & integrate RandomRange() to add variability

    cheers,
    lj

  3. #3
    Join Date
    Jan 2016
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Thanks mate, much appreciated though I've been updating it quite a bit more now. This looks nothing like it anymore, haha. Thanks though, .

  4. #4
    Join Date
    Feb 2006
    Location
    Australia
    Posts
    628
    Mentioned
    15 Post(s)
    Quoted
    105 Post(s)

    Default

    Great work on your first script, I see that much of it is static (using co-ords etc.), it shouldn't matter if eldevin doesn't offset these but it's a bad habit to get into.. I'd advise against repeat...until(false); it's better to use a variable so that you can end the main loop according to GetSystemTime, in-game resources or after a certain number of loops.

  5. #5
    Join Date
    Jan 2016
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    I completely agree about using cords, I removed all of them now and converted to simpler methods. I do like using loops, and when I chose to use that specific one. It's purpose is to heal until your health is full once again, but I have it now to where it'll heal you up as needed, while executing the opponent so that way your HP stops draining.

  6. #6
    Join Date
    Dec 2013
    Location
    Pitcairn Island
    Posts
    288
    Mentioned
    20 Post(s)
    Quoted
    166 Post(s)

    Default

    It would be quite fun to write a basic include for this game.

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
  •