SRL Archive - RS3 Combat/Fighting

[SRL-6] Basic Fighter


bonsai

2014-12-14 17:34:29

Basic Combat Script
Melee/Range/Magic


This is a simple combat script that allows the user to enter CTS2 colors from ACA to fight NPCs.


Requirements:

[INDENT]You need a functional setup with current software (Simba 1.x, SMART 8.X, SRL-6)

You need to use the player manager to add your character to a players file. The player manager is on the simba menu under srl->player manager.
[/INDENT]

Installing:

[INDENT]Download the script at the bottom of this post.
The script will create color files wherever it is, put it in its own folder if you like.[/indent]

EOC Abilities:

[INDENT]The player form has a field manualAbilities. My current recommendation is to set this to False and use the Runescape combat mode "revolution". This will automatically use your abilities without the script needing to do anything.

If you set manualAbilities to True the script will use abilities on your visible ability bar. It uses the first 9 slots from RIGHT to LEFT. If you place basic skills on the left, threshold in the middle, and ultimate on the right, it will use the ultimate and threshold when they are ready.[/INDENT]

In-game setup:

[INDENT]Make sure your interface settings have Always show target information checked.

Locate your character in the room you will be fighting in with a weapon in hand. You should be zoomed all the way out (smallest view of yourself).

If you want food support, have the food in your inventory. Set the food to one of the open taskbar slots. When you run the script, make sure the food key is set to the key to activate this slot.[/indent]

Known bugs / issues:

[INDENT]
  • Has some issues with trying to kill the same NPC it just killed.
  • Quality is highly dependant on the color selection.
  • New script with very little testing
[/INDENT]

Improvements to be made:

[INDENT]
  • May need to add split size, min, max filter to data file, using one set of values for all NPCs is not ideal.
[/INDENT]


Progress reported:

[INDENT]
[/INDENT]

Installer:

[ATTACH]24815[/ATTACH]

KeepBotting

2014-12-14 17:37:07

Gratz on the release!

A question though: bonsaiFighter. what's the difference between that and this?

bonsai

2014-12-14 17:47:21

From: KeepBotting
Gratz on the release!

A question though: bonsaiFighter. what's the difference between that and this?


The primary difference is that this one is using CTS2 colors and bonsaiFighter uses CTS0 colors that it chooses itself.

Instead of adding into the existing one, I wrote this up as a new script. Mostly for people who are trying to figure out how to do fighters.

bonsaiFighter uses a lot of includes that make it hard for someone to find what they want.

I get questions from poor people who are trying to sift through thousands of lines of code to find the "meat".

The Mayor

2014-12-14 17:58:20

Very neat little script you have there!

Ross

2014-12-14 18:02:12

From: bonsai

[INDENT]Stole Ross's progress report but don't tell him[/indent]


Reported Bonsai!

e: the padding on the bottom of the proggy is off when it prints :p

Nottabot

2014-12-15 15:48:34

Which would you recommend to the first time simba user? your basic fighter or bonsai fighter?

3Garrett3

2014-12-15 16:04:29

From: Nottabot
Which would you recommend to the first time simba user? your basic fighter or bonsai fighter?


The bonsai fighter is probably easier to use because this script requires getting your own colours (although that itself is pretty easy). The bonsai fighter automatically determines colours for you or can simply fight everything that moves.

jayman19981

2014-12-15 19:49:27

Congrats on the release love bonsaiFighter

Obquility

2014-12-16 17:56:11

Nice script, I use this over bonsai fighter when trying to attack a certain type of monster, that is in the same area. Sometimes it attacks another same monster when it is still fighting another. You should implement the features of BonsaiFighter that it detects when it is dead in different ways. Overall, amazing script though- although it looks like a bot, a bit of an antiban would be good if it could be implemented.
~Josh

EDIT: Sorry, this script doesn't compile now, think it might be my plugins though

icebeamer

2014-12-18 10:04:46

Hi, just want to ask why the NewNPC Procedure does not show up when I start the script? It always ends up like this after it passes the Player form:

Compiled successfully in 2246 ms.
=========== Basic Fighter ============
Fighting False
Kills: 0
Kills/Hr: 0
XP: 0
XP/Hr: 0
Time running: 26s
==============================================
Successfully executed.

Help would be much appreciated! :D

bonsai

2014-12-18 10:10:01

Looks like i need to update for the forms changes.

5 hours or so I'll post an update

icebeamer

2014-12-18 10:13:36

