PDA

View Full Version : [Agility] [AeroLib] Gnome Stronghold Agility Course



DeniedHacker
06-22-2015, 05:21 AM
Gnome Agility

Version 1.2



So, I don't know why but this section lack working scripts and It is one of the most important skill to level when you are a member. Especially when you run a Ultimate Ironman Account like I do. Today, This is Going To Change! I am releasing a personal script I Made and Rewritten So I could Release. This script should be way easier to setup if you compare it to the previous script I released


This script will do the whole course using my most powerful custom function :-)

{************************************************* ******************************
* Function designed to find a specific color on the screen. Once the color is
* found, it will either save the position of the color in mouseX and mouseY, Move
* the mouse on the TPA or Click the TPA if Criterias are met
* ------------------------------------------------------------------------------
* Col,Tol,Hue,Sat -> Values used for detecting the color on the screen
* FilterMin, FilterMax -> Values used for removing TPAs we don't want
* LocTopLeft, LocBotRight -> Will be used to form the area where we will search
* the color
* SizeTPA -> Max size of the TPA
* SortLocation -> Point used to Sort TPA based by their proximity to this point
* textUpText -> Uptext that should appear when mouse is hover the TPA
* MoveMouse -> Indicate if we need to move the mouse on the TPA or not
* DoWeClick -> Indicate if we need to click the TPA if all Criterias are met
* Result -> True if the Color was found!
************************************************** ******************************}
Function FindTPAsOnScreen(Col, Tol, FilterMin, FilterMax : Integer; Hue, Sat : Double;
LocTopLeft, LocBotRight, SizeTPA, SortLocation : TPoint; textUpText : TStringArray;
MoveMouse, DoWeClick : Boolean) : Boolean;
Var
tPointGang: TPointArray;
ATPA : T2DPointArray;
i : Integer;
FailAttempt : Integer = 0;
Begin
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Hue, Sat);

//Try to find the color at the location
If FindColorsTolerance(tPointGang, Col, LocTopLeft.x, LocTopLeft.y,
LocBotRight.x, LocBotRight.y, Tol) Then
Begin
//Forming TPAs with the points we found
ATPA := TPAtoATPAEx(tPointGang, SizeTPA.x, SizeTPA.y);

//Sorting TPAs
SortATPAFromMidPoint(ATPA, SortLocation);

//Iterate TPAs
For i:= 0 to high(ATPA) do
Begin
//Filter bad TPAs
If (GetArrayLength(ATPA[i]) > FilterMin) And
(GetArrayLength(ATPA[i]) < FilterMax) Then
Begin
//Fail Safe
FailAttempt := FailAttempt + 1;
If (FailAttempt > 2) Then
Begin
Exit(False);
End;

//Debug -> Good for Debugging a Script :-)
If (Debug_State = 1) Then
Begin
debugTPA(ATPA[i],'');
End Else
Begin
If (Debug_State = 2) Then
Begin
debugBoxes([IntToBox(LocTopLeft.x, LocTopLeft.y,LocBotRight.x, LocBotRight.y)]);
End;
End;

//Determine if we need to Move the mouse or Simply find the color on the
// screen
If (MoveMouse) Then
Begin
mouseX := MiddleTPA(ATPA[i]).x;
mouseY := MiddleTPA(ATPA[i]).y;
//Move the mouse at the mentioned location
customMouse(Point(mouseX, mouseY));

//Look if UpText match
If (waitUpTextMulti(textUpText, 350 + random(100))) Then
Begin
//Next action is based on the fact if user want to Click it or Not
If (DoWeClick) Then
Begin
//Click
fastClick(MOUSE_LEFT);
Wait(Randomrange(30,120));

//Detect if we miss clicked
If (didYellowClick()) Then
Begin
wait(RandomRange(15,30));
FindTPAsOnScreen(Col,Tol,FilterMin,FilterMax,Hue,S at,LocTopLeft,
LocBotRight,SizeTPA, Point(MSCX,MSCY), textUpText, MoveMouse,
DoWeClick);
End;
End;

Exit(True);
End Else
Begin
//If it is not the Walk Uptext, It may mean someone is standing on it.
If (Not waitUpTextMulti(['Walk'], 350 + random(100))) then
Begin
//Right Click
fastClick(MOUSE_RIGHT);
wait(RandomRange(200,300));

