SRL Archive - Research & Development Lounge

S1NSlayer - Dev


Sin

2012-06-08 19:19:39

So it's finally coming. Never thought I'd work on this but meh..
Anyways, this will be a PUBLIC script, so no worries about it being a member/paid.

I've started working on a few tasks so far, i've gotten Greater Demons, Hellhounds, and Blue Dragons done.

Current Monster: Living Rock Creatures


Neat/Cool extracts from the script:
Abyssal Demons

function OtherMonsterInFight(Box:TBox):Boolean;
var
tmpCTS:Integer;
x,y:Integer;
begin
tmpCTS := GetColorToleranceSpeed;
SetColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.07,0.37);
if FindColorSpiralTolerance(x,y,4540023,Box.x1,Box.y1,Box.x2,Box.x2,5) then
begin
Result := True;
WriteLn('');
end;
SetColorToleranceSpeed(tmpCTS);
end;

The above function returns true if it finds a color in the given TBox (GetTPABounds). It works excellently and works almost 100% of the time.

function FindAbyssalDemon:Boolean;
var
TPA:TPointArray;
x,y:Integer;
Center:TPoint;
tmpCTS,i:Integer;
ATPA:T2DPointArray;
DebugBox:TBox;
begin
Center.x := MSCX;
Center.y := MSCY;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.37,1.19);
if FindColorsSpiralTolerance(x,y,TPA,1843514,MSX1,MSY1,MSX2,MSY2,5) then
begin
SMART_DrawDots(TPA);
DebugBox := GetTPABounds(TPA);
SMART_DrawBox(DebugBox);
if OtherMonsterInFight(DebugBox) then
exit;
ATPA := TPAtoATPA(TPA,20);
SMART_DrawDotsMulti(False,ATPA);
SortATPASize(ATPA,True);
MiddleTPAEx(ATPA[0],x,y);
MMouse(x,y,5,5);
if WaitUptext('ttack',250) then
begin
ClickMouse2(True);
SMART_ClearCanvas;
Result := True;
end;
end;
ColorToleranceSpeed(tmpCTS);
end;

My first hand made TPA function, no ACA ripoffs, so I'm kinda proud.

Warped Tortoises


