PDA

View Full Version : [Fighting] [AeroLib / Reflection] J Ghoul Killer



jstemper
08-15-2015, 05:48 PM
Ghoul Killer

http://vignette3.wikia.nocookie.net/2007scape/images/e/e3/Ghoul.png/revision/latest?cb=20130512205051

Hi guys, I had some free time and decided to completely re do this seeing as I was a beginner when i wrote it (code was horrendous ngl). Only combat works at the moment, and I have been hung up on perfecting it (the logic is there for the other features). If I could get some feedback on how it works that would be great. What I really want to do in the long run is track which ghoul you are interacting with, so you are able to see it's health bar and such. However I raged and deleted the progress I had made because it kept getting caught up on other ghouls that walked by. As far as the current combat detection system goes, it works somewhat like hoodz fighter, although I did incorporate TEntities into the script, which I have yet to see anyone do, so feedback on that aspect would be great. The script can be used in SMART or on an official client, and infact, I wrote it completely on the official client.

What it does

- Kills the Ghouls at the north spot, west of Canifis
- Eats food in or out of combat (salmon)
- Decent Antiban

Requirements

- AeroLib Include && plugins: https://villavu.com/forum/showthread.php?t=108953
- Latest version of SMART and Simba.

Instructions

- Start script north ghoul spot

Credits

- The Aerolib team

To do

- A lot

Bugs

- ??


