J J
2012-04-07 15:27:44
http://www.youtube.com/watch?v=ED9ZwhkLSV8
[youtube]ED9ZwhkLSV8[/youtube]

Development blog videos:
Video #1: Walking around two altars using my script
http://www.youtube.com/watch?v=WzaLJ-4bVDg
[youtube]WzaLJ-4bVDg[/youtube]
Video #2: Walking around every altar at the Great Orb Project using the script
http://www.youtube.com/watch?v=GCuzk_2vQ6I
[youtube]GCuzk_2vQ6I[/youtube]
Video #3: Updated walking by using SPS, DTM's, RadialWalk and much more
Part I: http://www.youtube.com/watch?v=9QVEKwHDKUI
[youtube]9QVEKwHDKUI[/youtube]
Part II: http://www.youtube.com/watch?v=mY0nWNuZ4M8
[youtube]mY0nWNuZ4M8[/youtube]
Video #4: Attracting green orbs @ Air Altar
www.youtube.com/watch?v=4lftEhKE5UU
[youtube]4lftEhKE5UU[/youtube]
Video #5: Joining a team, entering portals, walking, attracting orbs, crafting runes :D
www.youtube.com/watch?v=HSlrtvcVqPg
[youtube]HSlrtvcVqPg[/youtube]
Couple graphics for entertaining purposes :) [LARGE!]
http://img841.imageshack.us/img841/1084/goppicsv2.png
http://img813.imageshack.us/img813/9963/jjsgop.png
Hey! :)
Introduction
My goal is to build a Great Orb Project script. The script procedures should look as human like as possible and I want the script to be as flawless as possible. I decided to make a development blog to keep everything seperated because it's going to be a big project!
Once I manage to make something that suits my desires I will probably use the script to apply as SRL Member and release the whole script to SRL Member+ to avoid leechers abusing the script.
EDIT: 07/05/2012
I'm still unsure what I will be doing with this script once it's completed. It has taken much more time than I expected it to take, however, I am pretty sure that I'm capable of finishing it. Not sure what I'm going to do really…..
Information about the Great Orb Project
Full article here: [X]
Introduction
From: RuneScape Wiki
The Great Orb Project (often shortened to GOP) is a Runecrafting activity located in the Runecrafting Guild. It was released on 12 August 2008. It is a research project which involves two teams gathering different orbs near various Runecrafting altars. To play this game, players must have at least level 50 Runecrafting, and have completed the Rune Mysteries quest.
Objective
From: RuneScape Wiki
The objective of the game is for players to move as many orbs corresponding to their team colour as they can to the altars, as well as keeping orbs of the opposite team away from the altar. The team with the most orbs that has gone into the altar when the timer runs out wins the round.
Rewards
From: RuneScape Wiki
In addition to the essence received after each round, Runecrafting guild tokens will be awarded at the end of the game. For each altar that a team wins, each player on that team receives 100 tokens. For each altar lost, players receive 10 tokens. For each tied altar, players receive 25 tokens. An additional 200 tokens for members, or 150 tokens for free players, are awarded to players on the team that won the most altars. If both teams win the same number of altars, then the majority bonus is split evenly between both teams (100 tokens for members and 75 for free players). Therefore, the maximum number of tokens members can receive is 1,000, while for free players it is 750.
Overview:
Red color means: haven't been working on this yet.
Yellow color means: have been working on this, but it isn't finished yet or accurate enough yet.
Green color means: have been working on this, and it has been finished.
- Starting the game
- Detecting a normal wizard [*]Detecting Wizard Acantha
- Playing the game
- Detecting the altars (Air, Mind, Water, Earth, Fire, Body) [*]Detecting orbs
[*]Detect Wizard Vief
[*]Detecting the portal to start the game
[*]
= Scrapped, inaccurate due to orbs and much more [*]Attract orbs
[*]
= Scrapped, hard to determine when you are repelling to the altar and not so useful either.. might work on this later [*]Destroying barriers
= Scrapped, inaccurate to know which barriers aren't useful around the area [*]Placing barriers
[*]Crafting runes
[*]Detecting when kicked
[*]Failsafes
[*]Walking around at every altar. Biggest amount of work!
- Making the mainloop with failsafes
I have decided to remove some of the coding, because it could possible be abused already :P
My progress
- Detecting a normal wizard
Last worked on at 31-04-2012
Detecting a normal wizard to join a random team.
Procedure has been created by using ACA, TPA's, Splitting TPA, Middle TPA, MMouse and some other stuff.- Detecting Wizard Acantha
Last worked on at 31-04-2012
Detecting Acantha by using the green color