Procedure CombatChecks;
var
DTM:Integer;
x,y:Integer;
begin
if HealthLow then
begin
TurnOnPrayers;
while not HPPercent > 80 do
begin
ReloadCannon('ire',False);
end;
end;
if PrayerLow then
DrinkPrayer;
if DecayedCannon then
begin
if ReloadCannon('ick',False) then
begin
DTM := DTMFromString('mlwAAAHicY2dgYKhhYmCoBuICIO4A4i4grofyjRgZGByAWAOKzYDYCohNgNjHzRGomwkrNmfADRjxYCgAAMxZBgg=');
Mouse(MMCX,MMCY,1,1,True);
FFlag(1);
if FindDTM(DTM,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
Mouse(x,y,4,4,True);
Wait(1500);
end;
FreeDTM(DTM);
end;
end;
Exit;

end;
The above function is basically a while InFight, it'll handle everything that needs to be handled :)

function WeInFight:Boolean;                                     //by putonajonny
Var
Time, x, y, WaitFight_Shield, WaitFight_Damage : integer;
begin
Result := False;
WaitFight_Shield := DTMFromString('mrAAAAHic42BgYOAFYgEg5gdiHiBmB2I+IGaBijECMRMQs0LlQOJcUBqkl9XUCS8mBBgJYBgAAK0nBH8='); //Sets DTMs and Names
WaitFight_Damage := DTMFromString('mbQAAAHicY2VgYNBmhGAdINYDYn0glgZiBSBWBmI5IJYA4nQ2NoYEPj4wns3DA6a5gPrRMSMWDAYAIPEEVA==');
SetDTMName(WaitFight_Shield, 'WaitFight Shield DTM');
SetDTMName(WaitFight_Damage, 'WaitFight Damage DTM');

FFlag(0); //Incase you clicked a monster that isn't close by
MarkTime(Time); //marks the time
Repeat
Wait(50+Random(50));
if(FindDTM(WaitFight_Shield, x, y, MSX1, MSY1, MSX2, MSY2))then //if it finds the blue "shield" dtm it resets the time marker
begin
CombatChecks;
MarkTime(Time);
Result := True;
end;
if(FindDTM(WaitFight_Damage, x, y, MSX1, MSY1, MSX2, MSY2))then //if it finds the red "damage" dtm it resets the time marker
begin
CombatChecks;
MarkTime(Time);
Result := True;
end;
Until(TimeFromMark(Time) > 2000); //if it hasn't found either for 2000msec then it exits, (i don't play RS much, is there a very slow weapon that this wouldn't work for?)
FreeDTM(WaitFight_Shield);
FreeDTM(WaitFight_Damage);

end;

Putonajonny's code edited for my pleasure! :)

Update on Warped Tortoises:
Added Soulsplit healing
Will now replace cannon if decaying
Unicorn Stallion support soon

Mutated Jadinkos
Added in EEE and Soul Split healing


function SpecialAttackFull:Boolean;
var
x,y:Integer;
TPA:TPointArray;
tmpCTS:Integer;
begin
MouseItem(1,1);
GameTab(tab_Combat);
Wait(500 + random(500));
FindColorsSpiralTolerance(x,y,TPA,5607012,582,416,703,427,78);
writeLn(Length(TPA));
Result := Length(TPA) > 720;
if Result then
CastAttack else
MouseItem(1,1);
end;

Hellhounds

function FailsafeHellhound:Boolean;
var
TPA:TPointArray;
x,y,tmpCTS:Integer;
P:TPoint;
DBox:TBox;
ATPA:T2DPointArray;
begin
tmpCTS := GetColorToleranceSpeed;
SetColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.17,1.23);
if not srl_InFight then
begin
if FindColorsSpiralTolerance(MSCX,MSCY,TPA,1582658,MSX1,MSY1,MSX2,MSY2,18) then
begin
ATPA := TPAtoATPA(TPA,10);
P := MiddleTPA(ATPA[0]);
DBox := GetTPABounds(ATPA[0]);
SMART_DrawBox(DBox);
SMART_DrawDotsMulti(False,ATPA);
MMouse(x,y,1,1);
If WaitUpTextMulti(['ttack','hound','Hell'],750) then
begin
ClickMouse2(False);
ChooseOption('ttack');
end;
end;
end;
end;
That's for the res dung, i'll add on Kuradels Dungeon later on.


Fire Giants
Completed entire tasks successfully @ 9th June, 2012

Bloodvelds


Can you please leave your suggestions/requests for each task that you want to see?
I will ONLY be doing the ones in Kuradel's Dungeon and/or the slightly easier ones such as Hellhounds, Dagganoths, etc.

Ciao!

Jake

2012-06-08 19:36:50

How about dark beasts?

Sin

2012-06-08 19:37:20

From: Jakee
How about dark beasts?


Don't have the slayer level just yet, i'm only 85 at the moment.

Runaway

2012-06-08 19:40:54

Wow, good luck! This should be quite a task (Get it? :garfield:)

Slight suggestion, you've got this:
function FindAbyssalDemon:Boolean;

I'm not sure if you're using it for display or not, but you will save yourself a whole lot of time if you used a case:


function FindMonster(Which: String):Boolean;
var
MonsterColor,MonsterHue,MonsterSat:Integer;
TPA:TPointArray;
x,y:Integer;
Center:TPoint;
tmpCTS,i:Integer;
ATPA:T2DPointArray;
DebugBox:TBox;
begin
case Lowercase(Which) of
'abyssal demon':
begin
MonsterColor := 1843514;
MonsterHue := 0.37;
MonsterSat := 1.19;
end;
// 'greater demon':

// ...