//Try to find the Option we are looking for
If (waitOptionMulti(textUpText, 350 + random(100))) Then
Begin
Exit(True);
End Else
waitOptionMulti(['Cancel','ancel'], 350 + random(100));
End;
End;
End Else
Begin
//If user just want to find the Color, we will save the Position where
//the color was found in case we need it later!
mouseX := MiddleTPA(ATPA[i]).x;
mouseY := MiddleTPA(ATPA[i]).y;

Exit(True);
End;
End;
End;
End;
End;


Requirements

You must have AeroLib Revision 11
You must start next to the first obstacle
You must set the custom section
You must set your Compass East Side
Please, don't wear items that may match with the colors used in the Course
???
You must Update findTalk() if you don't want Random(s) to Screw the Script


Features

Antiban
Random Detection
Fail Safe
Will Log Out if something bad happen
100% Color
6K+ Xp per Hour
Highly Commented -> Really Good If you want to Learn Scripting by Copying Others Work


Updates

6/21/2015 -> Initial Release!
6/22/2015 -> Version 1.1
- Fixed Bug where the script was stuck in a infinite loop after solving a Random
- Fixed Bug where the script would logout after crossing the First Obstacle
- Fixed Bug where the script would logout because it couldn't find the second tree branch
- Optimised some part of the script
- Added more Antiban
6/24/2015 -> Version 1.2
- Reworked Detections on some Obstacles
- Reworked Colors on some Obstacles
- Reworked Boxes on Some Obstacles
- The script will be a little bit faster
- This version should be way more stable than Version 1.1 which could run for 10h+ to a few minutes if you were unlucky


Bugs
Please report any bug in this Thread!

Before running the Script
Update findTalk()

Load the Script and Click on the Search bar in Simba Under FunctionList
type findTalk And Double Click on It
http://imagizer.imageshack.us/v2/xq90/913/4lqxLu.png (https://imageshack.com/i/pd4lqxLup)
Find the function declaration "function findTalk(): Boolean"
http://imagizer.imageshack.us/v2/xq90/913/W93rGG.png (https://imageshack.com/i/pdW93rGGp)
Replace it with this Code

function findTalk(): Boolean;
var
Pnt : TPoint;
ax,ay,yCount,zCount,Count2,x1,y1,x2,y2,
X,Y,Count1,bmpScreen: Integer;
NPCName: String;
rTalkStrings: TStringArray;
begin
Result := False;
if not NicknameSet then Exit;

if rand_TxtCol.findIn(AREA_MS, Pnt) then
begin
SetArrayLength(gtalksBox, 0);
SetArrayLength(YelSkipBoxs, 0);

y1 := Pnt.y;
if ( ( Pnt.y + 5 ) > 334 ) then y2 := 334 else y2 := Pnt.y + 5;

x1 := Pnt.x; x2 := x1;
zCount := 0;

repeat
if rand_TxtCol.findIn(toBox(x2,y1+2,x2+3,y2+3), Pnt) then
zCount := 0
else
zCount := zCount + 1;

if ( zCount = 4 ) then Break;
x2 := x2 + 3;
until ( x2 + 3 > 515 );

if ( x2 + 3 <= 515 ) then x2 := x2 - 12;

if (x2 - x1 >= length(Me.Nick) * 4) then
begin

x1 := x1 - 8;
y1 := y1 - 8;
x2 := x2 + 8;
y2 := y2 + 8;

if ( x1 < 0 ) then x1 := 0;
if ( y1 < 0 ) then y1 := 0;
if ( x2 > 515 ) then x2 := 515;
if ( y2 > 334 ) then y2 := 334;

Count2 := Count2 + 1;
Count1 := Count1 + 1;
SetArrayLength(gtalksBox, Count2);
gtalksBox[Count2 - 1].x1 := x1;
gtalksBox[Count2 - 1].y1 := y1;
gtalksBox[Count2 - 1].x2 := x2;
gtalksBox[Count2 - 1].y2 := y2 + 6;

SetArrayLength(YelSkipBoxs, Count1);
YelSkipBoxs[Count1 - 1].x1 := x1;
YelSkipBoxs[Count1 - 1].y1 := y1;
YelSkipBoxs[Count1 - 1].x2 := x2;
YelSkipBoxs[Count1 - 1].y2 := y2;