Detecting Acantha by using the brown color of the wheelchair (third picture)

Procedure has been created by modifying the procedure for finding the wizards.
- Detect Wizard Vief
Last worked on at 31-04-2012
Procedure has been created by modifying the procedure for finding the wizards.
This is one of the only fully working procedures that I will release to everyone :P Just to show some of the coding really ;)
* Removed the code *
- Detecting the portal to start the game
Last worked on at 01-05-2012
Detecting the purple portal to enter/start the game.
Detecting the portal outside of GOP:
Detecting text to know when the script has succesfully joined a team
Procedure has been created by using TPA's, Middle TPA, MMouse, ClickMouse and some other things.
- Detecting the altars (Air, Mind, Water, Earth, Fire, Body)
Last worked on at 31/04/2012
This is probably going to be one of the most time consuming parts. The script must be able to detect each of the above mentioned altars correctly.
Started with simply making a large script to detect it.
procedure Test;
var
X, Y: Integer;
begin
{EARTH ALTAR | Brown color of the area}
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 1.05);
WriteLn('Counted colors: '+IntToStr(CountColorTolerance(3298411, MMX1, MMY1, MMX2, MMY2, 12))+'');
if FindColoredAreaTolerance(X, Y, 3298411, MMX1, MMY1, MMX2, MMY2, 100000, 12) then
WriteLn('We are at the Earth Altar');
{FIRE ALTAR | Yellow color of the river}
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 2.64);
WriteLn('Counted colors: '+IntToStr(CountColorTolerance(6274014, MMX1, MMY1, MMX2, MMY2, 15))+'');
if FindColoredAreaTolerance(X, Y, 6274014, MMX1, MMY1, MMX2, MMY2, 10000, 15) then
WriteLn('We are at the Fire Altar');
{AIR ALTAR | Green color of the area}
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.95, 1.87);
WriteLn('Counted colors: '+IntToStr(CountColorTolerance(2056526, MMX1, MMY1, MMX2, MMY2, 9))+'');
if FindColoredAreaTolerance(X, Y, 2056526, MMX1, MMY1, MMX2, MMY2, 50000, 9) then
WriteLn('We are at the Air Altar');
if CountColorTolerance(2056526, MMX1, MMY1, MMX2, MMY2, 9) > 10000 then
WriteLn('We have counted the Air Altar color over 10000 times');
{MIND ALTAR | Gray color of the area}
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(2.78, 0.20);
WriteLn('Counted colors: '+IntToStr(CountColorTolerance(8027508, MMX1, MMY1, MMX2, MMY2, 18))+'');
if FindColoredAreaTolerance(X, Y, 8027508, MMX1, MMY1, MMX2, MMY2, 50000, 18) then
WriteLn('We are at the Mind Altar');
{BODY ALTAR | Dark gray color of the area}
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(2.95, 0.22);
WriteLn('Counted colors: '+IntToStr(CountColorTolerance(6645080, MMX1, MMY1, MMX2, MMY2, 17))+'');
if FindColoredAreaTolerance(X, Y, 6645080, MMX1, MMY1, MMX2, MMY2, 50000, 17) then
WriteLn('We are at the Body Altar');
{WATER ALTAR | Blue color of the water}
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(3.22, 0.91);
WriteLn('Counted colors: '+IntToStr(CountColorTolerance(10129543, MMX1, MMY1, MMX2, MMY2, 5))+'');
if FindColoredAreaTolerance(X, Y, 10129543, MMX1, MMY1, MMX2, MMY2, 10000, 5) then
WriteLn('We are at the Water Altar');
end; Then I rewrote this into an Array.
procedure Test2;
var
AltarMMCol, AltarMMTol: Array of Integer;
AltarMMHue, AltarMMSat: Array of Extended;
PossibleAltars: Array of String;
i: Integer;
begin;
AltarMMCol := [3298411, 6274014, 2056526, 8027508, 6645080, 10129543];
AltarMMTol := [12, 15, 9, 18, 17, 5];
AltarMMHue := [0.07, 0.07, 0.95, 2.78, 2.95, 3.22];
AltarMMSat := [1.05, 2.64, 1.87, 0.20, 0.22, 0.91];
PossibleAltars := ['Earth', 'Fire', 'Air', 'Mind', 'Body', 'Water'];
for i := 0 to 5 do
begin
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(AltarMMHue[i], AltarMMSat[i]);
if CountColorTolerance(AltarMMCol[i], MMX1, MMY1, MMX2, MMY2, AltarMMTol[i]) > 5000 then
WriteLn('We are at the '+PossibleAltars[i]+' Altar');
end;
end;It works correctly. I have been modifying it, though.
- Detecting orbs
Last worked on at 01-05-2012
The script must be able to detect the different types of orbs so it can either attract/repel the orbs or build barriers.
Detecting the green orbs at all areas