I think it has something to do with updating the Plugins :(

icebeamer

2014-12-18 10:18:35

From: bonsai
Looks like i need to update for the forms changes.

5 hours or so I'll post an update


Yay! Thanks bonsai! :D

bonsai

2014-12-18 15:42:08

From: icebeamer
Yay! Thanks bonsai! :D


Update posted. Grab the script from the OP again.

bonsai

2014-12-18 15:52:35

From: jonesy259
Nice script, I use this over bonsai fighter when trying to attack a certain type of monster, that is in the same area. Sometimes it attacks another same monster when it is still fighting another. You should implement the features of BonsaiFighter that it detects when it is dead in different ways. Overall, amazing script though- although it looks like a bot, a bit of an antiban would be good if it could be implemented.
~Josh

EDIT: Sorry, this script doesn't compile now, think it might be my plugins though


Re: attacking the same npc, both scripts are having some issues with this currently. Jag upgraded combat and made it faster. Sometimes so fast it's hard for the script to be sure of what's up.

I could make it attack far from the npc first but that's kind of crappy too.

This script is a pretty close duplicate of bonsai fighter but using CTS2. I actually removed the great majority of those other detections after the update. So, yeah, the flashing lights are missing but it's doing the same work. In 450 lines of code instead of thousands :)

Re: antiban, I agree it doesn't try to hide itself and it's prone to people reporting you. I don't care to worry about the normal antiban stuff because time has proven that we're not getting banned for moving the mouse around like a monkey or killing things faster than people can. Seems like pure combat XP is fairly unwatched for now.

I do think this needs to let you configure the split size and min/max pixels. How you pick them is a pain but they are important to be able to handle so many different cases. I keep seeing it moving over the background on me due to color bleed.

icebeamer

2014-12-18 21:10:37

From: bonsai
Update posted. Grab the script from the OP again.


Works perfectly! 3-thumbs up to Bonsai for this great program!

bonsai

2014-12-20 03:26:13

Anyone having form problems grab the download again from the OP.

the bank

2015-01-15 17:47:56

From: icebeamer
Hi, just want to ask why the NewNPC Procedure does not show up when I start the script? It always ends up like this after it passes the Player form:

Compiled successfully in 2246 ms.
=========== Basic Fighter ============
Fighting False
Kills: 0
Kills/Hr: 0
XP: 0
XP/Hr: 0
Time running: 26s
==============================================
Successfully executed.

Help would be much appreciated! :D

Having this problem again now!

EDIT: Commenting out the condition check and just invoking the newNpc() function then uncommenting and loading from the save data is a simple work around.

bonsai

2015-01-16 01:17:52

From: the bank
Having this problem again now!

EDIT: Commenting out the condition check and just invoking the newNpc() function then uncommenting and loading from the save data is a simple work around.


Did you grab the updated version? That issue should be long gone.

If your script and SRL are current, check inside the color files and see if you ended up with the name "True" in them.

the bank

2015-01-16 10:25:13

From: bonsai
Did you grab the updated version? That issue should be long gone.

If your script and SRL are current, check inside the color files and see if you ended up with the name "True" in them.


Yeah buddy I got the latest version only just downloaded it yesterday!

Also, no "True" color file :/ the color file appears to be completely correct. Hold on ill debug this real quick.

Alright so it appears that npcName is holding the value "Right", which is of course for Right-Click selection.

Here is the code I have for varaiable assignment:
  foodKey  := playerForm.players[0].settings[0];
sgsKey := playerForm.players[0].settings[1];
mouseStr := playerForm.players[0].settings[2];
npcName := playerForm.players[0].settings[3];
manualAbilities := StrToBoolDef(playerForm.players[0].settings[4], false);

Next, if I output these values to the debug window:
foodKey: =
sgsKey: -
mouseStr: False
npcName: Right
manualAbilities: Flesh Crawler

So clearly these values are not being assigned correctly hehehe. Maybe somehow I grabbed the old version even though I only downloaded yesterday? But either way, these assignments fix it of course (leaving all this here for anyone else who may have the same problem):
  foodKey  := playerForm.players[0].settings[0];
sgsKey := playerForm.players[0].settings[1];
mouseStr := playerForm.players[0].settings[3];
npcName := playerForm.players[0].settings[4];
manualAbilities := StrToBoolDef(playerForm.players[0].settings[2], false);

bonsai

2015-01-16 11:37:47

From: the bank
Yeah buddy I got the latest version only just downloaded it yesterday!


I think I got the attachment sorted out so the proper version is there now.

Thanks!

Ross

2015-02-13 18:41:42

// stole this from ross, hehehe       

Trying to tune this to my needs and as I'm scrolling through I find this :P

<3


edit: to show you what I changed

line 338
if mouseStyle = MOUSE_LEFT then
begin
fastClick(MOUSE_LEFT);
exit(didClick(true));
end;

//changed to

if mouseStyle = MOUSE_LEFT then
begin
exit(didClick(true));
end;
did this so it didn't double click.



and line 436:

while loginCheck() do
begin
if attack() then
begin
inc(kills);
failures := 0
if (kills mod 15) = 0 then progressReport();
writeln('Killed one');
end
else
inc(failures);

writeln('Failed to attack NPC');
if failures > 50 then
begin
writeln('***** Sorry, failed to find NPC 50 times, giving up');
terminateScript();
end;

// changed to

while loginCheck() do
begin
if attack() then
begin
inc(kills);
failures := 0
if (kills mod 15) = 0 then progressReport();
writeln('Killed one');
end
else
begin
inc(failures);
wait(1000);
end;

writeln('Failed to attack NPC');
if failures > 60 then
begin
writeln('***** Sorry, failed to find NPC 50 times, giving up');
terminateScript();
end;
so that it waits for about a minute if no npcs are around. before it just insta-terminated.

BenJerrySon

2015-02-13 19:37:07

[srl] ///////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////// Bonsai ////////////////////////////////////////
//////////////////////////////////////// Fighter ////////////////////////////////////////
//////////////////////////////////////// _______ ////////////////////////////////////////
////////// //////////
////////// Script runtime: //////////
////////// 6 hr 13 min 39 sec(Total) 5 hr 54 min 39 sec(Active) 19 min 0 sec(Break) //////////
////////// //////////
//////////////////////////////////////// Kills ////////////////////////////////////////
////////// Total Per Hour /Hour Active //////////
////////// deadly-red-spid 1,655 265.75 279.99 //////////
////////// XP 1,655 265.75 279.99 //////////
////////// Const XP 551.67 88.58 93.33 //////////
////////// //////////
////////////////////////////////////////////////////////////////////////////////////////////////////

[/srl]

Proggy for you

bonsai

2015-02-27 04:36:21

From: Ross
edit: to show you what I changed


I fixed the clicker and added a timer and constant at the top for quitting if you can't find anything.

Want to try it out? If ok I will add to OP.

[ATTACH]25138[/ATTACH]

General_Patrick

2015-03-13 19:07:40

Hey Bonsai

I am really enjoying your script and playing with it, but i was wondering if I could implement a looter. I wanted to do this to pick up the goodies that the monsters drop. I would love it if you could show me how to do it or direct me to someone who knows how to make a looter.

KeepBotting

2015-03-13 19:15:45

From: alkorith
Hey Bonsai

I am really enjoying your script and playing with it, but i was wondering if I could implement a looter. I wanted to do this to pick up the goodies that the monsters drop. I would love it if you could show me how to do it or direct me to someone who knows how to make a looter.


I posted on your thread.

cBots

2015-03-21 17:23:31

Great release, looking forward to your future projects.

Hitac

2015-03-22 09:14:07

From: cBots
Great release, looking forward to your future projects.


Stop the spam you are becoming irritating

osoad1

2015-03-23 18:59:46

Wow, another combat script by Bonsai, Thanks for this!

sombix71

2015-05-24 03:48:22

Bug report:
  • Attempting to attack an another monster while not being finished with the current one
  • Refuses to do SGS, and very rarely does it trigger Ultimate/Threshold abilities during combat
  • The bot waits 1 or 2 seconds after a Global cooldown before using a manual ability

bonsai

2015-05-25 05:54:28

From: sombix71
Bug report:
  • Attempting to attack an another monster while not being finished with the current one
  • Refuses to do SGS, and very rarely does it trigger Ultimate/Threshold abilities during combat
  • The bot waits 1 or 2 seconds after a Global cooldown before using a manual ability


More info needed on the first one. Is it constantly whacking at everything? Once in a while? One specific NPC it doesn't like?

Line 274 starts detectFight(). That uses a DTM to find the gold lock on the combat popup. Line 430 sets the tolerance on that DTM, currently it is 20. If you are sure the lock is visible on the mainscreen, maybe bump this up. I suspect your popup is not positioned well. It's best in the top left corner.

For SGS, the place to look is 'procedure checkHealth()', line 199. Are you less than 50% HP? If not, it won't try to use it.

Manual ability issues are probably the SRL function underneath, actionBar.getAbilityCooldown(). It has always been quirky.

It activates abilities from RIGHT to LEFT. Did you put your ultimates on the right? Thresholds next, then basics on the left?

Line 379 has a 2 second timer before trying to use an ability (2000 ms). Adjust or eliminate as desired.

sombix71

2015-05-25 06:49:18

From: bonsai
More info needed on the first one. Is it constantly whacking at everything? Once in a while? One specific NPC it doesn't like?

Line 274 starts detectFight(). That uses a DTM to find the gold lock on the combat popup. Line 430 sets the tolerance on that DTM, currently it is 20. If you are sure the lock is visible on the mainscreen, maybe bump this up. I suspect your popup is not positioned well. It's best in the top left corner.

For SGS, the place to look is 'procedure checkHealth()', line 199. Are you less than 50% HP? If not, it won't try to use it.

Manual ability issues are probably the SRL function underneath, actionBar.getAbilityCooldown(). It has always been quirky.

It activates abilities from RIGHT to LEFT. Did you put your ultimates on the right? Thresholds next, then basics on the left?

Line 379 has a 2 second timer before trying to use an ability (2000 ms). Adjust or eliminate as desired.


Thanks for the reply Bonsai.

The first issue happens frequently but not too often and is not specific to an NPC. The bot thinks that it has killed a monster but in fact, it hasn't. So when it assumes it has killed a monster, it will move on to to an another. This can also happen when being aggro'd by a monster and the bot chooses to attack an another one instead.

As for the second one, I tried setting the line to 'if ((actionbar.getHPPercent() < 99)' and it still didn't work. I just fixed it by putting the special attack ability on the Food key (=).
Threshold/Ultimate issues are fixed now for some weird reasons

And lastly, you're right about the third one.