end else
begin
y1 := y1 - 2;
y2 := y2 + 8;
x1 := x1 - 5;
x2 := x2 + 5;
if ( x1 < 0 ) then x1 := 0;
if ( y1 < 0 ) then y1 := 0;
if ( x2 > 515 ) then x2 := 515;
if ( y2 > 334 ) then y2 := 334;

Count1 := Count1 + 1;
SetArrayLength(YelSkipBoxs, Count1);
YelSkipBoxs[Count1 - 1].x1 := x1;
YelSkipBoxs[Count1 - 1].y1 := y1;
YelSkipBoxs[Count1 - 1].x2 := x2;
YelSkipBoxs[Count1 - 1].y2 := y2;
end;

if (GetArrayLength(gtalksBox) <> 0) then
begin
for yCount := 0 to GetArrayLength(gtalksBox) - 1 do
begin
if cs_FindBitmapMaskTolerance(NickNameBMP, 0, 40, gtalksBox[yCount], ax, ay, cs_CTS) then
begin
warn('Found NickName', WT_RANDOM);
ax := (gtalksBox[yCount].x2 + gtalksBox[yCount].x1) shr 1;
ay := gtalksBox[yCount].y2 - 2;

if findBitmapMaskTolerance(EX_ScreenText, x, y, MSX1, MSY1, MSX2, MSY2, 0, 40) then
begin
wait(randomRange(2500,3500));
Exit(false);
end;

if DISABLE_RANDOMS then
begin
missMouse(point(ax,ay), 0, 0);
if waitUpTextMulti(['Talk','lk-to','ttack','ard','curity'], RandomRange(150,300)) then
begin
fastClick(MOUSE_RIGHT);
if waitOptionMulti(['Dismi','smis'], 300) then
inc(dismissedRandoms);
FFlag(0);
Exit(true);
end;
end;

If DISABLE_RANDOMS Then
Begin
if not findDTM(DTM_RoyalFrog, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
missMouse(point(ax,ay), 0, 0);
if waitUpTextMulti(['Talk','lk-to','ttack','ard','curity'], RandomRange(150,300)) then
begin
NPCName := extractNPCNameUptext();
fastClick(MOUSE_RIGHT);
rTalkStrings := ['o Sec','o San','o Gen','o Mil','o Gil','o Nil','o Ric',
'o Dru','o Cap','o Mys','o Dr'];
if waitOptionMulti(rTalkStrings, RandomRange(150,300)) then
begin
warn('Found talking Random Event', WT_RANDOM);
FFlag(0);
waitFunc(@areTalking, 10, 3000);
if solveTalkingRandom(NPCName) then
Result := True;
Exit;
end;
end;
end else
begin
warn('Found Royal Frog Random Event', WT_RANDOM);
takeScreen('RoyalFrog', includePath+'AeroLib/screenshots/Randoms/');
if Frog_Solve then
Exit(true);
end;
End;

Exit(True);
end;
end;
end;
end;
end;



Complete this section

// Player info
P_NICKNAME = '';
P_LAMPSKILL = SKILL_SMITHING;

//Wait Time after Obstacle Done
FirstNumber := 500;
SecondNumber := 700;

//Minimap click Position -> Depend on how the minimap was loaded. You can adjust
//these values so you can get closer to the first Obstacle -> Default : 643,125
MinimapLocation := Point(650,125);

//0 = Normal, 1 = Show TPAs, 2 = Show Boxes
Debug_State := 0;


Adjust your screen to match like this
http://imagizer.imageshack.us/v2/xq90/661/iWWQAc.png (https://imageshack.com/i/idiWWQAcp)

When you Climb the second net, on the other side, it should look like this
http://imagizer.imageshack.us/v2/xq90/673/qgCnNr.png (https://imageshack.com/i/ipqgCnNrp)



Progress Report

Version 1.1
***********Progress Report************
* ~By Sheepexert~
*Trip Done: 384 (73 Trip/H)
*Agility XP earned: 33024 (6278 XP/H)
*Random Solved: 1
*Total Time: 5 Hours, 14 Minutes and 32 Seconds
*************************************

***********Progress Report************
* ~By Sheepexert~
*Trip Done: 45 (62 Trip/H)
*Agility XP earned: 3870 (5292 XP/H)
*Random Solved: 0
*Total Time: 43 Minutes and 52 Seconds
**************************************

Version 1.2
I closed simba by accident which had my 11hours proggy :-(

srlMW
06-22-2015, 05:55 AM
Nice release! I'm sure you'll be loved for this. (:

StickToTheScript
06-22-2015, 06:12 AM
Just took a quick glance through the findTPAsOnScreen function and I like it! Good job! An gratz on release!

DeniedHacker
06-22-2015, 12:35 PM
Just took a quick glance through the findTPAsOnScreen function and I like it! Good job! An gratz on release!

Thanks You :-)


On another note, I should release a new version during the day. I decided to do a extended test with my rewritten version during the night and it seems like I may have introduced some bugs that cause the script to stop.

So, I will run the script during the day in Debug Mode and Find what is causing the script to stop from time to time.

Maligkno
06-22-2015, 12:39 PM
Great script! Could you make an updated Ape Atoll script pretty please?

DeniedHacker
06-22-2015, 01:12 PM
Great script! Could you make an updated Ape Atoll script pretty please?

It will take quite some time before I can make this script since I need to Level ups some others skills before My Ultimate can do Monkey Madness. Also, I will be busy this week because I need to complete a production Server where I will release a Website and the next week I will be on Vacation with my GF and I don't plan to do any scripting nor coding during this week

It would be way more efficient for you to learn scripting and fix the Ape Atoll by yourself



EDIT
But I can help you doing it if you try to fix it.

anth_
06-22-2015, 11:11 PM
Thank you for this! :)

DeniedHacker
06-22-2015, 11:53 PM
Thank you for this! :)
No Problem :-) There should be a new version in 1-2 days. I ran the script the whole day at work with version 1.1 and I noted a few things I want to Improve that I will include in the next version.