v0.2
- Smart Banking (if it has items in inv it will deposit, if not then it won't deposit)
- 100% accurate progress report make sure to put in training skill at top of script
- Some randomness to walkpath


v0.3
- Converted majority of script to reflection
- Pot support added
- Random dismissing added
- Won't try to attack the ghoul that was previously killed anymore
- A very nice randomized walkpath function added (thanks to cosmas jdz)


v2.0
- Converted to 100% color
- Everything rewritten

program ColorGhouler;
{$DEFINE WALKER}
{$i AeroLib/AeroLib.Simba}

const
{---------------------------------------------------------}
{ USER INPUT }
{---------------------------------------------------------}
{} USER = ''; {}
{} PASS = ''; {}
{} PIN = ''; {}
{} {}
{} MOUSE_SPEED: TIntegerArray := {}
{} [19, 23]; {}
{} EAT_BETWEEN: TIntegerArray := {}
{} [19, 76]; {}
{} RUN_BETWEEN: TIntegerArray := {}
{} [15, 60]; {}
{---------------------------------------------------------}

DEBUG = false;
VERSION = '2.0';

BANK : Tbox := IntToBox(5840, 2507, 5867, 2553);
GHOULS : Tbox := IntToBox(5440, 2370, 5515, 2435);

type
_NPC = record
_TColors: array of TColEx;
_UpTexts: TStringArray;
_Options: TStringArray;
_Points: TPointArray;
end;

var
RSW: TRSWalker;
Fails: Integer;
Ghoul: _NPC;
TFood: TItem;

procedure DebugMsg(What: String; terminate: boolean = false);
begin
writeln(MsToTime(getTimeRunning, 3) + ' | ' + What);
if (terminate) then TerminateScript();
end;

procedure Ghoul.Init();
begin
self._TColors := [createCol(3883067, 11, 0.00, 0.17), createCol(8233378, 28, 0.03, 0.21)];
self._UpTexts := ['houl', 'hou', 'oul'];
self._Options := ['ttack Gho', 'ack Ghoul', 'k Ghoul'];
self._Points := [];
end;

procedure HealthRegen();
begin
Me.Integers[0] := iGaussRange(EAT_BETWEEN[0], EAT_BETWEEN[1]);
DebugMsg('Eating next at ' + IntToStr(Me.Integers[0]) + ' hp');
end;

procedure RunRegen();
begin
Me.Integers[1] := iGaussRange(RUN_BETWEEN[0], RUN_BETWEEN[1]);
DebugMsg('Running next at ' + IntToStr(Me.Integers[1]) + ' Energy');
end;

procedure FreeMemory;
begin
DebugMsg('Freeing memory...');
freeDTM(TFood.DTM);
RSW.Free();
end;

procedure Load();
begin
DebugMsg('Loading stuff...');
InitAL();
MouseSpeed := RandomRange(MOUSE_SPEED[0], MOUSE_SPEED[1]);
RSW.Init('WorldMap');
RSW.walkStyle := wsSPS;
RSW.anyAngle := True;
RSW.skipClose := 15;
Me.Active := True;
Me.Member := True;
Me.Name := USER;
Me.Pass := PASS;
Me.Pin := PIN;
Ghoul.Init();
with (TFood) do
begin
Name := 'Salmon';
DTM := DTMFromString('mbQAAAHicY2VgYMhmYmBIAuJkIC4G4nwg5m ZkYOADYiEgZgdiNiC+7i7JcKAyh+FSZxXDcx8ZhgWmAgxyQP38 aJgRCwYDAHgGCaM=');
end;
Setlength(Me.Integers, 2);
HealthRegen();
RunRegen();
addonterminate('FreeMemory');
DebugMsg('Starting Color Ghouler - v' + VERSION);
DebugMsg('Start the script logged in to define your player model');
end;

function TPointArray.Random(): TPoint;
begin
if (Length(Self)) < 1 then exit;
result := self[RandomRange(0, Length(self) - 1)];
end;

procedure CustomMouse(point: TPoint; RX, RY: Integer);
begin
RX := iGaussRange(0, RX);
RY := iGaussRange(0, RY);
case random(0, 15) of
0..5: BrakeMMouse(point, RX, RY, false);
6..7: MissMouse(point, RX, RY);
8..15: HumanMMouse(point, RX, RY);
end;
end;

procedure Antiban();
begin
if (not (isMouseInClient())) then exit;
DebugMsg('Performing antiban');

if ((not (isUsingRun())) and (getRunEnergy() >= Me.Integers[1])) then
begin
toggleRunning(true);
RunRegen();
end;

case random(0, 100) of
0..3: hoverSkill('hitpoints', false);
4..20: MMouseOffClient('Random'); //blaze it
21..45: SleepAndMoveMouse(200 + random(2000));
46..75: HumanRandomMouse();
76..100: setCompass(round(getCompassAngle()) + GaussRange(5 + random(100), 150 + random(200)));
end;

if (random(50) = 1) then
Antiban();
if (random(250) = 1) then
Sleep(GaussRandom(60000));
end;

{ Methodology borrowed from hoodz fighter,
modified to incorporate Entities +
better hitsplats detection }

function Me.SeeHitsplats(timeOut: Integer): Boolean;
var
TColArr: array of TColEx;
TPA: TpointArray;
t1, t2: timer;
i, loadTime: integer;
begin
Result := false;
TColArr := [createCol(13108739, 23, 0.02, 0.17), createCol(65941, 9, 0.00, 0.15)];
loadTime := 0;
t1.start();
while ((t1.timeElapsed() - loadTime) < timeOut) do
begin
t2.start();
self.Model.update();
loadTime := t2.timeElapsed();

TPA := TPAFromEllipse(self.Model.BasePnt.X, self.Model.BasePnt.Y, 14, 18);
FillEllipse(TPA);
if (DEBUG) then DebugTPA(TPA, '');

for i := 0 to High(TColArr) do
begin
if (TColArr[i].count(TPA.getBounds()) > 100) then
exit(true);
end;
end;
end;

function Ghoul.FindFree(): TPointArray;
var
ATPA, TPAs: T2DPointArray;
i, j: Integer;
b: TBox;
begin
result := [];
SetLength(TPAs, Length(Self._TColors));

for j := 0 to High(Self._TColors) do
begin
self._TColors[j].FindAllIn(Area_MS, TPAs[j]);
if length(TPAs[j]) < 1 then exit;
end;

AppendTPA(TPAs[0], TPAs[1]);
ATPA := FloodFillTPA(TPAs[0]);

FilterTPAsBetween(ATPA, 0, 100);
SortATPAFromMidPoint(ATPA, Point(MSCX, MSCY));
if (length(ATPA) < 1) then exit;

for i := 0 to high(ATPA) do
begin
b := toBox(ATPA[i].getBounds().X1 - 30, ATPA[i].getBounds().Y1 - 30, ATPA[i].getBounds().X2 + 30, ATPA[i].getBounds().Y2 + 5);
if (not (foundHPBarIn(B))) then
begin
if (DEBUG) then debugTPA(ATPA[i], '');
exit(ATPA[i]);
end;
end;
end;

function Ghoul.Interact(): Boolean;
var
pnt: TPoint;
begin
result := false;
if (not (isLoggedIn())) then exit;
self._Points := Ghoul.findFree();

if self._Points = [] then exit;
if (DEBUG) then DebugTPA(self._Points, '');

case random(0, 20) of
0..15: pnt := self._Points.midPnt();
16..18: pnt := MedianTPA(self._Points);
19..20: pnt := self._Points.Random();
end;
if (Pnt.X < 1) then exit;
CustomMouse(Pnt, 3, 3);

if (waitUpTextMulti(self._UpTexts, 50 + random(100))) then
begin
if (random(0, 50) > 1) then
fastClick(MOUSE_LEFT)
else
begin
fastClick(MOUSE_RIGHT);
if (not (waitOptionMulti(self._Options, 50 + random(100)))) then exit;
end;
end else
begin
if (random(0, 5)) = 1 then
CustomMouse(Pnt, 100, 100);
if (Ghoul.Interact()) then
exit(true);
end;

if (not (didRedClick())) then exit;
result := (Me.SeeHitsplats(4250 + random(750)));

if (result) then
DebugMsg('Successfully interacted with ghoul')
else
DebugMsg('Failed to interact with ghoul');
end

Procedure Eat();
var
slots: TIntegerArray;
x, y, rand: Integer;
begin
if (not (gameTab(TAB_INV))) then exit;
sleep(GaussRandom(2000));

slots := TFood.getSlots();
if (length(slots) < 1) then exit;
if (random(0, 8) > 1) then
rand := low(slots)
else
rand := random(low(slots), length(slots) - 1);
GaussBox(x, y, invBox(slots[rand]).X1, invBox(slots[rand]).Y1, invBox(slots[rand]).X2, invBox(slots[rand]).Y2)

if (not (PointInBox(getMousePnt(), invBox(slots[rand])))) then
CustomMouse(Point(x, y), 0, 0);

if (random(0, 50) > 1) then
fastClick(MOUSE_LEFT)
else
begin
fastClick(MOUSE_RIGHT);
if (not (waitOptionMulti(['Eat', 'at'], 50 + random(100)))) then exit;
end;

HealthRegen();
end;

procedure WaitFight();
var
t: timer;
begin
t.Start();
while ((Me.SeeHitsplats(1650 + GaussRandom(250))) or (isPlayerWalking())) do
begin
if (t.timeElapsed > (28000 + random(3000))) then
break;
if (getCurrenthealth() <= Me.Integers[0]) then
Eat();
if (random(60) = 1) then
Antiban();
end;
end;

function Fighting(): Boolean;
begin
result := false;
if (not (Me.SeeHitsplats(1))) then
begin
if (Ghoul.Interact()) then
begin
result := true;
WaitFight();
end else
sleep(50);
end;
end;

function Banking(): Boolean;
begin

end;

function GetArea(): Integer;
var
i: Integer;
arr: TBoxArray;
begin
result := - 1;
arr := [GHOULS, BANK];
for i := 0 to high(arr) do
if (PointInBox(RSW.GetMyPos(), arr[i])) then
exit(i);
end;

function GetState(): Variant;
begin
if (not (isLoggedIn())) then
exit(0);
case (TFood.InInventory()) of
true: exit(1);
false: exit(2);
end;
end;

procedure Execute();
var
State: Variant;
Area: Integer;
begin
if (random(125) = 1) then
Antiban();
Area := GetArea();
case (GetState()) of
0: State := LoginPlayer(False);
1:
if (Area = 0) then
State := Fighting();
{else
State := walk to ghouls;}
2:
if (Area = 1) then
State := Banking();
{else
State := walk to bank;}
end;
if (not (State)) then
inc(fails)
else
fails := 0;
if (fails > 15) then
DebugMsg('Too many fails - TERMINATING', true);
end;

begin
Load();
while (not (IsLoggedIn())) do
sleep(2500);
definePlayerModel(35, 70);
if (not (Me.ModelSet)) then
terminateScript;
while (Me.Active) do
Execute();
end.

Hoodz
08-15-2015, 06:21 PM
congratulations on release!

ps for bug report: you could do cb xp gained / xp from 1 ghoul (200 i believe)

anth_
08-15-2015, 08:14 PM
Nice one JS!

jstemper
08-16-2015, 12:58 AM
congratulations on release!

ps for bug report: you could do cb xp gained / xp from 1 ghoul (200 i believe)

cb xp gained / 200 will just give me the amount of ghouls that i killed, problem is that sometimes it will click on a ghoul, then right after it dies sometimes it clicks the same one thus script thinks it counts for 2 kills. I think i can make it more accurate by adjusting some wait times or something
edit: also thanks, reading through yours, i need bot, and davi scripts are basically how i learned how to script.. still have a lot to learn though
edit 2: thanks anth

Incurable
08-16-2015, 07:25 AM
Congrats on release mate! :)

