Anyone have any?
Anyone have any?
Well okay, now I need something that will find a high concentration of rocks in an area 50*50 in the minimap, whilst it also can see if the players in that square exceed a certain number also it can check if its not in that area already. Should be easy with TPA's see how it goes![]()
This should work pretty well.
Rocks being the number of rocks required to be added into the result tpa, and Players being the number of players in the area required to filter the point out.SCAR Code:function getRocks(Rocks, Players: integer): TPointArray;
var
Col, CTS, i, Hi, L: integer;
P: TPointArray;
aP: T2DPointArray;
B: TBox;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
Col := FindStoneColor;
if Col = 0 then Exit;
FindColorsTolerance(P, Col, MMX1, MMY1, MMX2, MMY2, 10);
aP := SplitTPA(P, 5);
Hi := High(aP);
for i := 0 to Hi do
begin
B := GetTPABounds(aP[i]);
if Distance(B.x1, B.y1, B.x2, B.y2)/5 >= Rocks then
begin
if (PlayersOnMap(B.x1-5, B.y1-5, B.x2+5, B.y2+5) >= Players) or
(PointInBox(Point(MMCX, MMCY), PointToBox(Point(B.x1-5, B.y1-5), Point(B.x2+5, B.y2+5)))) then Continue;
L := Length(Result);
SetLength(Result, L+1);
Result[L] := MiddleTPA(aP[i]);
end;
end;
ColorToleranceSpeed(CTS);
end;;
If it doesn't exactly fit your needs you could easily edit it a tiny bit, or if it doesn't work exactly right just increase the sensitivity (box size, formula, etc).
Anyone else?
when im fishing and then the fishing spot moves i need something to find if i am actually still fishing or not could do it now but lazyso yea thx
SCAR Code:function Fishing(Equip: string): Boolean;
var
x, y, Col, CTS: integer;
P: TPointArray;
begin
FindFishingSpot(x, y);
case Lowercase(Equip) of
'net': Col := 1780531;
'rod': Col := 7208;
'harpoon': Col := 872813;
'cage': Col := 7365986;
end;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(x, y, P, Col, x-20, y-20, x+20, y+20, 20);
ColorToleranceSpeed(CTS);
Result := Length(P) > 15;
end;
Once again, edit to fit your needs. If you were to use this in a script it would probably be best to make the colors global, so not declare them repeatedly.
Anyone else?
Make it get the amount of damage it is inflicting per turn on a moster.
Hint : Try a FindText then check it isn't that player by checking the uptext.
Make a function , in the mining guild counts how many rocks there are, how many players there are, and cheak to see if no players are near the rocks , if theres a play near one rock it finds move onto the next rock point in the Array and so until it finds a rock with no one near it, Sound kinda hard but if you trhink about it its easy.
SCAR Code:function FindLoneRock: TPointArray;
var
Col, i, Hi, L: integer;
P, Ps: TPointArray;
aP: T2DPointArray;
M: TPoint;
begin
Col := FindRockColor;
if Col = 0 then Exit;
FindColorsTolerance(P, Col, MMX1, MMY1, MMX2, MMY2, 20);
aP := SplitTPA(P, 1);
Hi := High(aP);
for i := 0 to Hi do
begin
M := MiddleTPA(aP[i]);
FindColorsTolerance(Ps, 16711422, M.x-6, M.y-4, M.x+4, M.y+8, 19);
if Length(Ps)>3 then Continue;
L := Length(Result);
SetLength(Result, L+1);
Result[L] := M;
end;
end;
Will result a TPointArray containing one point for every rock in the guild with no one next to it.
This function could be iffy, because you can have more than one character on a tile taking damage. The only way to almost have a 100% success rate is to use reflection, is that alright with you?
[offtopic]... you should update ur tut runner so it works for island...[/offtopic]
can you make one that finds an npc with tpa(so all i have to insert is colors) and then trades with it...
Nop not reflection.. Now that would be too easy. Its only 10 pixel in a square where the damage is displayed.
A monster finder, TPA preferably, doesn't need tolerance on uptext. I can provide colors.
God fuck, monster finder isn't any different from an object finder, just use FindObjTPA because in most cases it's anyway better than a custom finder...
I understand that, but what I'm saying is that you can have another player taking damage on the same tile as you, and that could cause a lot of problems.
You could do that with something like..
SCAR Code:begin
FindObjTPA(whatever);
Mouse(x, y, 0, 0, False);
ChooseOption('rade');
end;
What n3s said.
umm ok i am fixing a tut runner and i need a custom logon function... cuz when you first log on on a new character it does not display the little "Click Here to Play" screen (that tells ip address of last place you logged on). so i need it to just jump from login to the script...( i tried it on my own and i failed...)
How about a PvP Login command? I've noticed that PvP worlds would be great for autoing, but for scripts that start logged out/rest, it doesn't work because of the PvP screen.
<3
Originally Posted by Eminem
Make me a function that will kill Wizzup? For he likes men.
A FindOption function would be nice![]()
for example you could use it like
SCAR Code:if FindOption(Amount) then
begin
ChooseOption(Amount);
end else
begin
ChooseOption('X');
TypeSend(Amount);
end;
Can't you just do this Heysus?
SCAR Code:f Not ChooseOption(Amount) Then
Begin
ChooseOption('X');
TypeSend(Amount)
End;
This will work in all situations. (tut, pvp, regular)
SCAR Code:procedure LoginPlayer;
var
Mark, Attempts: Integer;
Actions: TVariantArray;
RetryLogin: Boolean;
label
ProcStart;
begin
ActivateClient;
Wait(100);
if (GetColor(212, 327) = 238301) then //At Click To Play screen
begin
Wait(1000 + Random(3000));
MouseBox(227, 337, 555, 364, 1);
MarkTime(Mark);
while (TimeFromMark(Mark) < 30000) and (not(LoggedIn)) do
Wait(1000 + Random(1000));
end;
if (not(RSReady)) then
begin
MarkTime(Mark);
while (not(RSReady)) do
begin
Wait(100);
if (TimeFromMark(Mark) > 180000) then
begin
WriteLn('It has been 3 minutes and Runescape is not yet ready... Terminating.');
TerminateScript;
end;
end;
WriteLn('Welcome to Runescape.');
end;
LoginScreenMusic(True);
if (not(GraphicsSet)) then
begin
SetAutoingDefaults;
GraphicsSet := True;
end;
ProcStart:
if (not(LoggedIn)) then
begin
if (not(Players[CurrentPlayer].Active)) then
begin
WriteLn('Player is not Active...');
NextPlayer(False);
Exit;
end;
Wait(900 + random(60));
//Click 'Log In' on main menu
while (GetColor(343, 174) <> 7750) do
begin
MouseBox(360, 180, 400, 185, 1);
Wait(100 + Random(100));
end;
//Type Username
Mouse(315, 272, 10, 5, True);
while (CountColor(7750, 311, 269, 452, 284) > 13) do
begin
KeyDown(vk_Back);
Wait(10 + Random(10));
KeyUp(vk_Back);
Wait(50 + Random(50));
end;
for Mark := 0 to 3 do
begin
KeyDown(vk_Back);
Wait(10 + Random(10));
KeyUp(vk_Back);
Wait(50 + Random(50));
end;
Wait(100 + Random(200));
WriteLn(Capitalize(Players[CurrentPlayer].Name));
TypeSend(Players[CurrentPlayer].Name);
Wait(100+random(50));
//Type Password
Mouse(315, 334, 10, 5, True);
while (CountColor(7750, 311, 337, 452, 352) > 13) do
begin
KeyDown(vk_Back);
Wait(10 + Random(10));
KeyUp(vk_Back);
Wait(50 + Random(50));
end;
for Mark := 0 to 3 do
begin
KeyDown(vk_Back);
Wait(10 + Random(10));
KeyUp(vk_Back);
Wait(50 + Random(50));
end;
Wait(100 + Random(200));
TypeSend(Players[CurrentPlayer].Pass);
Wait(500 + Random(300));
if (not(FindTextTPA(12509695, 0, 288, 205, 475, 247, 'login', StatChars, Nothing))) then //If 'enter' from typesend didn't log us in
begin
if GetColor(312, 231) = 197552 then
MouseBox(382, 414, 533, 425, 1)
else
MouseBox(355, 359, 403, 372, 1); //Click 'login' login screen
Wait(250 + random(100));
end;
MarkTime(Mark);
repeat
SetLength(Actions, 0);
if (TimeFromMark(Mark) > 60000) then
Actions := ['One minute has passed...', 0, 2, 'NextPlayer', 'Login Failed']
else
case (CountColor(12509695, 288, 205, 475, 247)) of //Number of text colour points
// Actions := ['WriteLn Text', TimeToWait, NumberOfRetries, 'FinalAction', 'PlayerStatus'];
760: Actions := ['Too many incorrect logins.', 5 * 60000, 2, 'NextPlayer', ''];
536: Actions := ['Login limit exceeded. Please wait 1 minute and try again.', 60000, 2, 'NextPlayer', ''];
711: Actions := ['Your account has been disabled', 0, 0, 'NextPlayer', 'Acc Disabled'];
598: Actions := ['Invalid Username \ Password', 0, 2, 'NextPlayer', 'Wrong User/Pass'];
917: Actions := ['Not a Members Account', 0, 0, 'NextPlayer', 'Non-member'];
408: Actions := ['World is full.', 5000, 20, 'Terminate', ''];
623: Actions := ['Your account is already logged in', 5000, 0, 'RandomNextPlayer', ''];
555: Actions := ['The Server is being updated.', 60000, 4, 'Terminate', 'Server Updating'];
218: Actions := ['Error Connecting.', 20000, 9, 'Terminate', 'Error Connecting'];
335: Actions := ['Unable to connect Login Server offline.',(20000) + Random(6000), 4, 'Terminate', 'Login Server Offline'];
512: Actions := ['RuneScape has been updated. Script Terminated.', 0, 0, 'Terminate', 'RS Updated'];
489: Actions := ['Connection timed out.', 0, 4, 'Terminate', 'Connection Timed Out'];
737: Actions := ['You are standing in a members-only area.', 0, 0, 'NextPlayer', 'In Mems-Only Area'];
//10: Actions := ['Error loading your profile.', 5000, 10, 'NextPlayer', 'Profile Loading Failed']; // Error loading your profile. Will attempt to re-login 5 more times.)
//11: Actions := ['Login server rejected session.', 1000, 10, 'NextPlayer', 'Login Serv. Rejected']; // Login server rejected session.
end;
if (Length(Actions) > 0) then
begin
WriteLn(Actions[0]);
Wait(Actions[1] + Random(100));
if (Actions[2] <> 0) then
if (Attempts < Actions[2]) or (Actions[2] = -1) then
begin
RetryLogin := True;
Break;
end;
if (Actions[4] <> '') then
Players[CurrentPlayer].Loc := Actions[4];
case Actions[3] of
'NextPlayer': NextPlayer(False);
'RandomNextPlayer': RandomNextPlayer(True);
'Terminate': TerminateScript;
end;
Exit;
end;
Wait(100);
until(GetColor(212, 327) = 238301) or LoggedIn;
if (RetryLogin) then
begin
RetryLogin := False;
Inc(Attempts);
goto ProcStart;
end;
if (GetColor(212, 327) = 238301) then
begin
Wait(1000 + Random(2000));
MouseBox(227, 337, 555, 364, 1);
end;
MarkTime(Mark);
while (TimeFromMark(Mark) < 30000) and (not(LoggedIn)) do
Wait(1000 + Random(1000));
end;
if (LoggedIn) then
begin
PlayerStartTime := (GetSystemTime div 1000); // PlayerStartTime
if Length(Players[CurrentPlayer].NickTPA) < 2 then
begin;
Writeln('Creating the NickTPA.');
if Players[CurrentPlayer].Nick <> '' then
Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Nick, UpChars)
else
begin;
Writeln('Nickname isn''t set, taking the username instead..');
Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Name, UpChars);
end;
end;
AddToSRLLog('Current player: ' + Capitalize(Players[CurrentPlayer].Name));
end;
end;
All i did was add an or LoggedIn in the 'Click Here to Play' check and added a check for the red pvp text after the line
SCAR Code:if (not(FindTextTPA(12509695, 0, 288, 205, 475, 247, 'login', StatChars, Nothing))) then
SCAR Code:begin
OpenWebPage('http://www.4chan.org/');
end.
This was easy...all i did was change the last bit.SCAR Code:function FindOption(var x, y: integer; Option: string): Boolean;
var
B: TBox;
TPA: TPointArray;
fx, fy, I, C: Integer;
P: TPoint;
begin
Result := False;
GetClientDimensions(B.X2, B.Y2);
B.X1 := 0;
B.Y1 := 0;
FindColorsTolerance(TPA, 4674653, B.X1, B.Y1, B.X2, B.Y2, 0);
If Length(TPA) < 10 Then
Exit;
B.X2 := 0;
B.Y2 := 0;
P := TPA[0];
For I := 0 To High(TPA) - 1 Do
If TPA[i].X = TPA[I+1].X - 1 Then
Begin
If C > 5 Then
Begin
B.X1 := P.X;
B.Y1 := P.Y;
Break;
End Else
C := C + 1;
End
Else
Begin
P := TPA[I + 1];
C := 0;
End;
If I = Length(TPA) Then
Begin
WriteLn('Choose Option Menu Getting Failed');
Exit;
End;
InvertTPA(TPA);
C := 0;
P := TPA[0];
For I := 0 To High(TPA) - 1 Do
If TPA[i].X = TPA[I+1].X + 1 Then
Begin
If C > 5 Then
Begin
B.X2 := P.X;
B.Y2 := P.Y;
Break;
End Else
C := C + 1;
End Else
Begin
P := TPA[I + 1];
C := 0;
End;
If I = Length(TPA) Then
Begin
WriteLn('Choose Option Menu Getting Failed');
Exit;
End;
If FindText(fx, fy, Option, upchars, B.X1, B.Y1, B.X2, B.Y2) Then
Begin
Result := True;
x := B.X1 + 5;
y := fy + 1;
End;
end;
Woo! Thanks Saturn...You're churning functions out!
<3
Originally Posted by Eminem
can you make me a reflection monster finder and item finder i cant seem to make them work...
That's a little bit too simple..
Try reading this tutorial:
http://www.villavu.com/forum/showthread.php?t=36454
It should explain everything you need to know.
There are currently 1 users browsing this thread. (0 members and 1 guests)