ColorToleranceSpeed(2);
SetColorspeed2Modifiers(MonsterHue,MonsterSat);
if FindColorsSpiralTolerance(x,y,TPA,MonsterColor,MSX1,MSY1,MSX2,MSY2,5) then
// ...

Jake

2012-06-08 19:41:34

From: Shay
Don't have the slayer level just yet, i'm only 85 at the moment.

Gotcha
Just remembered that kuradels dungeon has agil shortcuts and An obelisk. Would your script support using them?

Up to you really to determine the rest of the monsters in the dungeon
http://runescape.wikia.com/wiki/Map:Kuradal%27s_Dungeon

Sin

2012-06-08 19:44:38

From: Runaway
Wow, good luck! This should be quite a task (Get it? :garfield:)

Slight suggestion, you've got this:
function FindAbyssalDemon:Boolean;

I'm not sure if you're using it for display or not, but you will save yourself a whole lot of time if you used a case:


function FindMonster(Which: String):Boolean;
var
MonsterColor,MonsterHue,MonsterSat:Integer;
TPA:TPointArray;
x,y:Integer;
Center:TPoint;
tmpCTS,i:Integer;
ATPA:T2DPointArray;
DebugBox:TBox;
begin
case Lowercase(Which) of
'abyssal demon':
begin
MonsterColor := 1843514;
MonsterHue := 0.37;
MonsterSat := 1.19;
end;
// 'greater demon':

// ...

ColorToleranceSpeed(2);
SetColorspeed2Modifiers(MonsterHue,MonsterSat);
if FindColorsSpiralTolerance(x,y,TPA,MonsterColor,MSX1,MSY1,MSX2,MSY2,5) then
// ...


Ohh dang!
I didn't even think of a case statement!
I'll get right on that, you've got my creative juices flowing :D

From: Jakee
Gotcha
Just remembered that kuradels dungeon has agil shortcuts and An obelisk. Would your script support using them?

Up to you really to determine the rest of the monsters in the dungeon
http://runescape.wikia.com/wiki/Map:Kuradal%27s_Dungeon


This is a win-win situation haha, I get slayer xp while I get to script :p

Wreck

2012-06-08 19:47:29

I suggest you add in the use of MMToMS which would make searching for monsters faster and more accurate!

http://villavu.com/forum/showpost.php?p=1040166&postcount=5

Sin

2012-06-08 19:51:57

From: Wreck
I suggest you add in the use of MMToMS which would make searching for monsters faster and more accurate!

http://villavu.com/forum/showpost.php?p=1040166&postcount=5


All in good time, i'm just concentrating on getting the basic functions working.
Will get to the fancy st00f later on :)

pkwa9lawy

2012-06-08 19:57:29

good luck i hope you and nkn work on a fully aio slayer script would save you both guys time

Sin

2012-06-08 19:59:04

From: pkwa9lawy
good luck i hope you and nkn work on a fully aio slayer script would save you both guys time


I've had bad experiences working with other people lmao.
I'm solo for now.

[YOUTUBE]8ESdn0MuJWQ[/YOUTUBE]

Sirenia

2012-06-08 20:44:13

Goodluck! ;D

Sin

2012-06-08 21:11:01

Task is over, Jad task now.

Hazzah

2012-06-08 21:40:16

A fully working Fight caves would be an amazing feat… Just saying :P

Sin

2012-06-08 21:41:31

From: Hazzah
A fully working Fight caves would be an amazing feat… Just saying :P


Oh darn! I just started my task! Too late now :(

Justin

2012-06-08 23:47:04

I'll be up to help test this :P

Sin

2012-06-08 23:54:52

From: [J]ustin
I'll be up to help test this :P


Just about finished my Fire Giants task, let's see whats up next.

Sin

2012-06-09 02:03:18

Updated: Warped Tortoises are working amazingly!

Sirenia

2012-06-09 03:06:45

Do you plan on adding Black Demons?

riwu

2012-06-09 03:28:20

Yet another slayer dev blog…

wait there is some code this time!
Walking will be the most tedious part though, but its still a good start to get the fighting done first.

Keep up the good job sin! :)