Hoodz
08-16-2015, 02:22 PM
cb xp gained / 200 will just give me the amount of ghouls that i killed, problem is that sometimes it will click on a ghoul, then right after it dies sometimes it clicks the same one thus script thinks it counts for 2 kills. I think i can make it more accurate by adjusting some wait times or something
edit: also thanks, reading through yours, i need bot, and davi scripts are basically how i learned how to script.. still have a lot to learn though
edit 2: thanks anth

no i mean you should track xp gained with reflection.

jstemper
08-16-2015, 02:37 PM
no i mean you should track xp gained with reflection.

i'm not sure what you mean by 'with reflection.' I am tracking xp gained it just isnt 100% accurate atm

Hoodz
08-16-2015, 03:51 PM
i'm not sure what you mean by 'with reflection.' I am tracking xp gained it just isnt 100% accurate atm

look at my nightmare zone script for tracking xp

jstemper
08-16-2015, 05:32 PM
look at my nightmare zone script for tracking xp

thanks, also might edit and utilize that potion handler

Curse
08-17-2015, 02:51 AM
If other players are wearing ghoul/ off white clothing would this script have some kind of an issue with that?

jstemper
08-17-2015, 11:55 AM
Tbh yeah it might but I doubt anyone will, ghouls isn't a popular place anyways but if you have a problem with that tell me and I couldn't always use reflection instead of color

