Zeta Matt
2013-09-15 20:15:02
How Long have You Played Runescape?
7 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
Noone
What is your general programming knowledge?
General knowledge in pascal language, enough for basic scripting; I know how to use the functions/procedures, how to organize them in order to make a program, but I don't know the theory behind all of this. I'm planning to learn it as I go doing scripts over scripts.
I'm reading java tutorials at the moment, but my knowledge is still newbie and not enough to do a runescape script, but only easy things like writting on debug, playing sounds, creating applets that runs images etc…
Are you a member of any other communities?
No
Tell us about yourself…
Please show us one (or multiple) of your scripts.
7 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
Noone
What is your general programming knowledge?
General knowledge in pascal language, enough for basic scripting; I know how to use the functions/procedures, how to organize them in order to make a program, but I don't know the theory behind all of this. I'm planning to learn it as I go doing scripts over scripts.
I'm reading java tutorials at the moment, but my knowledge is still newbie and not enough to do a runescape script, but only easy things like writting on debug, playing sounds, creating applets that runs images etc…
Are you a member of any other communities?
No
Tell us about yourself…
From: archermaths
Well, this year has made it very difficult to make progress in learning about programming but, in the middle of january I'll be free of all duties I got at the moment and will be able to spend a lot of time in this. Since I plan on becoming a great programmer and also doing it using villavu most of the time, I would like to become a member of this site.
Please show us one (or multiple) of your scripts.
(*Well, the latest script I've been working on is a divination one; It doesn't use SMART to work; it needs rs client to be resizable, with the same interface organization as mine, which is why I don't post this script on forums... it worths noticing that it harvest wisps until inventory is full perfectly and then stop. It does not convert the memories yet, cuz I couldnt make the scrip find the crater in the ways I knew; that's why I'm learning about TPA now, and then I'll finish the script. Also, I use the debug a lot on my scripts, and the variables are auto-explained by their names, since I prefer it this way. It is:*)
program DivinationUpgradedScript; //REMEMBER TO PUT THE SCRIPT TO CLICK BIG THINGS MORE THAN ONCE, IT'S ANTIBAN!!!!
{$i srl/srl.simba} (* ALL COORDINATES OF THIS SCRIPT ARE FIXED*)
var
x, y, i, t, WispX, WispY, RandomNumber, TimeLookingForWisps, TimePermittedOfFindingWisp, TimePermittedOfMovingCamera: integer; //Not BitMaps
DivinationSkillIcon, xpIcon, InventoryTenChronicleFragment, ChronicleFragment1, ChronicleFragment2, ChronicleFragment3, EnrichedWisp1, EnrichedWisp2, EnrichedWisp3, WispSkyBoxBitMap, SpringSkyBoxBitMap, ChroWispSkyBoxBitMap, EmptyLastInvBitMap, CraterBitMap1, CraterBitMap2: integer;
FoundAndClickedWisp, YouAreInActivityAndDidNotFindAnySpecialNode, FoundWispCoordinates, WriteCommentaries: Boolean;
Const
ChronicleSound = False; //Play a sound if you already have 10 chronicles?
DetectChatClan = True; //Detect chat considering clan
DetectMates = False;
DetectMateChat = True;
DetectFC = False;
(*GENERAL FUNCTIONS/PROCEDURES THAT WILL HELP MAKING THE MAIN BODY OF THE SCRIPT*)
Function DetectChat: Boolean; (*This is something I am working to post on forums, to make easier for people to detect if someone is talking to them while botting. ATM I'm working on some way to detect chat box bounds so I can find everyone's chat coordinates... If I fail, I might just put the coordinates as constants to be set by the user*)
begin
Result := True; (* This marks the eternal loop *)
StopSound;
if DetectChatClan then
if findcolortolerance(x, y, 16755071, 92, 965, 569, 1015, 4) then
begin
Playsound('c:\simba\alarm');
writeln('Someone is talking to you! ' + TheTime);
wait(2000);
StopSound;
end;
if DetectMateChat then //15 this one detects bank icon //15 this one detects something idk //8 this one detects teleportations //8 this one detects teles too //18, detects teles
if findcolortolerance(x, y, 894719, 1773, 113, 1878, 195, 15) or findcolortolerance(x, y, 1875906, 1773, 113, 1878, 195, 15) or findcolortolerance(x, y, 37589, 1773, 113, 1878, 195, 8) or findcolortolerance(x, y, 1217524, 1773, 113, 1878, 195, 8) or findcolortolerance(x, y, 2984694, 1773, 113, 1878, 195, 18) or findcolortolerance(x, y, 1148901, 1773, 113, 1878, 195, 25) then
if findcolortolerance(x, y, 16755071, 92, 965, 569, 1015, 4) then
begin
Playsound('c:\simba\alarm');
writeln('Some mate is talking to you! ' + TheTime);
wait(2000);
StopSound;
end;
if DetectMates then //15 this one detects bank icon
begin
if findcolortolerance(x, y, 894719, 1773, 113, 1878, 195, 15) or findcolortolerance(x, y, 1875906, 1773, 113, 1878, 195, 15) or findcolortolerance(x, y, 37589, 1773, 113, 1878, 195, 8) or findcolortolerance(x, y, 1217524, 1773, 113, 1878, 195, 8) or findcolortolerance(x, y, 2984694, 1773, 113, 1878, 195, 18) or findcolortolerance(x, y, 1148901, 1773, 113, 1878, 195, 25) then
begin
Playsound('c:\simba\alarmdead');
//MMouse(x, y, 0, 0);
writeln('Mate detected! ' + TheTime);
wait(3000);
StopSound;
end;
end;
//if (NoResponse = 2) then TypeSend('heya');
if DetectFC then
if findcolortolerance(x, y, 5657343, 5, 965, 322, 1014, 4) then
begin
i := Length(GetFiles('C:\Simba\Screenshots\','jpg'));
SaveScreenshot('C:\Simba\Screenshots\FCdetection_' + ToStr(i) + '_' + TheDate(Date_Day) + '.jpg');
Playsound('c:\simba\alarm');
writeln('Some friend is talking to you ' + TheTime);
wait(2000);
StopSound;
end;
if DetectFC then
if findcolortolerance(x, y, 16776960, 5, 965, 322, 1014, 4) then
begin
i := Length(GetFiles('C:\Simba\Screenshots\','jpg'));
SaveScreenshot('C:\Simba\Screenshots\FCdetection_' + ToStr(i) + '_' + TheDate(Date_Day) + '.jpg');
Playsound('c:\simba\alarm');
writeln('Some friend is talking to you ' + TheTime);
wait(2000);
StopSound;
end;
end;
Function FindBitMapRotatedIn(bitmap: integer; var x: integer; var y: Integer; xs, ys, xe, ye: integer; tolerance: integer; AngleRotationSpeed: integer): Boolean;
(* About this function and AngleRotationSpeed
This function will start looking for the bitmap in angle 0, then, if it isn't found, it will increase the rotation angle in AngleRotationSpeed; until var Angle reaches 180 or more.
So, if the object you are trying to find is static (it doesn't have rotation; can have translation) then this function isn't recomended. IF the object you are trying to find DO have
revolution movement (can have translation), then this func is ideal, even if the rotation is in 3 Dimensions.
One thing that you gotta have in mind is that this func will take some time if AngleRotationSpeed is too low, so you gotta ponderate it very precisely.
*)
Var
Angle: integer;
FoundBMPRotated: Boolean;
begin
FoundBMPRotated := False; //Set this as false
Result := False;
begin
angle := -45; //initial angle, since the first thing the procedure does is "angle+45"
Repeat //Repeat...
begin
angle := angle+AngleRotationSpeed; //increase angle in what the function was asked.
if FindBitmapToleranceIn(RotateBitmap(bitmap, angle), x, y, xs, ys, xe, ye, tolerance) then //Find the bitmap rotated
begin //if it finds, it will end the function with the result = True.
FoundBMPRotated:=True;
Result := True;
Break;
end;
end;
until angle>180; //if it doesn't find, then it will continue: INCREASE ANGLE IN ANGLEROTATIONSPEED, FIND THE BITMAP IN THAT ANGLE... INCREASE ANGLE IN ANGLEROTATIONSPEED, FIND THE BITMAP IN THAT ANGLE... UNTIL THE ANGLE IS = 180!
end;
end;
Procedure DeclareBitMaps;
begin
EnrichedWisp1 := BitmapFromString(12, 11, 'meJwdzNlvElEcxfH/2jTGNKaNKU' +
'YLqSmkLUTIDMs4w47om0+a8CARXBLrNDQsaZnqXIULw91+ZwSS83Y' +
'++cZxGXCANyAPqAF1UBNoAG4MJ44rQDE2NqkiyAW8PWgQtWjHqlsG' +
'lAALIg9pQTvbDu1Ae78mUX1f3nZsrF9DWJAVUh7pGpmWMV1jOqSbp' +
'Koknd3Ls4gKtCmTcEnWtXhrxDuz6ZqoRVGVViXwPBYZrHK0sjV3FK' +
'9L3lH8veZds2yahUt/bbAchWnDrnSYV6womStYQ7KOYm3DavSnQg8' +
'FCq7U3St5nxH32c08H82LUeCIwJOBpwOH5hbdZc3kfOGfRKNkNE6v' +
'x5erSW49LURTS0wtNSnocVaO0sJPBYPD8Puz5c+X/Dq5/HXG/cz65' +
'nLjX/Dr88WPVDhMPPSPxp8OZr3HQf9pODj+9/X58tspG57+/vJi/j' +
'kx6x3dfnzif3j0HzpPTYw=');
EnrichedWisp2 := BitmapFromString(12, 10, 'meJwlzUtLAlEAQOE/2rJdi/a1CN' +
'oEQliLgkx7MWbS27IwMp9pSiZDj0VZ0UupbNBxGp2Ze++pDM7ygyN' +
'lCrL9Mqgd5DoigrVMM0g9IO+nbX1CyjQUII86RW7hRXE1zEU+5nhb' +
'4H7G1X1KZf6MKiCLeBu4EXortIIYMd40anNCn+xfisgzRBmvSk/DX' +
'sIIYBzwuipvA3bl1/RfsoyoKu9SuVdYIay8/DzwnsK9q5nP3DikUL' +
'm/kbj4N6pbFa2s09iza1pHn305HoMkKo3I45VxzlW3Ijslp5n8ft5' +
'q34SMkv82PgqHiGOcE7ppvnOYOWGkevVDsxb90ufrWV9lbVg523Tj' +
'dGK092klMBJeI2Y/rLUuA+9F/93+SHp+UJhh2hGMCM0N3jdprLuPY' +
'es6+FWafDgaK2lDu1MDP0hdM7E=');
EnrichedWisp3 := BitmapFromString(11, 10, 'meJwljstOwkAART/YD3DjxoWJC1' +
'0QxWh4hYciRRpEjG0BTcFuJCYaMcEHJR1KFZSnIEw7M9cGk7M8ufc' +
'wJ+x2Yq6d5NMcuAKUgdIKDVA519ANcyfBukk2kLEsgVeAf3xTE0ID' +
'iQo7Rc0EJRk+UeFWwXXA53q1o6IdFSTtmsfUlNi3iqUB1wCrQvgjq' +
'hAqXkMgp54lUTPrdS/xc4uFAarD8++uhLigjUNmJjmR6HuGWnkx0j' +
'GrYV7BQgEtghVG9cDsObJspWlLci2Z9xWMy/BjpkXM8/g9Izfb/fr' +
'+8Ck0bcZnLymPZPFVwKCAYQ6jLB+nGucb7cpWx9j9vA/62vwtDjsN' +
'5wQfCdGLMyeix9Ye5fWmstmu7fTuApOHPepnW1FYR9w64HbwD1SoGAQ=');
InventoryTenChronicleFragment := BitmapFromString(16, 16, 'meJxNkUtrE2EUhieJyaQZ02aSmc' +
'lM8s1MJqlpiy7EikUIasVbsAVpsYVC6UIRvODGKlZtldra4gVvrUU' +
'oaJQuXAheVv4GV125ceNK/RX1mX5hMLx8vN85z7w5c8Z39KprVkW+' +
'7lv1ih2UdJ+KyIdF18T72wAtDF2nkEbK1pY0SBgqVyuXjEQxOu18i' +
'i6KKUrZ7LDzSbxra5zyipyCineM8OrZmZKRkjwew4mXRU4kTJWTeq' +
'hipl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2TI/3vP/4' +
'rT/oTP/mvC/1Cy/zeh/ji7/k3F/2HK/3XP/4DR/n7O/mfC/060/za' +
'j/i24/UjD/1PG/2HJ/23M/2rJ/1y//0ey/y2e/CS1+zO8/jy//kzD' +
'/1XE/1HA/0O3/zKo/SCY+6UifyU=');
(*ChronicleFragment3 := ; *)
WispSkyBoxBitMap := BitmapFromString(29, 12, 'meJxjYBgI8P8/CFFFLx6jIFJwhF' +
'WcGGNxsXG5CisbTuIyiqCrMNlYPUi2C5GNRWNTaCzc+1jZuDyFNWT' +
'ITjb4XU5FMLSMxQYAHKi1Sw==');
SpringSkyBoxBitMap := BitmapFromString(26, 12, 'meJxjYBh84P9/EELjwhFWcUy9aO' +
'JYTcYqjsnGaj4xbsDDpsQ99DeNmCjAE0p43EaqGuLBYDaNdAAAh6e' +
'bZQ==');
ChroWispSkyBoxBitMap := BitmapFromString(32, 15, 'meJxjYBgu4P9/BEITpJbh+NnUMp' +
'8Y8aFlPp54wQxMrEYR436sRhFUSYn5xKikv/mksomRZcAROyTlCzz' +
'xOwpwAADuwcc5');
DivinationSkillIcon := BitmapFromString(24, 9, 'meJxTVgYBbSRgDAOWBkY1+nFLEvK' +
'P9LdA0LbyuuzoQGMjI6AsshZlJNDbmIlpFBBY6RulWXqkW3r4mFoY' +
'gU0AAn11TQN1DS0tLTRDgEBDXXVyW461hbGpiaGnm52rs42ZmYkxB' +
'tDS1KzVjwc6cnlj0hTfPLh2aWlpZNOAhpgYG2jjBiZaOtP88vvKfI' +
'DmrJqQp6KE3Ry0sMIE+hqay4sTgSbcPLT07qFtyspKEEMggCSjSq3' +
'8Vvbnnlk2MTHIA9kQXKZhGoipANMQXEbhAcgaRUREyTANTb2oiCgA' +
'YTV8yQ==');
xpIcon := BitmapFromString(21, 13, 'meJxTKkpXogw5bPgIRLhE4GwIA0' +
'0lBNmvfQtEyOoZWZiBCMKFywJFkFUiWwcURFYPYSNz4SJYTYAIolm' +
'NaRpWEWRHElSMVQRuKZrbiNRO0O9YAxarCFpEIAcLmkoIwiOCHPJw' +
'RFKiwgxnumnH6jU4AgARSicv');
EmptyLastInvBitMap := BitmapFromString(16, 15, 'meJxtktkKwlAMRB+vUgr61FqkqQ' +
'ul/v8POvbIEIMQwnSSTJbeGNozzo9r97qdZPfpIB9Di50HKApY536' +
'5HAVIk1dINo/fBEfhBcDy6NiWqTPjFs53zqd2bOqV0+SZmZFkwvJ0' +
'kWcMr4CaMJlZB7MItTBOgMHT0WPnjpmknCiYFvl6P9fY+XIxdHxJg' +
'y16lvXMRCWSJ/mrXxhJcSgU9Gm1vCahcjT/1kLmFjIKbTkZ7FPT3Y' +
'/NB8yPsNT6yXnrN/TKQng=');
CraterBitMap1 := BitmapFromString(37, 10, 'meJxl0+tPk1ccB/B/ZsleLF52UZ' +
'wwMyYrFCiFFimF9QKja0uZfcC2awu4ZMleqCEzOLJEnVxWpWgHRSN' +
'TKJetoiI3CxSftk8v84VbRnSyMXjO9dlp2bIFk++Lk/Pmc76/c46H' +
'8hyJGVG8PpcmHGsh/CnKu+mTTumJW1o1kbACfZ8PL+8H5z+A/UZy5' +
'wg4e/DP04d+Pv1u9PO8B+63prh9QfPr1/WvXdUeCFpKl75Sx74tip' +
'w1/DbsIRHdy5HCX7oqX/RatsebNm92SLxH4k04roUJDUwYUNyMYxz' +
'hP6M849qlKEcX1PjW+3DgAOg+Ci8p0eBRcK7oj+6qjb66Z0Oa9Heq' +
'9YvyR10FofZDt7g3Ao15IWdxpOvII6/m2VXb9oxua0T2sqdyq78Bj' +
'Bm2RxnnlXgbiauhUAWStVAwoIQVx1lBr5Qt6KIRPQ7JoP8wuLhP7J' +
'ajfhW6ZhFDnHjfsTPHbc3aN8PNG6HGp0HF4oX8SW/elLNw6cvD8+6' +
'Spxds4oxODJaLV5RwQIMCWhDwUt5FYzkuqQCpapj8CAmNOGEnsd2C' +
'HmnVSu4r0HAB7NsPeqpxgKMPvXSlg0ZzWWuna24Uce4stLyYrhV8R' +
'Ytnji1/kRftKP7162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/2Zqh9y+se1kVmDhnb4/h/1Plf6cdWrY4HvW3' +
'BAFSuKJCMlS+1zIdVxmx9+CSMD+UiQBsmzyPeXcMDT+qOU9JMFUos' +
'fLr7pZyUxX0ltNVnqyfMXeW1SZw==');
end;
Procedure FreeBitMaps;
begin
FreeBitMap(EnrichedWisp1);
FreeBitMap(EnrichedWisp2);
FreeBitMap(EnrichedWisp3);
FreeBitMap(InventoryTenChronicleFragment);
FreeBitMap(ChronicleFragment1);
FreeBitMap(ChronicleFragment2);
FreeBitMap(WispSkyBoxBitMap);
FreeBitMap(SpringSkyBoxBitMap);
FreeBitMap(ChroWispSkyBoxBitMap);
FreeBitMap(DivinationSkillIcon);
FreeBitMap(xpIcon);
FreeBitMap(EmptyLastInvBitMap);
FreeBitMap(CraterBitMap1);
FreeBitMap(CraterBitMap2);
end;
Function FindEnrichedWisp: Boolean;
begin
DeclareBitMaps;
if FindBitMapRotatedIn(EnrichedWisp1, WispX, WispY, 227, 0, 1565, 1015, 70, 45) or FindBitMapRotatedIn(EnrichedWisp2, WispX, WispY, 227, 0, 1565, 1015, 70, 45) or FindBitMapRotatedIn(EnrichedWisp3, WispX, WispY, 227, 0, 1565, 1015, 70, 45) then //Find for the enriched wisp...
begin
WriteLn('Found an enriched wisp!!!!');
FoundWispCoordinates := True;
FreeBitMaps;
DeclareBitMaps;
Result := True; //if it find enriched on map, it will return true;
end;
end;
Function FindChronicleFragments(WriteCommentaries: Boolean): Boolean;
begin
if not FindBitmapToleranceIn(InventoryTenChronicleFragment, x, y, 1693, 719, 1914, 954, 50) then //if you still don't have 10 fragments, then do:
begin
If WriteCommentaries then WriteLn('You still do not have 10 chronicle fragments, checking for them...'); //60 seems the best tolerance here, below.
if FindBitMapRotatedIn(ChronicleFragment1, WispX, WispY, 227, 0, 1565, 1015, 60, 45) or FindBitMapRotatedIn(ChronicleFragment2, WispX, WispY, 227, 0, 1565, 1015, 60, 45) then //Find for the chronicle fragment...
begin
if WriteCommentaries then WriteLn('Found a chronicle fragment!');
FoundWispCoordinates := True; //Result = True;
Result := True; //if you don't have 10 chronicles on bp yet, and if it finds chronicles on the map, it will return true;
FreeBitMaps;
end else
begin
if WriteCommentaries then WriteLn('Could not find any chronicle fragment on the area');
end;
end else
begin
if WriteCommentaries then WriteLn('You already have 10 chronicle fragments!!!!!');
if ChronicleSound then Playsound('c:\simba\alarm3');
end;
end;
Function FindNormalWisps: Boolean; //********we have to get some Bitmaps for this... It's detecting the little balls that goes from people to the crater... it can generate a bug!*******
begin
WispX := 977;
WispY := 550;
if FindColorSpiralTolerance(WispX, WispY, 7234624, 228, 0, 1560, 669, 5) or FindColorSpiralTolerance(WispX, WispY, 4538146, 228, 0, 1560, 669, 5) then //If find wisp in a small area then Result is True. Loop ended.
begin
FoundWispCoordinates := True;
WriteLn('Found Divination Wisp coordinates!');
Result := True;
end;
end;
Procedure MoveCameraToFindAnyWisp; //Vai mover a camera e, em seguida, procurar pelos nodes. Se encontrar, FoundWispCoordinates:=true. (*PORTUGUESE: "Will move the camera and, then, find for the nodes. If found, FoundWispCoordinates := True;*)
begin
KeyDown(38); //Up arrow //Move camera to up
Wait(RandomRange(200,400));
KeyUp(38);
RandomNumber := RandomRange(1, 5);
case RandomNumber of
1, 2:
begin
KeyDown(37); //Left arrow
wait(RandomRange(100, 400));
KeyUp(37);
Wait(RandomRange(200, 700))
WriteLn('Moved Camera to the left');
end;
3, 4, 5:
begin
KeyDown(39); //Right arrow
wait(RandomRange(100, 400));
KeyUp(39);
Wait(RandomRange(200, 700))
WriteLn('Moved Camera to the Right');
end;
end;
FindNormalWisps; //if any wisp is found, FoundWispCoordinates := True;
FindChronicleFragments(False);
FindEnrichedWisp;
end;
Procedure MoveCharacterToFindAnyWisp; //Se achar um ponto amarelo no mapa, vai clicar, esperar 5 segundos e mover a camera até achar algum node OU o tempo limite acabar. (*PORTUGUESE: If find a yellow point on the mini map, will click, wait 5 secs and then move the camera until find some node or the time limit run out.
begin
if FindColorTolerance(x, y, 917236, 1696, 55, 1908, 392, 0) then
begin
MMouse(x, y, 10, 10);
MultiMouse(x, y, 30, 4, False);
wait(5000);
repeat
begin
MoveCameraToFindAnyWisp;
if FoundWispCoordinates then Exit;
end;
until TimefromMark(TimeLookingForWisps) > TimePermittedOfFindingWisp;
end;
end;
Procedure FindDivinationWisp;
begin
TimePermittedOfFindingWisp := RandomRange(27000, 30000);
TimePermittedOfMovingCamera := RandomRange(6000, 9000);
FoundWispCoordinates := False;
FreeBitMaps;
DeclareBitMaps;
If FindEnrichedWisp then //if it find enriched on map, it will return true;
begin
Exit; //if it finds the enriched wisp, then this procedure can't continue, or it will get other WispX and WispY coordinates. So it will exit the procedure if was found and FoundWispCoordinates will be true.
end else WriteLn('We did not find any enriched Wisp!');
If FindChronicleFragments(True) then //If you don't have 10 chronicles on inv and if it find chronicles on map, it will return true.
begin
Exit; //Exit the procedure with FoundWispCoordinates returned true;
end else WriteLn('Something went wrong with the chronicle fragments');
If FindNormalWisps then //********we have to get some Bitmaps for this... It's detecting the little balls that goes from people to the crater... it can generate a bug!*******
begin
Exit; //Exit the procedure with FoundWispCoordinates returned true;
end else WriteLn('Could not find any normal wisp. Starting procedure of moving camera and character so as to fix this.');
Repeat
begin
MoveCameraToFindAnyWisp; //Move the camera. If it finds a node after moving it, FoundWispCoordinates := True;
if FoundWispCoordinates then Exit; //Continue to "ClickWisp".
end;
until TimeFromMark(TimeLookingForWisps) > TimePermittedOfMovingCamera;
WriteLn('Even moving the camera, we could not find any node. Starting procedure of clicking yellow dots on minimap');
Repeat
begin
MoveCharacterToFindAnyWisp; //Se achar um ponto amarelo no mapa, vai clicar, esperar 5 segundos e mover a camera até achar algum node(FoundWispCoordinates := True) OU o tempo limite acabar. (*PORTUGUESE: "If found a yellow point on map, will click, wait 5 secs and move the camera until find some node(FoundWispCoordinates := True) or the time limit runs out.*)
if FoundWispCoordinates then Exit;
end;
until TimeFromMark(TimeLookingForWisps) > TimePermittedOfFindingWisp;
//if the time has passed n secs, do an infinite idle loop. INFINITE LOOP WORKING!
repeat
begin
Playsound('c:\simba\alarm');
WriteLn('No Wisp was found in any camera position or in any yellow dot in minimap. We are waiting until it logs out');
wait(5000);
end;
until RandomNumber=100; //RandomNumber = 100 is impossible. Proposedly.
end; //If nothing was found, result of FoundWispsCoordinates was False.
Procedure ClickWisp;
begin
FreeBitMaps;
DeclareBitMaps;
MMouse(WispX, WispY, 1, 1); //Move Mouse to the coordinates found
wait(80);
if FindBitmapToleranceIn(WispSkyBoxBitMap, x, y, WispX-30, WispY+100, WispX+300, WispY-100, 0) or FindBitmapToleranceIn(SpringSkyBoxBitMap, x, y, WispX-30, WispY+100, WispX+300, WispY-100, 0) or FindBitmapToleranceIn(ChroWispSkyBoxBitMap, x, y, WispX-30, WispY+100, WispX+300, WispY-100, 0) then //If a skybox with "Gleam" or "Chro" or "gleam" written in yellow colour appear, it will click the coordinates found. The skybox is due to, when you hover a wisp, it appears written "Harvest *** Wisp" in yellow.
begin
wait(100);
ClickMouse2(Mouse_Left); //Clicks where the coordinates were found.
end;
end;
Procedure WaitUntilActivityMax(MaxMiliSecondsPermitted: integer);
Begin
MarkTime(t); //Mark the time
YouAreInActivityAndDidNotFindAnySpecialNode := False;
Repeat
if FindColorTolerance(x, y, 14271141, 926, 0, 990, 58, 5) or FindBitmapToleranceIn(DivinationSkillIcon, x, y, 925, 0, 999, 76, 50) then //If find the colour or the bitmap of divination skill icon on top of the screen then
begin
YouAreInActivityAndDidNotFindAnySpecialNode := True; //Activity is ok.
end;
until TimeFromMark(t) > MaxMiliSecondsPermitted; //Repeat everything until the time looking for the colour (activity) is more than the time permitted.
end;
Function AreYouStillInActivity: Boolean; //WORKING +/-
begin
YouAreInActivityAndDidNotFindAnySpecialNode := False;
MarkTime(t);
repeat
begin
if FindColorTolerance(x, y, 4239345, 890, 416, 1019, 528, 2) or FindBitmapToleranceIn(XpIcon, x, y, 890, 416, 1050, 528, 110) then //90 é a melhor tolerância para o BitMap //Detecte a cor do xp pop up ou o símbolo da palavra "xp" no xp pop up, na região do seu personagem. (*PORTUGUESE: 90 is the better tolerance for the bitmap //Detect the color of xp pop up or the symbol of the word "xp" on the xp pop up, in the region of your character*)
begin
YouAreInActivityAndDidNotFindAnySpecialNode := True; //Se detectar, o resultado é verdadeiro e abandona a função sem mesmo acabar o 1 segundo, com resultado verdadeiro. (* PORTUGUESE: means "If detected, result is true and abandon the function even not reaching 1 second"*)
Result := True;
WriteLn('Still in activity...');
end;
end;
until TimeFromMark(t) > 4000; //Repete tudo isso durante 5 segundos. Resumindo: Se, durante 5 segundos, não for detectada nenhuma das cores, o resultado será falso, ou seja, não há atividade. (* ANOTHER expression written in portuguese, which mean: "repeat this for 5 seconds. Summarizing: if, during 5 secs, none of the colors were detected, the result is false, which mean there is no activity"*)
If FindEnrichedWisp or FindChronicleFragments(False) then
begin
WriteLn('While in Activity, we detected enriched or chronicle fragment, so we are going to catch it!');
YouAreInActivityAndDidNotFindAnySpecialNode := False;
Exit;
end;
end;
Function InventoryIsFull: Boolean;
begin
FreeBitMaps;
DeclareBitMaps;
if not FindBitmapToleranceIn(EmptyLastInvBitMap, x, y, 1793, 880, 1818, 904, 30) then //30 seems to be a good tolerance //If it doesn't find the bitmap of an empty last bp space, then result is true.
begin
WriteLn('Inventory is full!');
Result := True;
end;
end;
(*Function FindForCrater: Boolean;
begin
end;
*)
(*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*)
(*FUNCTIONS/PROCEDURES THAT WILL COMPOSE THE MAIN BODY OF THE SCRIPT*)
(*------------------------------------------------------------------*)
Procedure FindWispClickWispWaitUntilNotInActivityAnymore;
begin
MarkTime(TimelookingForWisps);
Repeat
begin
repeat FindDivinationWisp until FoundWispCoordinates;
ClickWisp;
end;
until DidRedClick;
WaitUntilActivityMax(7000);
if not YouAreInActivityAndDidNotFindAnySpecialNode then WriteLn('After finding wisp and "clicking" it, you are not in activity, but should have been.'); //Working
if YouAreInActivityAndDidNotFindAnySpecialNode then //Working, so it's detecting you are in activity correctly.
begin
WriteLn('You are in activity after clicking wisp, now we are going to wait until you are not in activity');
Repeat AreYouStillInActivity until not YouAreInActivityAndDidNotFindAnySpecialNode; //Now everything is working.
WriteLn('Após clicar no wisp e detectar atividade, acabamos de detectar que não há mais atividade, podemos continuar.'); (* sorry this is writte in portuguese, which mean "After clickin wisp and detecting activity, we just detected that there is no more activity, so we are going on"*)
end;
end;
begin
SetupSRL
Wait(3000);
ClearDebug;
DeclareBitMaps;
Repeat FindWispClickWispWaitUntilNotInActivityAnymore until InventoryIsFull;
FreeBitMaps;
Playsound('c:\simba\alarm');
end.