smurg

2012-06-09 06:19:33

Probably should add some failsafes to your infinite loop in combat checks.

mormonman

2012-06-09 06:26:52

You should really make a global TPA function and store monster/object information in records that are passed through the function. Will save you loads of coding and time.

Sin

2012-06-09 11:03:07

From: smurg
Probably should add some failsafes to your infinite loop in combat checks.


I'll fix em, it's just the shell for now.

xAnthrax

2012-06-09 11:27:23

I'm excited to see where this goes dude.

Sin

2012-06-09 12:52:38

Current task:
Mutated Jadinkos

Olly

2012-06-09 15:30:07

Looks amazing :)

Recursive

2012-06-09 15:38:40

Wow looks good, and as someone mentioned before, it would be better to use case statements.

Also another suggestion that came as I was writing this is to use one boolean function to find the monsters, then just call the function and clickmouse2(false) or something similar then you can add your failsafes. I believe it would be easier than having to make a seperate function to find them all.

Sin

2012-06-09 16:14:27

Quick update on Fire Giants:


AideniRS

2012-06-09 18:43:43

That looks sick, slay is my last 99 for max lol ):

Sin

2012-06-09 19:50:38

Currently Working On:
Bloodveld

Sin

2012-06-09 20:15:48

Progress on Bloodvelds:


Benny

2012-06-09 20:35:53

This looks amazing Shay!! keep up the good work and if you need help let me know!!

Main

2012-06-09 20:45:08

I suggest you store monster as type record.
As well as store the color and the tolerance as an array (Integer array or a TPoint array). This way you can find the monster using more specific colors (that has small tolerance) thus giving you more accurate results.




Here is a function that finds an array of colors:
Function FindManyColors( CT: TPointArray; SP, EP: TPoint): TPointArray;
Var
TI: Integer;
TTPA: TPointArray;
Begin
For TI := 0 To ( Length( CT) - 1) Do
TB := FindColorsTolerance( TTPA, CT[ TI].X, SP.X, SP.Y, EP.X, EP.Y, CT[ TI].Y)
Result:= CombineTPA( Result, TTPA);
End;


CT is a TPointArray that store colors and tolerance instead of X,Y.


So
CT[0]=(1231519,7);
CT[1]=(91238412,3);

Sin

2012-06-09 20:47:16

From: Main
I suggest you store monster as type record.

Where the color of the monster is a array of integer as well as tolerance. This way you can find the monster using more specific colors (that has small tolerance).

You can also use this
Function FindManyColors( CT: TPointArray; SP, EP: TPoint; T: Boolean): TPointArray;
Var
TI: Integer;
TB: Boolean;
TTPA: TPointArray;
Begin
For TI := 0 To ( Length( CT) - 1) Do
Begin
If T Then
TB := FindColorsTolerance( TTPA, CT[ TI].X, SP.X, SP.Y, EP.X, EP.Y, CT[ TI].Y)
Else
TB := FindColorsCircleTolerance( TTPA, CT[ TI].X, CT[ TI].Y, MMCXe, MMCYe, MMRDe);
If TB Then
Result:= CombineTPA( Result, TTPA);
End;
End;


CT is a TPointArray that store colors instead of X,Y.


So
CT[0]=(1231519,7);
CT[1]=(91238412,3);


I was planning on that, but I just decided to make the TPA I use as a global one :p

Sin

2012-06-09 22:25:50

Okay, I'll bite, I'm going to try (and hopefully complete!) the LRC creature task.

Justin

2012-06-10 01:45:16

From: Shay
Okay, I'll bite, I'm going to try (and hopefully complete!) the LRC creature task.


Loving the progress on this!

Sin

2012-06-10 02:19:18

Beta release should be up either tommorow or the day after.
Have to go to a party then a movie, so dev will be slowed down tommorow.

Silentcore

2012-06-10 03:13:31

Shay(Sin) this is an epic start, it will eventually grow and get better.Congrats on this dude.