Detecting the yellow orbs at all areas

One of the problems with detecting the yellow orbs. Has been fixed now

My setup for getting the colors

Green boxes need to be blocked out when searching for obs
[Working on getting that working, to get the boxes blocked]Procedure has been made by using CountColorTolerance, TPA's, Middle TPA and some other stuff.
- Detecting barriers
The script must be able to detect barriers to avoid bot-like behaviour.
Yet to be worked on. One of the last things on my list.
15/05/2012: Decided to scrap this. Might add this later but for now it isn't really useful and they have the same colors as the orbs.. which will result in inaccuracy :\
- Attract orbs
Last worked on at 01/05/2012
The script must be able to attract orbs to lower the bot-like behaviour and help people that are playing the minigame legitimately. This is also necessary to avoid getting kicked.
I made a procedure that detects the yellow and green orbs at every altar. It will click on the middle and it works fairly well. I still need to modify it a bit to my likings. And for more accurate clicking.
I still have to detect which staff is used, either to attract or to repel.
- Repel orbs
Last worked on at 01/05/2012
The script must be able to repel orbs to lower the bot-like behaviour and help people that are playing the minigame legitimately. This is also necessary to avoid getting kicked.
This is basicly the same thing as attracting the orbs, but I will need to make a procedure that detects which staff is used.
- Destroying barriers
The script should be capable to destroy barriers if it's helpful to destroy them.
Has yet to be worked on. One of the last things on my list.
- Placing barriers
The script should be capable to place barriers if it could possible help the outcome of the minigame.
Should be fairly easy to make, but haven't started on this yet.
Finished this. 14/05/2012
Also destroys them
function MakeBarrier: Boolean;
var
i, X, Y, BarrierGreen, BarrierYellow: Integer;
Barriers: Array of Integer;
BarrierBox: TBox;
PossibleTeam: Array of String;
begin;
PossibleTeam := ['Green', 'Yellow'];
BarrierGreen := DTMFromString('mbQAAAHicY2VgYMhmYmAoAeIEIK4C4nwgfgIUvwbEH4D4LhDfBGItA00gyYSC/zNgAkYsGAwAeAkIJw==');
BarrierYellow := DTMFromString('mbQAAAHicY2VgYDjKxsCwC4h3A/FBIL4AYjMxMKwH4u1AvBmIjwFxYqI5UDUTCv7PgAkYsWAwAAACjgmY');
Barriers := [BarrierGreen, BarrierYellow];
for i:=0 to 1 do
begin
if (JoinedTeam = PossibleTeam[i]) then
begin
if FindDTM(Barriers[i], X, Y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(X, Y, 2, 2);
if WaitUpTextMulti(['ake-', 'arri', 'gener'], 250) then
begin
ClickMouse2(1);
end;
end;
BarrierBox := IntToBox(245, 134, 282, 195);
Wait(100 + Random(100));
if PixelShift(Barrierbox, RandomRange(2500, 3000)) > 1000 then
begin
WriteLn('We have succesfully placed a barrier');
FreeDTM(BarrierGreen);
FreeDTM(BarrierYellow);
Antiban;
Result:=True;
Exit;
end else
begin
MouseCircle(MMCX, MMCY, 70, 1);
Wait(100 + Random(200));
repeat
Wait(50 + Random(100));
until(IsMoving=False);
MMouse(X, Y, 2, 2);
Wait(25 + Random(75));
ClickMouse2(1);
FreeDTM(BarrierGreen);
FreeDTM(BarrierYellow);
Antiban;
Result:=True;
Exit;
end;
end;
end;
end; procedure BarrierEmergency;
var
a, s: Integer;
begin
if FindChatBoxText('low!', 8, clBlack) then
begin
SMART_DrawDotsEx(False, ActionBoxTPA, RGBtoColor(194, 178, 146));
SMART_DrawText(290, 429, UpChars, 'making emergency barriers', clWhite);
if (MakeBarrier=True) then
begin
a:=0;
MarkTime(s);
Wait(1500 + Random(1000));
Mousebox(246, 147, 266, 182, 0);
WaitOptionMulti(['estr', 'estroy', 'Destroy'], 250);
Wait(1500 + Random(1000));
repeat
inc(a);
Antiban;
if MakeBarrier then
begin
Wait(1500 + Random(1000));
Mousebox(246, 147, 266, 182, 0);
WaitOptionMulti(['estr', 'estroy', 'Destroy'], 250);
Wait(1500 + Random(1000));
end;
until (a > RandomRange(2, 5)) or (TimeFromMark(s) > 15000) or (FindChatBoxText('cannot', 8, clBlack))
end;
end;
end;- Crafting runes
The scripts should craft runes at an altar of choice after finishing a sub-part of the game.
I can detect all the symbols already, I would just need to detect which altar the person is at. I have a procedure for that. Will need to write an array of results from another procedure, and after that find the middle of a TPA with the colors of the altar symbols.
- Detect the portal to teleport to the next altar
Last worked on at 31-04-2012
The portal detected.
Portal locations
Script must know at which altar it is at and where to walk to, to go through the portal.Detecting when a new portal will open inside GOP
Arrow Symbol
Detecting the arrow symbol to know where the altar is. Made this happen by using FindDeformedBitMap in and custom accuracy etc. pretty proud of the procedure to find the flashing arrow.
Procedure has been finished.
- Walking around, etc.
LAST WORKED ON AT 01/05/2012
The script must be capable of walking around to points where it can perform helpful actions.
I've decided to map out the whole area myself to get a custom SPS Map.
After a couple hours of merging pictures this is the result:

Merging pictures together for a custom SPS map

Where the script should be able walk to from any position
Area is roughly the same for every altar.

Code to test it
program Test;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
Active := True;
end;
end;
procedure SetupLogin;
begin
ClearDebug;
Smart_Server := 10;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
LoginPlayer;
Wait(1000 + Random(3000));
ClickNorth(0);
end;
procedure Test;
var
MyPath:TPointArray;
MyPos:TPoint;
begin
SPS_Setup(RUNESCAPE_SURFACE, ['0_7RC']);
//myPath := [Point(75, 2503), Point(87, 2491), Point(107, 2495)];
//SPS_WalkPath(MyPath);
MyPos:=SPS_GetMyPos;
Writeln('My position is x: '+inttostr(MyPos.x)+' y: '+inttostr(MyPos.y));
if MyPos = Point(91, 2503) then
begin
WriteLn('We are on the correct spot!');
end else
end;
begin
SetUpLogin;
Test;
end.Fire altar
My position is x: 419 y: -325
Earth altar
My position is x: 423 y: -193
Mind altar
My position is x: 167 y: 23
To be continued when I have more time! Excited about this.
24/04/2012
I've slightly updated the map with larger/higher quality pictures and SPS seems to work better now. New code
procedure Test;
var
MyPos:TPoint;
AirAltarBox: TBox;
begin
SPS_Setup(RUNESCAPE_SURFACE, ['0_5']);
//AirAltarBox := IntToBox(395, 2379, 411, 2399);
AirAltarBox := IntToBox(395, 2363, 415, 2379);
MyPos:=SPS_GetMyPos;
Writeln('My position is x: '+inttostr(MyPos.x)+' y: '+inttostr(MyPos.y));
if PointInBox(MyPos, AirAltarBox) then
WriteLn('We are standing on the correct place!');
if MyPos = Point(91, 2503) then
WriteLn('We are on the Point(91, 2503)');
end;It returns nice values for the air altar which are all above zero. Now I've been working on some code to let the script test if I'm standing maximum of one square away from the altar. It's included in the test script above. To make sure I pick the right box co-ords I will be testing 6 different worlds to get the correct co-ords:
Air altar co-ords
395, 2379
411, 2399
395, 2363
415, 2379
395, 2383
411, 2399
395, 2383
411, 2399
391, 2383
411, 2395
395, 2379
411, 2399
Taking the most common/viable numbers:
(395, 2383, 411, 2399)
I've been testing SPS quite a lot and it works well for the air altar. However, it doesn't work too well at the mind altar because it detects the area around the altar all as the same co-ords. This is because SPS isn't 100% accurate when a lot of the colors are nearly identical. So I've been brainstorming to find a solution and I'm proud to present my new procedure that will walk to the Mind Altar from any spot around the map!
* Removed the code *
Been working on the earth altar one aswell. This one was harder because all of the colors are nearly the same. So radialwalk won't work as well as on the other procedures :P
* Removed the code *
Managed to get it working for every spot by using TPA's to find the way to the altar! Was pretty hard to find the right colors, but it works now.
After some testing I found out that this still wasn't accurate enough. I'm still working on getting more accurate walking, as it's one of the most important things in this script.
07/05/2012
I put the SPS maps apart and they are working fairly now.. Oh well, the other way is a nice failsafe!
The walking is really an extreme amount of work. There are six altars and this is only a very small part of each procedure to walk around
SPS_Setup(RUNESCAPE_SURFACE, ['99_2']);
MyPos := SPS_GetMyPos;
Writeln('My position is x: '+IntToStr(MyPos.x)+' y: '+IntToStr(MyPos.y)+'');
MindM := IntToBox(39839, 1023, 39871, 1051);
MindN := IntToBox(39831, 983, 39871, 1019);
MindNE := IntToBox(39871, 991, 39995, 1027);
MindE := IntToBox(39879, 1023, 39899, 1051);
MindEF := IntToBox(39903, 1035, 39923, 1057);
MindSE := IntToBox(39875, 1047, 39895, 1079);
MindSEF := IntToBox(39899, 1075, 39919, 1091);
MindSEFF := IntToBox(39871, 1103, 39887, 1127);
MindS := IntToBox(39843, 1059, 39863, 1091);
MindSFI := IntToBox(39859, 1095, 39875, 1127);
MindSFII := IntToBox(39827, 1095, 39855, 1127);
MindSW := IntToBox(39823, 1047, 39839, 1075);
MindSWF := IntToBox(39779, 1063, 39807, 1079);
MindW := IntToBox(39815, 1023, 39839, 1055);
MindWM := IntToBox(39775, 1027, 39807, 1051);
MindWF := IntToBox(39755, 1003, 39775, 1067);
MindNWFI := IntToBox(39779, 987, 39807, 1007);
MindNWFII := IntToBox(39771, 1011, 39807, 1035);
MindNW := IntToBox(39807, 983, 39831, 1015);
MindPositions := [MindM, MindN, MindNE, MindE, MindEF, MindSE, MindSEF, MindSEFF, MindS, MindSFI,
MindSFII, MindSW, MindSWF, MindW, MindWM, MindWF, MindNWFI, MindNWFII, MindNW];
MindPositionsTPA := TPAFromBox(MindM) + TPAFromBox(MindN) + TPAFRomBox(MindNE) + TPAFRomBox(MindE) + TPAFromBox(MindEF) +
TPAFRomBox(MindSE) + TPAFRomBox(MindSEF) + TPAFRomBox(MindSEFF) + TPAFRomBox(MindS) + TPAFRomBox(MindSFI) +
TPAFRomBox(MindSFII) + TPAFRomBox(MindSW) + TPAFromBox(MindSWF) + TPAFRomBox(MindW) + TPAFRomBox(MindWM) +
TPAFRomBox(MindWF) + TPAFRomBox(MindNWFI) + TPAFRomBox(MindNWFII) + TPAFRomBox(MindNW);Will take a lot of time to finish everything.
- Making the mainloop with failsafes
10/05/2012: Finished the mainloop, works well.
15/05/2012: Mainloop still needs some editing. It works well if nothing goes wrong, but it's hard to add failsafes when the player gets kicked. You get kicked when your activity or when there aren't enough players to continue. Need to be able to determine why the player got kicked!
Thanks for reading through the whole post! If you have any tips, be sure to leave a comment and let me know! :)

I've been working pretty hard to get the portal inside right. I've now succeeded to get the correct colors to detect the portal every time, at each altar.

Waiting for portal to open
Draw = 405 tokens





It detects if the player is kicked, and if the player is kicked it will wait the amount of minutes it has to wait.