Fitta
08-17-2015, 12:59 PM
Very nice stuff! Keep up the good work :biggrin:

Edit: rep++

frabj
08-18-2015, 07:18 PM
It work's fine but my one issue is that it sometimes clicks the ghoul I have just killed while it is dying, rather than a new ghoul. Is there any way around this?

jstemper
08-18-2015, 08:05 PM
It work's fine but my one issue is that it sometimes clicks the ghoul I have just killed while it is dying, rather than a new ghoul. Is there any way around this?yes it's very easy, I have an updated version but I'm on vacation atm. All you have to do is call a randomwait right before the attack ghoul function

Aegydoesit
08-21-2015, 02:15 AM
Error: Access violation
Compiling failed.


I'm getting this, didn't edit the script... any ideas?

jstemper
08-21-2015, 04:00 PM
I'm getting this, didn't edit the script... any ideas?

hmm that is weird, so you couldn't start the script at all?

xlxneonxlx
08-21-2015, 09:53 PM
I'm getting this, didn't edit the script... any ideas?


hmm that is weird, so you couldn't start the script at all?

Getting this as well, ran Simba as Administrator thinking it may have been the issue, no luck. Quite disappointed too, this looks like a useful script. Any ideas on what it may be friends?

EDIT: https://villavu.com/forum/showthread.php?t=108953&page=15&p=1348393#post1348393

Fix for error at link, after following the fix the script works perfectly fine. Thanks!

jstemper
08-22-2015, 03:23 AM
Getting this as well, ran Simba as Administrator thinking it may have been the issue, no luck. Quite disappointed too, this looks like a useful script. Any ideas on what it may be friends?

EDIT: https://villavu.com/forum/showthread.php?t=108953&page=15&p=1348393#post1348393

Fix for error at link, after following the fix the script works perfectly fine. Thanks!

Yeah as flight said it was caused by trying to load the prosocks plugin twice, glad you fixed it. Tomorrow I will push an update making progress report 99% correct, faster npc detecting, and possible combat potion support