This is the progress report from work:
***********Progress Report************
* ~By Sheepexert~
*Trip Done: 384(73 Trip/H)
*Agility XP earned: 33024(6278 XP/H)
*Random Solved: 1
*Total Time: 5 Hours, 14 Minutes and 32 Seconds
*************************************

anth_
06-22-2015, 11:59 PM
Ah, been running it for a little bit now and it's working quite well :) the only thing I have seen is that on the first tree branch it got stuck because the gnome was in the way of where it was clicking.

Cheers dude ~


***********Progress Report************
* ~By Sheepexert~
*Trip Done: 45 (62 Trip/H)
*Agility XP earned: 3870 (5292 XP/H)
*Random Solved: 0
*Total Time: 43 Minutes and 52 Seconds
**************************************

DeniedHacker
06-23-2015, 12:22 AM
Strange, this can happen from time to time, but It always managed to recovert from it in my case.

I know some people may have problems if their monitor brightness is not set properly. This was a problem I had with my laptop since it was the only computer that was unable to find the second tree branch from time to time because the brightness of the screen was not high enough.

Maligkno
06-23-2015, 02:14 AM
It will take quite some time before I can make this script since I need to Level ups some others skills before My Ultimate can do Monkey Madness. Also, I will be busy this week because I need to complete a production Server where I will release a Website and the next week I will be on Vacation with my GF and I don't plan to do any scripting nor coding during this week

It would be way more efficient for you to learn scripting and fix the Ape Atoll by yourself



EDIT
But I can help you doing it if you try to fix it.

I've tried it is far too outdated to fix.

DeniedHacker
06-23-2015, 03:28 AM
I've tried it is far too outdated to fix.
It seems like you don't have the energy or the knowledge yet to fix it so it can at least compile with Aerolib Version 11. You are lucky, I took 30 minutes of my time to download and make it compile with the lastest Aerolib version. From there, you will be able to start and debug it. I will send you a private message with the script.

I won't respond to you anymore in this thread because I want to keep this thread stricly about my Agility Script and not about someone else script

Aegydoesit
07-13-2015, 02:51 AM
[Error] C:\Simba\Includes\AeroLib\misc\randomsolvers\Maste r.simba(14:17): Unknown type 'TColEx' at line 15
Compiling failed.
Exception in Script: Unknown compiler directives at 6:3
Error: Unknown declaration "cs_FindBitmapMaskTolerance" at line 148
Compiling failed.