Justin

2012-06-10 03:16:47

From: Shay
Beta release should be up either tommorow or the day after.
Have to go to a party then a movie, so dev will be slowed down tommorow.


Sounds like a plan xD

momotron

2012-06-10 07:00:38

Good look with this Shay! Hopefully you'll have it done before I've gotten 99 farming and crafting so I can bot 99 slayer ;)

Sin

2012-06-10 10:40:50

Off to a party, development will continue once im back.

Mat

2012-06-11 08:47:39

Sin, this is looking good mate :).

Sin

2012-06-11 10:07:12

A couple functions i've been working on :


function GoalXPMet:Boolean;
var
i:Integer;
startXP,newXP:Integer;
curXP,goalXP:Integer;
begin
startXP := GetXPBarTotal;
goalXP := startXP + 418;
curXP := GetXPBarTotal;
i := 0;
repeat
Result := False;
newXP := GetXPBarTotal;
Wait(500 + random(10));
Inc(i);
if goalXP = curXP then Result := True;
until (Result) or (I = 200);
Exit;
end;
function WhileIn:Boolean;
var
t:Integer;
begin
MarkTime(t);
while not GoalXPMet do
begin
Result := True;
//CombatChecks;
if TimeFromMark(t) > 170000 then
begin
Result := False;
Break;
end;
end;
if Result then
begin
{
Find_G('ttack',False);
if WaitXPIncrease then
Inc(KillCount);
}
end;
end;
This was done at school, so all on theory.
It's for the smashing of the gargoyles when they are low HP.
Btw, Beta has been released, go check it out.

Nava2

2012-06-11 10:13:52

Your best option is actually using records and Functional Ptrs for each of these functions. May also want to avoid global variables for where you are storing the x, y of finding the monsters. Use 'out' type parameters.

[XoL]

2012-06-11 13:33:10

I am assuming this won't be collecting the drops?

E: You don't need to smash, I think it is automated now (or it is for me, not sure if I bought an upgrade or something from a slayer master)

Sin

2012-06-11 15:35:08

From: R4nd0m
I am assuming this won't be collecting the drops?

E: You don't need to smash, I think it is automated now (or it is for me, not sure if I bought an upgrade or something from a slayer master)


I know, but I'm not going to spend my points on it.

ABC!

2012-06-11 16:14:31

Damn nice dude, are you planning to do the monsters which are usually regarded as slow exp? Like gargoyles, abby demons, etc…

Or are you going to implement the easy bottable tasks which include probably the slower tasks and will it skip the harder more deadily tasks, like mith dragons?

Also,how reliable will it be? Will it be good enough to leave running with expensive gear? Will it just leave execute if it gets a jad task ( so we can do it ourself)?

I'm very curious because im in the process of getting 99 slayer! And I understand this is an extremely hard script to write, so am not knocking it, but I just dont want to lose a load of good gear as you can imagine and if it is going to be very slow, would it be easier to do myself, as slayer is so afk.

Thanks!

prabhsun

2013-10-04 20:52:06

Wow, that is truly amazing what you are doing. I would love to donate and help develop this script further :)

Sin

2013-10-04 21:15:22

Thread is over a year old :p
It's been released then trashed because of EoC.

Justin

2013-10-04 22:51:09

From: Sin
Thread is over a year old :p
It's been released then trashed because of EoC.


Any plans to update it for EoC/RS3/SRL-6?

Hazzah

2013-10-05 01:02:04

From: Justin
Any plans to update it for EoC/RS3/SRL-6?


Since he no longer has an account (IIRC) he probably wont be bothering.

Sin

2013-10-06 14:59:40

From: Justin
Any plans to update it for EoC/RS3/SRL-6?


From: Hazzah
Since he no longer has an account (IIRC) he probably wont be bothering.


Well I do, but I think I've moved on from Runescape :P

Cheddy

2013-10-20 17:31:54

So much more efficient when you don't use ACA :D I still use it to get the colours though