Aegydoesit
08-23-2015, 12:17 PM
Thank you, the prosocks was causing the error.
EDIT: will post proggy after a few hours, thank you so much.


Was able to run for over 10+ hours,



26655

jstemper
08-23-2015, 08:11 PM
Thank you, the prosocks was causing the error.



EDIT: will post proggy after a few hours, thank you so much.

alright cool, atm the proggy is off but I have an updated version with 100% accurate progress report.. gonna wait till next weekend to release it because by that time i will have potion support added. College has taken over my free time :|

sjemple
08-23-2015, 09:16 PM
The script is Great! But there are a few bugs that annoy me quite a lot and assuming others as well.

1st bug i noticed that the script also picks up bones from time to time and therefor takes space in your inventory and eventually become full of them ( could you try adding something to the script that before it takes food it banks all the items in the inventory? )

2nd one is that it wont log back onto the account after disconnecting from the game ( hope you can do something about that if you plan to update your script )

Overall a great script and runs well fixing those 2 things would make it PERFECT !

jstemper
08-23-2015, 10:46 PM
The script is Great! But there are a few bugs that annoy me quite a lot and assuming others as well.

1st bug i noticed that the script also picks up bones from time to time and therefor takes space in your inventory and eventually become full of them ( could you try adding something to the script that before it takes food it banks all the items in the inventory? )

2nd one is that it wont log back onto the account after disconnecting from the game ( hope you can do something about that if you plan to update your script )

Overall a great script and runs well fixing those 2 things would make it PERFECT !

Fixed, thanks for bug report

sjemple
08-24-2015, 01:03 AM
Thanks for the update ! Going to try it out right now and will post my results :) ( also the potion option I noticed is something to look forward to. )

jstemper
08-24-2015, 11:03 AM
Thanks for the update ! Going to try it out right now and will post my results :) ( also the potion option I noticed is something to look forward to. )

Just realized i added hp to 200 not thinking that the 200 already included hp xp... will fix when i get home

sjemple
09-02-2015, 07:29 PM
runescape detected me using a 3rd party program while running this script...I had a nice long run about 5-7 hours of botting a day for 10 days and previously about total of 300 hours of botting with various other scripts before using ghouler. Just so you people know how long it took them to detect a simba script. Maybe they just caught me by not doing randoms. ( got banned for 2 days )

jstemper
09-02-2015, 09:03 PM
runescape detected me using a 3rd party program while running this script...I had a nice long run about 5-7 hours of botting a day for 10 days and previously about total of 300 hours of botting with various other scripts before using ghouler. Just so you people know how long it took them to detect a simba script. Maybe they just caught me by not doing randoms. ( got banned for 2 days )

Man i am sorry to hear that.. at least it was not perm lol
But anyways I haven't touched this script in a while since college started up, maybe I should improve it

anth_
09-03-2015, 10:03 AM
Man i am sorry to hear that.. at least it was not perm lol
But anyways I haven't touched this script in a while since college started up, maybe I should improve it