AFools
07-13-2015, 01:08 PM
[Error] C:\Simba\Includes\AeroLib\misc\randomsolvers\Maste r.simba(14:17): Unknown type 'TColEx' at line 15
Compiling failed.
Exception in Script: Unknown compiler directives at 6:3
Error: Unknown declaration "cs_FindBitmapMaskTolerance" at line 148
Compiling failed.


selected script -> interpreter -> lape

Radartz
07-16-2015, 07:26 AM
thanks im going to try it out

EDIT: Keep getting this for some reason did what you said to do and put in the new code

"Successfully saved: C:\Simba\Includes\AeroLib\misc\randomsolvers\Maste r.simba
Error: Unknown declaration "foundRandoms" at line 252
Compiling failed.
Error: Unknown declaration "TColEx" at line 13
Compiling failed."

Emarian
07-16-2015, 08:39 PM
Works very well! Would you consider modifying in support for the advanced version?

Other than that, thanks anyways! I absolutely agree that this is a vital skill for a member

darkl0rd13oy
07-17-2015, 02:00 AM
it keeps giving me this error every time i try to run it:

Error: Unknown declaration "LampSkill" at line 119
Compiling failed.

AFools
07-17-2015, 09:07 PM
Works very well! Would you consider modifying in support for the advanced version?

Other than that, thanks anyways! I absolutely agree that this is a vital skill for a member

Am i slow? or missed something.. there is no advanced course for gnome agility on OSRS?

AFools
07-17-2015, 09:10 PM
it keeps giving me this error every time i try to run it:

Error: Unknown declaration "LampSkill" at line 119
Compiling failed.

Change line 119 to // Me.LampSkill := P_LAMPSKILL;

As far as i know; in AeroLib as all randoms will be dismissed you will not get a lamp from a genie. The error is likely due to the recent AeroLib updates

Radartz
07-18-2015, 04:03 AM
Hey forget my earlier post I got it to work and it works great! Thanks

scar_operater
08-14-2015, 07:57 PM
Error: Unknown declaration "cs_FindBitmapMaskTolerance" at line 148

now all my other scripts get that error after changing the findtalk

captainblast
08-19-2015, 10:18 AM
Error: Unknown declaration "cs_FindBitmapMaskTolerance" at line 148

now all my other scripts get that error after changing the findtalk

Yeah the original problem that was causing it was fixed, so if you revert your findtalk to the previous file it will work again.

rkh3544
01-20-2016, 03:09 AM
Hey man thanks for the script. I have a question though. How do I log in? I don't see a place to insert my password. When I run it, smart just stays on the log in page. Thanks!

edit: okay so I logged in manually trhough smart client and then I dragged the window button thingy from simba onto the smart browser. Then I ran the script. It is working perfectly right now. I was just wondering if this si the way that this was meant to be used. Thanks man. great work. The script runs way better than I do with my hand.

Keelijh
01-20-2016, 04:01 AM
Hey man thanks for the script. I have a question though. How do I log in? I don't see a place to insert my password. When I run it, smart just stays on the log in page. Thanks!


Some scripts may not support auto-login features.

In these cases, disabling smart and entering a user's login info manually is the only option aside from editing the script.

Bago47
01-06-2017, 01:23 PM
Note for anyone having problems with running it, since image links are broken:
You MUST SET YOUR CAMERA VIEW PROPERLY.
Compass must face EAST and camera has to be on the highest view!

Nixes
03-27-2018, 09:18 AM
After I changed line 119 to // Me.LampSkill := P_LAMPSKILL; and faced camera to east seemed to work flawlessly.
Edit:
***********Progress Report************
* ~By Sheepexert~
*Trip Done: 113 (76 Trip/H)
*Agility XP earned: 9718 (6551 XP/H)
*Random Solved: 0
*Total Time: 1 Hours, 29 Minutes and 0 Seconds
*************************************

ghost619
04-02-2018, 09:09 AM
i cant get this to work. it hovers mouse slightly above the next obstacle when climbing the net the first time.

StickToTheScript
04-02-2018, 03:45 PM
i cant get this to work. it hovers mouse slightly above the next obstacle when climbing the net the first time.

Make sure your brightness is set to high and that you are zoomed all the way out. Also, as a previous person mentioned, turning the camera east should make it work. If not, it is possible the colours were updated. I might be able to give the script a shot in a couple hours and see where the problem is if you need.