Is it anything to do with the SPS paths? I've always used reflection for this since I suspected that it wasn't random (but I don't know)

AFools
09-03-2015, 10:19 AM
Errmm i think a small bot wave may have begun; got home from my exam today; thought i could get the farm going. and chain ban one after the other in the space of a couple hours.

jstemper
09-03-2015, 11:46 AM
Well this is interesting, maybe aerolib (color) is the way to go now. FullPottatoHarrywas this on f2p or p2p

AFools
09-03-2015, 02:07 PM
Well this is interesting, maybe aerolib (color) is the way to go now. FullPottatoHarrywas this on f2p or p2p

2 p2p and 2 f2p; it wasn't using this script. but various. though i was aggressively botting to ensure the quality of my scripts.

xlxneonxlx
12-05-2015, 01:24 PM
Used this script a few days ago, went 6 hours straight then hit some type of bug ( was AFKing ) and got a 3-day ban for botting. This script requires a bit of babysitting but otherwise still going strong :D

rock hard
12-05-2015, 05:45 PM
Do you guys think this script is causing the bans or is Jagex just going on some ban waves?

jstemper
12-06-2015, 05:36 PM
Lol does this even still work good guys? havent logged in 07 for some months and also dont have mems, i got a good idea on how to add randomness to the walking tho

KingGriny
12-09-2015, 12:20 PM
For some reason the bot will not open the bank and just continuously rotates the camera around and around giving the error: 'Timed out: Could not find bank - Terminating script' I have to manually open my bank before the script will continue.

jstemper
01-08-2016, 05:17 PM
For some reason the bot will not open the bank and just continuously rotates the camera around and around giving the error: 'Timed out: Could not find bank - Terminating script' I have to manually open my bank before the script will continue.make sure you are on max brightness, if not then the colors of the bank probably need to be changed. I cannot update this because I no longer play 07. Sorry

Snow jr
01-28-2016, 12:06 AM
Str0nk fam#

pitch2cs
01-28-2016, 02:55 AM
ok so when i tired to get on this today i got this error message:
Error: "" is an invalid integer at line 73
im not sure what it is, can any1 help me?

Vusn
01-28-2016, 07:04 PM
ok so when i tired to get on this today i got this error message:
Error: "" is an invalid integer at line 73
im not sure what it is, can any1 help me?

Compiles fine when I try it. What do you have on line 73?

Simbaguardian
01-29-2016, 02:39 AM
ok so when i tired to get on this today i got this error message:
Error: "" is an invalid integer at line 73
im not sure what it is, can any1 help me?

do you have everything installed correctly? most errors are caused by something improperly installed/placed in the right folders? try running simba as admin rights.

jstemper
01-31-2016, 06:42 AM
got back into 07, going to be updating this very soon

pitch2cs
02-01-2016, 01:31 PM
got back into 07, going to be updating this very soon

nice!

iivoidzz
02-27-2016, 03:27 PM
Is it updated yet?

jstemper
02-27-2016, 09:22 PM
Is it updated yet?

funny you say that, I just updated today :D

madmaxman3
04-19-2016, 10:11 PM
Just started using this script, the sclicks could be a little better, missclicks a lot

jstemper
04-19-2016, 10:24 PM
Just started using this script, the sclicks could be a little better, missclicks a lot

yeah I know ;/ once I get mems I will prob make it all color, I like reflection but it is slow + it seems like it doesn't click the npc, but rather clicks the tile that the npc is on (I could be wrong though).

madmaxman3
04-19-2016, 11:00 PM
yeah I know ;/ once I get mems I will prob make it all color, I like reflection but it is slow + it seems like it doesn't click the npc, but rather clicks the tile that the npc is on (I could be wrong though).

Yea, it has trouble with the npc if it is moving. But you are right it does click on the tile.

pitch2cs
09-14-2016, 11:52 AM
Error: Plugin(rstext) has not been found
Compiling failed.

what does this mean?

Blak Fishy
09-14-2016, 12:18 PM
Error: Plugin(rstext) has not been found
Compiling failed.

what does this mean?

You are missing the plugin rstext in your plugins folder inside of simba. Some searching around on the forum should tell you where you can find this plugin.

pitch2cs
09-15-2016, 02:06 AM
now i am getting this:
Error: Access violation at line 627
Execution failed.

i found in the forums andd rstext plugin and put it in the plugins folder but it still wont work

jstemper
02-24-2017, 02:34 PM
bumping cause updated



Hi guys, I had some free time and decided to completely re do this seeing as I was a beginner when i wrote it (code was horrendous ngl). Only combat works at the moment, and I have been hung up on perfecting it (the logic is there for the other features). If I could get some feedback on how it works that would be great. What I really want to do in the long run is track which ghoul you are interacting with, so you are able to see it's health bar and such. However I raged and deleted the progress I had made because it kept getting caught up on other ghouls that walked by. As far as the current combat detection system goes, it works somewhat like hoodz fighter, although I did incorporate TEntities into the script, which I have yet to see anyone do, so feedback on that aspect would be great. The script can be used in SMART or on an official client, and infact, I wrote it completely on the official client.


and if anyone could approve my title update to get rid of the reflection part, that'd be great

AFools
02-25-2017, 05:57 AM
bumping cause updated



and if anyone could approve my title update to get rid of the reflection part, that'd be great

welcome back!

wit1
03-17-2018, 07:23 PM
Thanks for the ghoul script man, will add to my library of combat scripts ;)