SRL Archive - Archive

Inspirations - SRL Member Application


Inspirations

2010-10-12 16:34:41

How Long have You Played Runescape?
3 Year(s)


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?
N/A


What is your general programming knowledge?
I have a basic knowledge of Java


Are you a member of any other communities?
I have an account at RSBot, but I am not active there


Tell us about yourself…
From: Inspirations
Hi, my name is Steven Wright, I am 18 years old (almost 19) in college, with lots of free time. I stumbled upon Villavu after getting back into runescape and found scripting for Simba was quite enjoyable. I am majoring in Political Science and minoring in History, although I wish I could take a computer class or two :/

Um I think that's all there is, feel free to ask me questions I'll try to get on IRC more often again, I haven't been there in a while.



Please show us one (or multiple) of your scripts.
{
My script is "completed" in the sense that it runs and compiles,
however not all fish types have been tested,
neither have I really had the ability to run the script for a long period of time.
I hope to release it to the public in the near future.

Also Credit it due to Blumblebee, I never took any functions specifically but the overall script idea and make I followed.
}

program Al_Kharid;
{$i SRL/SRL.scar}
{$i SRL/SRL/Misc/Debug.scar}

type
TItemInfo = Record
ColorList: TIntegerArray;
BlackCount: Integer;
end;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
CurrentPlayer := 0;
NumberOfPlayers(HowManyPlayers);

with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Strings[0] := 'Trout';
BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal'];
Active := True;
end;
end;

var
GlobalCount: Integer;
GlobalColor: Integer;
GlobalIndex: Integer;

const
{MM Colors}
BorderOutline = 16316401;
CactusColor = 3829071;
KebabSymbol = 2698232;
BankerColor = 195836;

{MS Colors}
RangeColor = 1647797;
BankBoothColor = 3751490;
BankBottomColor = 10932726;

{MI Colors}
BlackColor = 131072;

{MC Colors}
RedText = 128;

procedure SetGlobalColor;
begin
case lowercase(Players[CurrentPlayer].Strings[0]) of
'shrimp':
begin
GlobalColor := 7043476;
GlobalCount := 141;
end;
'sardine':
begin
GlobalColor := 6536803;
GlobalCount := 44;
end;
'herring':
begin
GlobalColor := 11315895;
GlobalCount := 71;
end;
'anchovies':
begin
GlobalColor := 9004904;
GlobalCount := 141;
end;
'trout':
begin
GlobalColor := 11381429;
GlobalCount := 77;
end;
'salmon':
begin
GlobalColor := 5925813;
GlobalCount := 77;
end;
'tuna':
begin
GlobalColor := 11382461;
GlobalCount := 82;
end;
'lobster':
begin
GlobalColor := 1589627;
GlobalCount := 119;
end;
'swordfish':
begin
GlobalColor := 11891117;
GlobalCount := 77;
end;
end;
end;

function FindCactus: TPoint;
var
ATPA: T2DPointArray;
TPA: TPointArray;
t, tolerance: Integer;
begin
t := getsystemtime;
while Length(TPA) <= 0 do
begin
FindColorsTolerance(TPA, CactusColor, MMx1, MMy1, MMx2, MMy2, 8+tolerance);
if getsystemtime-t > 2500 then
Exit;
inc(tolerance);
end;

ATPA := SplitTPAex(TPA, 15, 15);
writeLn('Found '+IntToStr(Length(ATPA))+' instances of cacti');
sortATPAFrom(ATPA, point(MMcx-25, MMy1));
Result := MiddleTPA(ATPA[0]);
end;

function LocateRoom: TBox;
var
TP: TPoint;
tempColor, I: Integer;
begin
TP := FindCactus;
if TP = point(-1, -1) then
Exit;
for I := 0 to 50 do
begin
tempColor := GetColor(TP.x+I, TP.y);
if SimilarColors(tempColor, BorderOutline, 25) then
begin
writeLn('Found Wall at: point('+IntToStr(TP.x+I)+', '+IntToStr(TP.y)+')');
Result.x1 := TP.x+(I+5);
Result.y1 := TP.y+2;
Result.x2 := TP.x+(I+8);
Result.y2 := TP.y+6;
Exit;
end;
end;
WriteLn('Did not find wall. Resorting to different location method');
end;

function WalkToCookingArea: Boolean;
var
TB: TBox;
begin
TB := LocateRoom;
if TB.x1 = 0 then
Exit;
MouseBox(TB.x1+7, TB.y1, TB.x2, TB.y2, 1);
wait(500+Random(250));
if FlagPresent then
begin
Result := True;
Flag;
Exit;
end;
end;

function WalkToBankingArea: Boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
TP: TPoint;
begin
FindColorsTolerance(TPA, BankerColor, MMx1, MMcy, MMcx, MMy2, 8);
if Length(TPA) <= 0 then
Exit;
ATPA := SplitTPAex(TPA, 5, 10);
sortATPAFrom(ATPA, point(611, 139));

TP := MiddleTPA(ATPA[0]);

Mouse(TP.x+5, TP.y, 5, 5, true);
wait(250+random(500));

if FlagPresent then
begin
result := true;
FFlag(15);
while IsMoving do
wait(100+random(250));
Exit;
end;
end;

function FindRange: Boolean;
var
ATPA: T2DPointArray;
TPA: TPointArray;
T, P, TP: TPoint;
I, tol: Integer;
x, y: Integer;
begin
while IsMoving do
wait(250+random(150));

while Length(TPA) <= 0 do
begin
if Tol > 20 then
begin
FindNormalRandoms;
Exit;
end;
FindColorsTolerance(TPA, RangeColor, MSx1, MSy1, MSx2, MSy2, Tol+8);
Tol := Tol+1;
end;
ATPA := SplitTPAEx(TPA, 25, 25);
SortATPAFrom(ATPA, Point(MScx-50, MScy));
T := MiddleTPA(ATPA[0]);
SortATPASize(ATPA, true);
P := MiddleTPA(ATPA[0]);
if T = P then
begin
writeLn('100% Instance Match. Both Points match');
TP := T
end else
begin
writeLn('Did not get a match. Guessing Points...');
TP := P;
end;

MMouse(TP.x, TP.y, 5, 5);
if waitUpText('ang', 500) then
begin
Result := True;
getMousePos(x, y);
Mouse(x, y, 0, 0, random(5) <> 1);
waitOption('aw', 500);
Exit;
end;

for I := 0 to high(ATPA) do
begin
TP := MiddleTPA(ATPA[I]);
MMouse(TP.x, TP.y, 5, 5);
if waitUpText('ang', 500) then
begin
Result := True;
Mouse(x, y, 0, 0, random(5) <> 1);
waitOption('aw', 500);
Exit;
end;
end;
end;

function CollectItemVariables(I: Integer): TItemInfo;
var
TPA: TPointArray;
Slot: TBox;
begin
if ExistsItem(I) then
begin
Slot := InvBox(I);
with Result do
begin
FindColorsTolerance(TPA, 0, Slot.x1, Slot.y1, Slot.x2, Slot.y2, 422);
ColorList := GetColors(TPA);
ClearSameIntegers(ColorList);
SetArrayLength(TPA, 0);
BlackCount := CountColorTolerance(BlackColor, Slot.x1, Slot.y1, Slot.x2,
Slot.y2, 2);
end;
end;
end;

function WatchItem(ItemCompared: TItemInfo): boolean;
var
CurrentItem: TItemInfo;
I, II, saved: Integer;
Percentage: Extended;
Positive, count: Integer;
timer: Integer;
begin
timer := getSystemtime;
repeat
wait(150+random(250));

for I := 28 downto 1 do
begin
if ExistsItem(I) then
begin
CurrentItem := CollectItemVariables(I);
Break;
end;
end;

if Length(ItemCompared.ColorList) = Length(CurrentItem.ColorList) then
continue;

for I := 0 to high(CurrentItem.ColorList) do
begin
for II := 0 to high(ItemCompared.ColorList) do
begin
if CurrentItem.ColorList[I] = ItemCompared.ColorList[II] then
begin
Positive := Positive+1;
break;
end;
end;
end;

Percentage := ((Positive*100)/Length(CurrentItem.ColorList));
Positive := 0;
count := count+1;

if (Length(CurrentItem.ColorList) <> saved) or (count mod 10 = 0) then
begin
ClearDebug;
saved := Length(CurrentItem.ColorList);
writeLn('Old Length | New Length');
writeLn('-----------------------');
writeLn(' '+IntToStr(Length(ItemCompared.ColorList))+padr(' ', 7)+'| '+
IntToStr(Length(CurrentItem.ColorList)));
writeLn('-----------------------');
writeLn('Positive matches = '+IntToStr(Positive));
WriteLn('Colors match '+IntToStr(Round(Percentage))+'%');
end;

if Percentage > 75 then
continue
else
break;

if getsystemtime-timer > 120000+(random(50000)) then
break;

until False;

result := true;
end;

function OpenBankBooth: Boolean;
var
ATPA: T2DPointArray;
TPA: TPointArray;
TP: TPoint;
H, I: Integer;
x, y: Integer;
begin
if BankScreen then
begin
result := true;
Exit;
end;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MScx-25, MMcy, TPA, BankBoothColor, MSx1, MSy1, MSx2, MSy2, 10);
ColorToleranceSpeed(1);

if Length(TPA) <= 0 then
Exit;
ATPA := FloodFillTPA(TPA);
SortATPAFrom(ATPA, point(MScx-15, MScy));
// DebugATPA(ATPA, '');
if High(ATPA) < 3 then
H := High(ATPA)
else
H := 3;

for I := 0 to H do
begin
TP := MiddleTPA(ATPA[I]);

MMouse(TP.x, TP.y, 5, 5);

if waitUpTextMulti(['ooth', 'ank'], 500) then
begin
getMousePos(x, y);
Mouse(x, y, 0, 0, false);
Result := waitOption('ick', 500);
Exit;
end;
end;
end;

function WithdrawBank: Boolean;
var
TPA: TPointArray;
Area: TBox;
I, L, II: Integer;
Index: TIntegerArray;
BlackCount: Integer;
TP: TPoint;
x, y: Integer;
begin
for I := 1 to 25 do
begin
SetArrayLength(TPA, 0);
Area := BankIndexToMSBox(I);
BlackCount := CountColor(BlackColor, Area.x1, Area.y1+5, Area.x2,
Area.y2);
writeLn('Slot['+IntToStr(I)+']: BlackCount = '+IntToStr(BlackCount));
if InRange(BlackCount, GlobalCount-10, GlobalCount+10) then
begin
L := GetArrayLength(Index);
SetArrayLength(Index, L+1);
Index[L] := I;
end;
end;

writeLn('Length Index = '+IntToStr(Length(Index)));
if Length(Index) = 0 then
Exit;

for II := 0 to high(Index) do
begin
if GlobalIndex <> 0 then
if Index[II] <> GlobalIndex then
continue;
Area := BankIndexToMSBox(Index[II]);
FindColorsTolerance(TPA, GlobalColor, Area.x1, Area.y1, Area.x2, Area.y2, 5);
if Length(TPA) > 0 then
begin
TP := BankIndexToMSPoint(Index[II]);
MMouse(TP.x+5, TP.y+10, 5, 5);
getMousePos(x, y);
if waitUpTextMulti(['aw', 'Raw', 'awr'], 500) then
begin
writeLn('Found '+Capitalize(Players[CurrentPlayer].Strings[0])+
' at Bank Index '+IntToStr(Index[II]));
Mouse(x, y, 0, 0, false);
result := WaitOption('All', 500);
if result then
Exit;
end;
end;
end;
end;

function ClickItem: Boolean;
var
I: Integer;
begin
for I := 1 to 28 do
begin
if ExistsItem(I) then
begin
InvMouse(I, 1);
Result := True;
Exit;
end;
end;
end;

function SelectCook: Boolean;
var
Count: Integer;
t: Integer;
begin
t := getsystemtime;
repeat
Count := CountColor(RedText, MCx1, MCy1, MCx2, MCy2);
if InRange(Count, 750, 850) then
begin
Result := True;
Exit;
end;
until getsystemtime-t > 10000;
end;

function CookAll: Boolean;
begin
Mouse(MCcx, MCcy, 15, 15, false);
result := WaitOption('All', 750);
end;

var
t: Integer;
FirstSlot: TItemInfo;

begin
SetUpSRL;
DeclarePlayers;
ActivateClient;
repeat
if not LoggedIn then
LogInPlayer;

SetGlobalColor;
SetAngle(True);
SetRun(True);

repeat

if not OpenBankBooth then
begin
writeLn('Could not open Bank, NextPlayer');
NextPlayer(False);
Break;
end;

t := GetSystemTime;

while GetSystemTime-t < 5000 do
begin
if BankScreen then
Break;
FindNormalRandoms;
Wait(random(500));
end;

Wait(300+Random(250));
Deposit(1, 28, True);

if not WithdrawBank then
begin
writeLn('Failed to withdraw items, NextPlayer');
NextPlayer(False);
Break;
end;

if not WalkToCookingArea then
begin
writeLn('Walking to Cooking Area Failed. NextPlayer');
NextPlayer(False);
Break;
end;

FirstSlot := CollectItemVariables(1);

t := getsystemtime;
if ClickItem then
begin
if not FindRange then
begin
writeLn('Could not find Range, NextPlayer');
NextPlayer(False);
Break;
end;

while not SelectCook do
begin
wait(random(250));
FindNormalRandoms;
if getsystemtime-t > 5000 then
Exit;
end;

CookAll;

WatchItem(FirstSlot);

if not WalkToBankingArea then
begin
writeLn('Could not walk to Bank, NextPlayer');
NextPlayer(False);
break;
end;
end;
until Players[CurrentPlayer].Active = False;

until AllPlayersInactive;
end.

Naike

2010-10-12 17:26:26

Impressed @ Script vs Longevity!

It's a yes.
Keep going mate, nice to see some talent :)

Nava2

2010-10-12 17:36:33

Could you mark what you took from Blumblebee?

Naike

2010-10-12 17:47:07

From: Nava2
Could you mark what you took from Blumblebee?


"I never took any functions specifically but the overall script idea and make I followed."

He just borrowed his idea and used his script as a template.. would be my guess

Cstrike

2010-10-12 17:51:12

How am I supposed to run this? Am I supposed to be in a bank? I tried following your main procedure and got lost since you have no comments anywhere. I'd like to run it and test it :) to see how the main loop functions

Heavenguard

2010-10-12 22:34:55

Wow! you really do know how to use those variables bro. Overall I like the way you controlled those variables, some color more color usage would be nice to see; But wow dude, for your longevity, your certainly an Inspiration to me! You understood this stuff FAST!

Its a Yes from me, you worked hard and learned this stuff. I expect to see some more color things from ya only because Id expect amazing things from your skills. Beautiful job, and well done.

WT-Fakawi

2010-10-13 04:30:38

Within a month? Impressive indeed!

Yah.

Gu3st...

2010-10-13 04:39:34

YEoP!

Bad Boy JH

2010-10-13 07:35:58

The main loop looks a little messy, but everything else is pretty good, and so I will vote yes.

Gu3st...

2010-10-13 08:06:52

function WalkToBankingArea: Boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
TP: TPoint;
begin
FindColorsTolerance(TPA, BankerColor, MMx1, MMcy, MMcx, MMy2, 8);
if Length(TPA) <= 0 then
Exit;
ATPA := SplitTPAex(TPA, 5, 10);
sortATPAFrom(ATPA, point(611, 139));

TP := MiddleTPA(ATPA[0]);

Mouse(TP.x+5, TP.y, 5, 5, true);
wait(250+random(500));

if FlagPresent then
begin
result := true;
FFlag(15);
while IsMoving do
wait(100+random(250));
Exit;
end;
end;
This will only return true when the flag is present. I would change that if I were you :)

Cstrike

2010-10-13 12:01:50

I think I'm going to vote yes… plus other people with much worse scripts than you get in. If they can get in with a majority approval, then I feel you are SRL members by common standard.

WT-Fakawi

2010-10-13 19:21:29

Hold!

There seems to be a falsification issue at stake. Waiting for more input.

Cstrike

2010-10-13 19:44:23

From: WT-Fakawi
Hold!

There seems to be a falsification issue at stake. Waiting for more input.


What's a falsification? I know the definition [or so I thought!] ;) but is that where they take other peoples code without sourcing it?

Bad Boy JH

2010-10-13 23:30:13

hmmm…

just a note, obviously the person last year who always voted no, has stopped or left, but thats a minor tangent. (I looked at my application the other day, where that was just mentioned, and I just saw the count here…).

Bonfield

2010-10-14 04:01:32

Is it someone who was recently banned?

Cstrike

2010-10-14 12:55:53

From: Bonfield
Is it someone who was recently banned?


Only one I can think of was Timer.
Or the person who keeps doing it is gone for a while :)



BTW it's impressive the applicant learned all this in merely a month. Took me a few years to get SRL down (on and off).

Rich

2010-10-14 13:39:43

From: cstrike
BTW it's impressive the applicant learned all this in merely a month. Took me a few years to get SRL down (on and off).
He might not have learned it in a month. That's why the vote is on hold.

Inspirations

2010-10-14 14:57:56

Hey, sorry it took me FOREVER to find this link, I forgot I bookmarked it. I am not Timer or Blumblebee, I just have a lot of free time as of late. I don't post much but I have read a good chunk of the tutorials and peoples scripts, I just don't get to run them because running runescape while my roommate is present would be awfully embarrassing.

My coding experience has been on and off since about grade 10 when I took a basic computers class and we worked with excel and later with VB. I then moved onto a very basic Java class, and from there did some Vis. Comm stuff and other computer classes. At University I can't take any computer classes (or I don't think so) so I went looking for an alternative, and well found this. I hope this is the sort of clears things up, if there is a way to answer stuff better I will try my best.

Cstrike

2010-10-14 15:08:34

From: Inspirations
Hey, sorry it took me FOREVER to find this link, I forgot I bookmarked it. I am not Timer or Blumblebee, I just have a lot of free time as of late. I don't post much but I have read a good chunk of the tutorials and peoples scripts, I just don't get to run them because running runescape while my roommate is present would be awfully embarrassing.

My coding experience has been on and off since about grade 10 when I took a basic computers class and we worked with excel and later with VB. I then moved onto a very basic Java class, and from there did some Vis. Comm stuff and other computer classes. At University I can't take any computer classes (or I don't think so) so I went looking for an alternative, and well found this. I hope this is the sort of clears things up, if there is a way to answer stuff better I will try my best.


From: Nava2
Could you mark what you took from Blumblebee?

^^ :)
If you could comment where that'd be good

Inspirations

2010-10-14 16:27:12

haha whoops sorry oh course I can.

Um what I'll do is breakdown what I took, post both functions etc.

in his IsCooking function


procedure isCooking();
var
I, index: Byte;
pA, pB: tPoint;
tempC: Cardinal;
timer: LongInt;
begin
for i := 28 downto 1 do
begin
if ExistsItem(i) then
begin
Index := I;
break;
end;
end;
if Index = 1 then Exit;
pA := ItemCoords(Index);
pB := ItemCoords(Index-1);
tempC := getColor(pA.x, pA.y);
if tempC = COLOR_MI_OUTLINE then
while tempC = COLOR_MI_OUTLINE do
begin
pA.x := pA.x-1;
tempC := getColor(pA.x, pA.y);
end;
if not tempC = getColor(pA.x, pA.y) then
Exit;
timer := getSystemTime();
while getColor(pA.x, pA.y) = tempC do
begin
if getSystemTime()-timer > randomRange(80000, 120000) then
Exit;
wait(randomRange(500, 750));
findRandoms(randomRange(50, 150));
if clickToContinue() then
begin
writeLn('gained Cooking level');
inc(Players[CurrentPlayer].Integers[lvl_gained]);
inc(Stats_CustomVars[lvl_gained]);
end;
if Random(15) = 1 then SleepAndMoveMouse(randomRange(1000, 6000));
end;
end;

basically he checks the color changes between two inventory spots. My WatchItem function does exactly the same thing, only I broke it down into taking all the colors from the slot and then searching them against a reference slot. Basically gives the same result in probably a more complex, yet precise manner. The whole idea that I used was his, I just implemented it differently.

his ChooseCookAll, ClickInvSlot, and CookOption were all implemented in my script, in some cases simplified, some cases over-done.

his:


function chooseCookAll(): Boolean;
begin
MouseBox(FSx1, FSy1, FSx2, FSy2, 2);
wait(randomRange(250, 350));
result := ChooseOption('All');
end;

function clickInvSlot(): Boolean;
var
TPA: tPointArray;
b: tBox;
begin
gametab(tab_Inv);
if countColorTolerance(COLOR_MI_WHITE, MIx1, MIy1, MIx2, MIy2, 3) > 0 then
begin
result := true;
Exit;
end;
b := InvBox(1);
MouseBox(b.x1, b.y1, b.x2, b.y2, 1);
wait(randomRange(100, 150));
result := FindColorsTolerance(TPA, COLOR_MI_WHITE, b.x1, b.y1, b.x2, b.y2, 3);
end;

function CookOption(): Boolean;
begin
result := CountColor(COLOR_MI_RED, MCx1, MCy1, MCx2, MCy2) > 0;
end;

mine:

function ClickItem: Boolean;
var
I: Integer;
begin
for I := 1 to 28 do
begin
if ExistsItem(I) then
begin
InvMouse(I, 1);
Result := True;
Exit;
end;
end;
end;

function SelectCook: Boolean;
var
Count: Integer;
t: Integer;
begin
t := getsystemtime;
repeat
Count := CountColor(RedText, MCx1, MCy1, MCx2, MCy2);
if InRange(Count, 750, 850) then
begin
Result := True;
Exit;
end;
until getsystemtime-t > 10000;
end;

function CookAll: Boolean;
begin
Mouse(MCcx, MCcy, 15, 15, false);
result := WaitOption('All', 750);
end;

I simply modified his stuff or looked for an easier way around (such as the Mouse instead of MouseBox). I guess you can't really say I used his ClickInvSlot function because it was a necessity to the script and not really a borrowed idea.

ummm My Walking to the bank I changed because it was very similar, instead I used TPA's which mine isn't very accurate but I saw it done somewhere (I think Coh3n did it, or NCDS, or maybe MSI?)

oh and my openbankbooth and his openbankcustom are similar except I changed a few things and used FloodFillTPA, to which I have no idea what that does but judging from DebugATPA it worked really well haha.

his


function openBankCustom(): Boolean;
var
aTPA: t2DPointArray;
TPA: tPointArray;
P: tPoint;
I, H, x, y: Integer;
begin
FindColorsTolerance(TPA, COLOR_MS_BANK, MSx1, MSy1, MSx2, MSy2, 7);
if Length(TPA) <= 0 then
Exit;
sortTPAFrom(TPA, point(MScx-25, MScy));
aTPA := TPAtoATPAEx(TPA, 25, 25);
if high(aTPA) > 3 then
H := 3
else
H := high(aTPA);
for I := 0 to H do
begin
P := MiddleTPA(aTPA[i]);
MMouse(P.x, P.y, 5, 5);
wait(randomRange(150, 250));
if isUpTextMultiCustom(['ooth', 'Booth']) then
begin
getMousePos(x, y);
Mouse(x, y, 0, 0, false);
if not waitOption('uic', 1000) then
continue;
Result := True;
wait(randomRange(100, 150));
Exit;
end;
end;
end;

mine


function OpenBankBooth: Boolean;
var
ATPA: T2DPointArray;
TPA: TPointArray;
TP: TPoint;
H, I: Integer;
x, y: Integer;
begin
if BankScreen then
begin
result := true;
Exit;
end;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MScx-25, MMcy, TPA, BankBoothColor, MSx1, MSy1, MSx2, MSy2, 10);
ColorToleranceSpeed(1);

if Length(TPA) <= 0 then
Exit;
ATPA := FloodFillTPA(TPA);
SortATPAFrom(ATPA, point(MScx-15, MScy));
// DebugATPA(ATPA, '');
if High(ATPA) < 3 then
H := High(ATPA)
else
H := 3;

for I := 0 to H do
begin
TP := MiddleTPA(ATPA[I]);

MMouse(TP.x, TP.y, 5, 5);

if waitUpTextMulti(['ooth', 'ank'], 500) then
begin
getMousePos(x, y);
Mouse(x, y, 0, 0, false);
Result := waitOption('ick', 500);
Exit;
end;
end;
end;

Remember I only said I used idea's, I didn't actually copy anything really. Or atleast I tried not to. I hope that clears things up? (This took me a while so I really hope so :p)

EDIT:

I finally got a chance to really look at all the replys sorry to those who gave me nice comments and feedback and I did not reply. To those that said yes, thank you very much. To those that gave feedback, I appreciate it.

From: Bad Boy JH
The main loop looks a little messy, but everything else is pretty good, and so I will vote yes.


Would you mind giving me tips for my mainloop? I struggled with it a lot. It seems that writing all the functions is fun but the mainloop at the end is a real bitch.

From: Zyt3x
function WalkToBankingArea: Boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
TP: TPoint;
begin
FindColorsTolerance(TPA, BankerColor, MMx1, MMcy, MMcx, MMy2, 8);
if Length(TPA) <= 0 then
Exit;
ATPA := SplitTPAex(TPA, 5, 10);
sortATPAFrom(ATPA, point(611, 139));

TP := MiddleTPA(ATPA[0]);

Mouse(TP.x+5, TP.y, 5, 5, true);
wait(250+random(500));

if FlagPresent then
begin
result := true;
FFlag(15);
while IsMoving do
wait(100+random(250));
Exit;
end;
end;
This will only return true when the flag is present. I would change that if I were you :)


should I just get rid of the If FlagPresent then part? Or have my result be set by something else?

WT-Fakawi

2010-10-14 19:10:53

Here is the script someone found that is supposedly made by Bumblebee posted Sept 27th on Forsaken. It resembles your script to the detail. It is almost a direct copy, no?

program Al_Kharid;
{$i SRL/SRL.scar}
{$i SRL/SRL/Misc/Debug.scar}

type
TItemInfo = Record
ColorList: TIntegerArray;
BlackCount: Integer;
end;

var
GlobalCount: Integer;
GlobalColor: Integer;
GlobalIndex: Integer;

const
{MM Colors}
BorderOutline = 16316401;
CactusColor = 3829071;
KebabSymbol = 2698232;
BankerColor = 195836;

{MS Colors}
RangeColor = 1647797;
BankBoothColor = 3751490;
BankBottomColor = 10932726;

{MI Colors}
BlackColor = 131072;

{MC Colors}
RedText = 128;

procedure SetGlobalColor;
begin
case lowercase(Players[CurrentPlayer].Strings[0]) of
'shrimp' : GlobalColor := 7043476;
'sardine' : GlobalColor := 6536803;
'herring' : GlobalColor := 11315895;
'anchovies': GlobalColor := 9004904;
'trout' : GlobalColor := 11381429;
'salmon' : GlobalColor := 5925813;
'tuna' : GlobalColor := 11382461;
'lobster' : GlobalColor := 1589627;
'swordfish': GlobalColor := 11891117;
end;
end;

function FindCactus: TPoint;
var
ATPA: T2DPointArray;
TPA: TPointArray;
t, tolerance: Integer;
begin
t := getsystemtime;
while Length(TPA) <= 0 do
begin
FindColorsTolerance(TPA, CactusColor, MMx1, MMy1, MMx2, MMy2, 8+tolerance);
if getsystemtime-t > 2500 then
Exit;
inc(tolerance);
end;

ATPA := SplitTPAex(TPA, 15, 15);
writeLn('Found '+IntToStr(Length(ATPA))+' instances of cacti');
sortATPAFrom(ATPA, point(MMcx-25, MMy1));
Result := MiddleTPA(ATPA[0]);
end;

function LocateRoom: TBox;
var
TP: TPoint;
tempColor, I: Integer;
begin
TP := FindCactus;
if TP = point(-1, -1) then
Exit;
for I := 0 to 50 do
begin
tempColor := GetColor(TP.x+I, TP.y);
if SimilarColors(tempColor, BorderOutline, 25) then
begin
writeLn('Found Wall at: point('+IntToStr(TP.x+I)+', '+IntToStr(TP.y)+')');
Result.x1 := TP.x+(I+5);
Result.y1 := TP.y+2;
Result.x2 := TP.x+(I+8);
Result.y2 := TP.y+6;
Exit;
end;
end;
WriteLn('Did not find wall. Resorting to different location method');
end;

function WalkToCookingArea: Boolean;
var
TB: TBox;
begin
TB := LocateRoom;
if TB.x1 = 0 then
Exit;
MouseBox(TB.x1+7, TB.y1, TB.x2, TB.y2, 1);
wait(500+Random(250));
if FlagPresent then
begin
Result := True;
Flag;
Exit;
end;
end;

function WalkToBankingArea: Boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
TP: TPoint;
begin
FindColorsTolerance(TPA, BankerColor, MMx1, MMcy, MMcx, MMy2, 8);
if Length(TPA) <= 0 then
Exit;
ATPA := SplitTPAex(TPA, 5, 10);
sortATPAFrom(ATPA, point(611, 139));

TP := MiddleTPA(ATPA[0]);

Mouse(TP.x+5, TP.y, 5, 5, true);
wait(250+random(500));

if FlagPresent then
begin
result := true;
while IsMoving do
wait(100+random(250));
Exit;
end;
end;

function FindRange: Boolean;
var
ATPA: T2DPointArray;
TPA: TPointArray;
T, P, TP: TPoint;
I, tol: Integer;
x, y: Integer;
begin
while IsMoving do
wait(250+random(150));

while Length(TPA) <= 0 do
begin
if Tol > 20 then
begin
FindNormalRandoms;
Exit;
end;
FindColorsTolerance(TPA, RangeColor, MSx1, MSy1, MSx2, MSy2, Tol+8);
Tol := Tol+1;
end;
ATPA := SplitTPAEx(TPA, 25, 25);
SortATPAFrom(ATPA, Point(MScx-50, MScy));
T := MiddleTPA(ATPA[0]);
SortATPASize(ATPA, true);
P := MiddleTPA(ATPA[0]);
if T = P then
begin
writeLn('100% Instance Match. Both Points match');
TP := T
end else
begin
writeLn('Did not get a match. Guessing Points...');
TP := P;
end;

MMouse(TP.x, TP.y, 5, 5);
if waitUpText('ang', 500) then
begin
Result := True;
getMousePos(x, y);
Mouse(x, y, 0, 0, random(5) <> 1);
waitOption('aw', 500);
Exit;
end;

for I := 0 to high(ATPA) do
begin
TP := MiddleTPA(ATPA[I]);
MMouse(TP.x, TP.y, 5, 5);
if waitUpText('ang', 500) then
begin
Result := True;
Mouse(x, y, 0, 0, random(5) <> 1);
waitOption('aw', 500);
Exit;
end;
end;
end;

function CollectItemVariables(I: Integer): TItemInfo;
var
TPA: TPointArray;
Slot: TBox;
begin
if ExistsItem(I) then
begin
Slot := InvBox(I);
with Result do
begin
FindColorsTolerance(TPA, 0, Slot.x1, Slot.y1, Slot.x2, Slot.y2, 422);
ColorList := GetColors(TPA);
ClearSameIntegers(ColorList);
SetArrayLength(TPA, 0);
BlackCount := CountColorTolerance(BlackColor, Slot.x1, Slot.y1, Slot.x2,
Slot.y2, 2);
end;
end;
end;

function WatchItem(ItemCompared: TItemInfo): boolean;
var
CurrentItem: TItemInfo;
I, II, saved: Integer;
Percentage: Extended;
Positive, count: Integer;
timer: Integer;
begin
timer := getSystemtime;
repeat
wait(150+random(250));

for I := 28 downto 1 do
begin
if ExistsItem(I) then
begin
CurrentItem := CollectItemVariables(I);
Break;
end;
end;

if Length(ItemCompared.ColorList) = Length(CurrentItem.ColorList) then
continue;

for I := 0 to high(CurrentItem.ColorList) do
begin
for II := 0 to high(ItemCompared.ColorList) do
begin
if CurrentItem.ColorList[I] = ItemCompared.ColorList[II] then
begin
Positive := Positive+1;
break;
end;
end;
end;

Percentage := ((Positive*100)/Length(CurrentItem.ColorList));
Positive := 0;
count := count+1;

if (Length(CurrentItem.ColorList) <> saved) or (count mod 10 = 0) then
begin
ClearDebug;
saved := Length(CurrentItem.ColorList);
writeLn('Old Length | New Length');
writeLn('-----------------------');
writeLn(' '+IntToStr(Length(ItemCompared.ColorList))+padr(' ', 7)+'| '+
IntToStr(Length(CurrentItem.ColorList)));
writeLn('-----------------------');
writeLn('Positive matches = '+IntToStr(Positive));
WriteLn('Colors match '+IntToStr(Round(Percentage))+'%');
end;

if Percentage > 75 then
continue
else
break;

if getsystemtime-timer > 120000+(random(50000)) then
break;

until False;

result := true;
end;

function OpenBankBooth: Boolean;
var
ATPA: T2DPointArray;
TPA: TPointArray;
TP: TPoint;
H, I: Integer;
x, y: Integer;
begin
if BankScreen then
begin
result := true;
Exit;
end;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MScx-25, MMcy, TPA, BankBoothColor, MSx1, MSy1, MSx2, MSy2, 10);
ColorToleranceSpeed(1);

if Length(TPA) <= 0 then
Exit;
ATPA := FloodFillTPA(TPA);
SortATPAFrom(ATPA, point(MScx-15, MScy));
// DebugATPA(ATPA, '');
if High(ATPA) < 3 then
H := High(ATPA)
else
H := 3;

for I := 0 to H do
begin
TP := MiddleTPA(ATPA[I]);

MMouse(TP.x, TP.y, 5, 5);

if waitUpTextMulti(['ooth', 'ank'], 500) then
begin
getMousePos(x, y);
Mouse(x, y, 0, 0, false);
Result := waitOption('ick', 500);
Exit;
end;
end;
end;

function WithdrawBank: Boolean;
var
TPA: TPointArray;
Area: TBox;
I, L, II: Integer;
Index: TIntegerArray;
BlackCount: Integer;
TP: TPoint;
x, y: Integer;
begin
for I := 1 to 25 do
begin
SetArrayLength(TPA, 0);
Area := BankIndexToMSBox(I);
BlackCount := CountColor(BlackColor, Area.x1, Area.y1+5, Area.x2,
Area.y2);
writeLn('Slot['+IntToStr(I)+']: BlackCount = '+IntToStr(BlackCount));
if InRange(BlackCount, GlobalCount-10, GlobalCount+10) then
begin
L := GetArrayLength(Index);
SetArrayLength(Index, L+1);
Index[L] := I;
end;
end;

writeLn('Length Index = '+IntToStr(Length(Index)));
if Length(Index) = 0 then
Exit;

for II := 0 to high(Index) do
begin
if GlobalIndex <> 0 then
if Index[II] <> GlobalIndex then
continue;
Area := BankIndexToMSBox(Index[II]);
FindColorsTolerance(TPA, GlobalColor, Area.x1, Area.y1, Area.x2, Area.y2, 5);
if Length(TPA) > 0 then
begin
TP := BankIndexToMSPoint(Index[II]);
MMouse(TP.x+5, TP.y+10, 5, 5);
getMousePos(x, y);
if waitUpTextMulti(['aw', 'Raw', 'awr'], 500) then
begin
writeLn('Found '+Capitalize(Players[CurrentPlayer].Strings[0])+
' at Bank Index '+IntToStr(Index[II]));
Mouse(x, y, 0, 0, false);
result := WaitOption('All', 500);
if result then
Exit;
end;
end;
end;
end;

function ClickItem: Boolean;
var
I: Integer;
begin
for I := 1 to 28 do
begin
if ExistsItem(I) then
begin
InvMouse(I, 1);
Result := True;
Exit;
end;
end;
end;

function SelectCook: Boolean;
var
Count: Integer;
t: Integer;
begin
t := getsystemtime;
repeat
Count := CountColor(RedText, MCx1, MCy1, MCx2, MCy2);
if InRange(Count, 750, 850) then
begin
Result := True;
Exit;
end;
until getsystemtime-t > 10000;
end;

Cstrike

2010-10-14 21:49:55

Excuse page stretch:
For those who wish to compare code side by side without copying FT-Fakawi's post, I took an example and did it for you:

Left = Blumblebee _ _ _ Right = Applicant

:/


On the bright side, at least Blumblebee would get into SRL members 11 to 0 ;)

WT-Fakawi

2010-10-15 07:24:55

Nice try Inspirations, but we don't like fraud (cause that is what it looks like), so your request to join has been denied.

Leaving thread open for you to respond.

Rich

2010-10-15 10:40:28

It's stupid to try. You will always get caught sooner or later. Banzor!

Dervish

2010-10-15 14:28:02

From: Rich
It's stupid to try. You will always get caught sooner or later. Banzor!


You haven't really lost unless you don't try.

Nava2

2010-10-15 15:42:24

{							      <
My script is "completed" in the sense that it runs and compil <
however not all fish types have been tested, <
neither have I really had the ability to run the script for a <
I hope to release it to the public in the near future. <
<
Also Credit it due to Blumblebee, I never took any functions <
} <
<
program Al_Kharid; program Al_Kharid;
{$i SRL/SRL.scar} {$i SRL/SRL.scar}
{$i SRL/SRL/Misc/Debug.scar} {$i SRL/SRL/Misc/Debug.scar}

type type
TItemInfo = Record | TItemInfo = Record
ColorList: TIntegerArray; | ColorList: TIntegerArray;
BlackCount: Integer; | BlackCount: Integer;
end; | end;
<
procedure DeclarePlayers; <
begin <
HowManyPlayers := 1; <
CurrentPlayer := 0; <
NumberOfPlayers(HowManyPlayers); <
<
with Players[0] do <
begin <
Name := ''; <
Pass := ''; <
Nick := ''; <
Strings[0] := 'Trout'; <
BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', ' <
Active := True; <
end; <
end; <

var var
GlobalCount: Integer; | GlobalCount: Integer;
GlobalColor: Integer; | GlobalColor: Integer;
GlobalIndex: Integer; | GlobalIndex: Integer;

const const
{MM Colors} | {MM Colors}
BorderOutline = 16316401; | BorderOutline = 16316401;
CactusColor = 3829071; | CactusColor = 3829071;
KebabSymbol = 2698232; | KebabSymbol = 2698232;
BankerColor = 195836; | BankerColor = 195836;
|
{MS Colors} | {MS Colors}
RangeColor = 1647797; | RangeColor = 1647797;
BankBoothColor = 3751490; | BankBoothColor = 3751490;
BankBottomColor = 10932726; | BankBottomColor = 10932726;

{MI Colors} | {MI Colors}
BlackColor = 131072; | BlackColor = 131072;

{MC Colors} | {MC Colors}
RedText = 128; | RedText = 128;

procedure SetGlobalColor; procedure SetGlobalColor;
begin begin
case lowercase(Players[CurrentPlayer].Strings[0]) of | case lowercase(Players[CurrentPlayer].Strings[0]) of
'shrimp': | 'shrimp' : GlobalColor := 7043476;
begin | 'sardine' : GlobalColor := 6536803;
GlobalColor := 7043476; | 'herring' : GlobalColor := 11315895;
GlobalCount := 141; | 'anchovies': GlobalColor := 9004904;
end; | 'trout' : GlobalColor := 11381429;
'sardine': | 'salmon' : GlobalColor := 5925813;
begin | 'tuna' : GlobalColor := 11382461;
GlobalColor := 6536803; | 'lobster' : GlobalColor := 1589627;
GlobalCount := 44; | 'swordfish': GlobalColor := 11891117;
end; | end;
'herring': <
begin <
GlobalColor := 11315895; <
GlobalCount := 71; <
end; <
'anchovies': <
begin <
GlobalColor := 9004904; <
GlobalCount := 141; <
end; <
'trout': <
begin <
GlobalColor := 11381429; <
GlobalCount := 77; <
end; <
'salmon': <
begin <
GlobalColor := 5925813; <
GlobalCount := 77; <
end; <
'tuna': <
begin <
GlobalColor := 11382461; <
GlobalCount := 82; <
end; <
'lobster': <
begin <
GlobalColor := 1589627; <
GlobalCount := 119; <
end; <
'swordfish': <
begin <
GlobalColor := 11891117; <
GlobalCount := 77; <
end; <
end; <
end; end;

function FindCactus: TPoint; function FindCactus: TPoint;
var var
ATPA: T2DPointArray; | ATPA: T2DPointArray;
TPA: TPointArray; | TPA: TPointArray;
t, tolerance: Integer; | t, tolerance: Integer;
begin | begin
t := getsystemtime; | t := getsystemtime;
while Length(TPA) <= 0 do | while Length(TPA) <= 0 do
begin | begin
FindColorsTolerance(TPA, CactusColor, MMx1, MMy1, MMx2, M | FindColorsTolerance(TPA, CactusColor, MMx1, MMy1, MMx2, MM
if getsystemtime-t > 2500 then | if getsystemtime-t > 2500 then
Exit; | Exit;
inc(tolerance); | inc(tolerance);
end; | end;
|
ATPA := SplitTPAex(TPA, 15, 15); | ATPA := SplitTPAex(TPA, 15, 15);
writeLn('Found '+IntToStr(Length(ATPA))+' instances of cact | writeLn('Found '+IntToStr(Length(ATPA))+' instances of cacti
sortATPAFrom(ATPA, point(MMcx-25, MMy1)); | sortATPAFrom(ATPA, point(MMcx-25, MMy1));
Result := MiddleTPA(ATPA[0]); | Result := MiddleTPA(ATPA[0]);
end; end;

function LocateRoom: TBox; function LocateRoom: TBox;
var var
TP: TPoint; | TP: TPoint;
tempColor, I: Integer; | tempColor, I: Integer;
begin begin
TP := FindCactus; | TP := FindCactus;
if TP = point(-1, -1) then | if TP = point(-1, -1) then
Exit; | Exit;
for I := 0 to 50 do | for I := 0 to 50 do
begin | begin
tempColor := GetColor(TP.x+I, TP.y); | tempColor := GetColor(TP.x+I, TP.y);
if SimilarColors(tempColor, BorderOutline, 25) then | if SimilarColors(tempColor, BorderOutline, 25) then
begin | begin
writeLn('Found Wall at: point('+IntToStr(TP.x+I)+', '+I | writeLn('Found Wall at: point('+IntToStr(TP.x+I)+', '+In
Result.x1 := TP.x+(I+5); | Result.x1 := TP.x+(I+5);
Result.y1 := TP.y+2; | Result.y1 := TP.y+2;
Result.x2 := TP.x+(I+8); | Result.x2 := TP.x+(I+8);
Result.y2 := TP.y+6; | Result.y2 := TP.y+6;
Exit; | Exit;
end; | end;
end; | end;
WriteLn('Did not find wall. Resorting to different location | WriteLn('Did not find wall. Resorting to different location
end; end;

function WalkToCookingArea: Boolean; function WalkToCookingArea: Boolean;
var var
TB: TBox; | TB: TBox;
begin begin
TB := LocateRoom; | TB := LocateRoom;
if TB.x1 = 0 then | if TB.x1 = 0 then
Exit; | Exit;
MouseBox(TB.x1+7, TB.y1, TB.x2, TB.y2, 1); | MouseBox(TB.x1+7, TB.y1, TB.x2, TB.y2, 1);
wait(500+Random(250)); | wait(500+Random(250));
if FlagPresent then | if FlagPresent then
begin | begin
Result := True; | Result := True;
Flag; | Flag;
Exit; | Exit;
end; | end;
end; end;

function WalkToBankingArea: Boolean; function WalkToBankingArea: Boolean;
var var
TPA: TPointArray; | TPA: TPointArray;
ATPA: T2DPointArray; | ATPA: T2DPointArray;
TP: TPoint; | TP: TPoint;
begin | begin
FindColorsTolerance(TPA, BankerColor, MMx1, MMcy, MMcx, MMy | FindColorsTolerance(TPA, BankerColor, MMx1, MMcy, MMcx, MMy2
if Length(TPA) <= 0 then | if Length(TPA) <= 0 then
Exit; | Exit;
ATPA := SplitTPAex(TPA, 5, 10); | ATPA := SplitTPAex(TPA, 5, 10);
sortATPAFrom(ATPA, point(611, 139)); | sortATPAFrom(ATPA, point(611, 139));
|
TP := MiddleTPA(ATPA[0]); | TP := MiddleTPA(ATPA[0]);
|
Mouse(TP.x+5, TP.y, 5, 5, true); | Mouse(TP.x+5, TP.y, 5, 5, true);
wait(250+random(500)); | wait(250+random(500));
|
if FlagPresent then | if FlagPresent then
begin | begin
result := true; | result := true;
FFlag(15); | while IsMoving do
while IsMoving do | wait(100+random(250));
wait(100+random(250)); | Exit;
Exit; | end;
end; <
end; end;

function FindRange: Boolean; function FindRange: Boolean;
var var
ATPA: T2DPointArray; | ATPA: T2DPointArray;
TPA: TPointArray; | TPA: TPointArray;
T, P, TP: TPoint; | T, P, TP: TPoint;
I, tol: Integer; | I, tol: Integer;
x, y: Integer; | x, y: Integer;
begin | begin
while IsMoving do | while IsMoving do
wait(250+random(150)); | wait(250+random(150));
|
while Length(TPA) <= 0 do | while Length(TPA) <= 0 do
begin | begin
if Tol > 20 then | if Tol > 20 then
begin | begin
FindNormalRandoms; | FindNormalRandoms;
Exit; | Exit;
end; | end;
FindColorsTolerance(TPA, RangeColor, MSx1, MSy1, MSx2, MS | FindColorsTolerance(TPA, RangeColor, MSx1, MSy1, MSx2, MSy
Tol := Tol+1; | Tol := Tol+1;
end; | end;
ATPA := SplitTPAEx(TPA, 25, 25); | ATPA := SplitTPAEx(TPA, 25, 25);
SortATPAFrom(ATPA, Point(MScx-50, MScy)); | SortATPAFrom(ATPA, Point(MScx-50, MScy));
T := MiddleTPA(ATPA[0]); | T := MiddleTPA(ATPA[0]);
SortATPASize(ATPA, true); | SortATPASize(ATPA, true);
P := MiddleTPA(ATPA[0]); | P := MiddleTPA(ATPA[0]);
if T = P then | if T = P then
begin | begin
writeLn('100% Instance Match. Both Points match'); | writeLn('100% Instance Match. Both Points match');
TP := T | TP := T
end else | end else
begin | begin
writeLn('Did not get a match. Guessing Points...'); | writeLn('Did not get a match. Guessing Points...');
TP := P; | TP := P;
end; | end;
|
MMouse(TP.x, TP.y, 5, 5); | MMouse(TP.x, TP.y, 5, 5);
if waitUpText('ang', 500) then | if waitUpText('ang', 500) then
begin | begin
Result := True; | Result := True;
getMousePos(x, y); | getMousePos(x, y);
Mouse(x, y, 0, 0, random(5) <> 1); | Mouse(x, y, 0, 0, random(5) <> 1);
waitOption('aw', 500); | waitOption('aw', 500);
Exit; | Exit;
end; | end;
|
for I := 0 to high(ATPA) do | for I := 0 to high(ATPA) do
begin | begin
TP := MiddleTPA(ATPA[I]); | TP := MiddleTPA(ATPA[I]);
MMouse(TP.x, TP.y, 5, 5); | MMouse(TP.x, TP.y, 5, 5);
if waitUpText('ang', 500) then | if waitUpText('ang', 500) then
begin | begin
Result := True; | Result := True;
Mouse(x, y, 0, 0, random(5) <> 1); | Mouse(x, y, 0, 0, random(5) <> 1);
waitOption('aw', 500); | waitOption('aw', 500);
Exit; | Exit;
end; | end;
end; | end;
end; end;

function CollectItemVariables(I: Integer): TItemInfo; function CollectItemVariables(I: Integer): TItemInfo;
var var
TPA: TPointArray; | TPA: TPointArray;
Slot: TBox; | Slot: TBox;
begin begin
if ExistsItem(I) then | if ExistsItem(I) then
begin | begin
Slot := InvBox(I); | Slot := InvBox(I);
with Result do | with Result do
begin | begin
FindColorsTolerance(TPA, 0, Slot.x1, Slot.y1, Slot.x2, | FindColorsTolerance(TPA, 0, Slot.x1, Slot.y1, Slot.x2, S
ColorList := GetColors(TPA); | ColorList := GetColors(TPA);
ClearSameIntegers(ColorList); | ClearSameIntegers(ColorList);
SetArrayLength(TPA, 0); | SetArrayLength(TPA, 0);
BlackCount := CountColorTolerance(BlackColor, Slot.x1, | BlackCount := CountColorTolerance(BlackColor, Slot.x1, S
Slot.y2, 2); | Slot.y2, 2);
end; | end;
end; | end;
end; end;

function WatchItem(ItemCompared: TItemInfo): boolean; function WatchItem(ItemCompared: TItemInfo): boolean;
var var
CurrentItem: TItemInfo; | CurrentItem: TItemInfo;
I, II, saved: Integer; | I, II, saved: Integer;
Percentage: Extended; | Percentage: Extended;
Positive, count: Integer; | Positive, count: Integer;
timer: Integer; | timer: Integer;
begin | begin
timer := getSystemtime; | timer := getSystemtime;
repeat | repeat
wait(150+random(250)); | wait(150+random(250));
|
for I := 28 downto 1 do | for I := 28 downto 1 do
begin | begin
if ExistsItem(I) then | if ExistsItem(I) then
begin | begin
CurrentItem := CollectItemVariables(I); | CurrentItem := CollectItemVariables(I);
Break; | Break;
end; | end;
end; | end;
|
if Length(ItemCompared.ColorList) = Length(CurrentItem.Co | if Length(ItemCompared.ColorList) = Length(CurrentItem.Col
continue; | continue;
|
for I := 0 to high(CurrentItem.ColorList) do | for I := 0 to high(CurrentItem.ColorList) do
begin | begin
for II := 0 to high(ItemCompared.ColorList) do | for II := 0 to high(ItemCompared.ColorList) do
begin | begin
if CurrentItem.ColorList[I] = ItemCompared.ColorList[ | if CurrentItem.ColorList[I] = ItemCompared.ColorList[I
begin | begin
Positive := Positive+1; | Positive := Positive+1;
break; | break;
end; | end;
end; | end;
end; | end;
|
Percentage := ((Positive*100)/Length(CurrentItem.ColorLis | Percentage := ((Positive*100)/Length(CurrentItem.ColorList
Positive := 0; | Positive := 0;
count := count+1; | count := count+1;
|
if (Length(CurrentItem.ColorList) <> saved) or (count mod | if (Length(CurrentItem.ColorList) <> saved) or (count mod
begin | begin
ClearDebug; | ClearDebug;
saved := Length(CurrentItem.ColorList); | saved := Length(CurrentItem.ColorList);
writeLn('Old Length | New Length'); | writeLn('Old Length | New Length');
writeLn('-----------------------'); | writeLn('-----------------------');
writeLn(' '+IntToStr(Length(ItemCompared.ColorList))+p | writeLn(' '+IntToStr(Length(ItemCompared.ColorList))+pa
IntToStr(Length(CurrentItem.ColorList))); | IntToStr(Length(CurrentItem.ColorList)));
writeLn('-----------------------'); | writeLn('-----------------------');
writeLn('Positive matches = '+IntToStr(Positive)); | writeLn('Positive matches = '+IntToStr(Positive));
WriteLn('Colors match '+IntToStr(Round(Percentage))+'%' | WriteLn('Colors match '+IntToStr(Round(Percentage))+'%')
end; | end;
|
if Percentage > 75 then | if Percentage > 75 then
continue | continue
else | else
break; | break;

if getsystemtime-timer > 120000+(random(50000)) then | if getsystemtime-timer > 120000+(random(50000)) then
break; | break;

until False; | until False;

result := true; | result := true;
end; end;

function OpenBankBooth: Boolean; function OpenBankBooth: Boolean;
var var
ATPA: T2DPointArray; | ATPA: T2DPointArray;
TPA: TPointArray; | TPA: TPointArray;
TP: TPoint; | TP: TPoint;
H, I: Integer; | H, I: Integer;
x, y: Integer; | x, y: Integer;
begin | begin
if BankScreen then | if BankScreen then
begin | begin
result := true; | result := true;
Exit; | Exit;
end; | end;
ColorToleranceSpeed(2); | ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MScx-25, MMcy, TPA, BankBoothColo | FindColorsSpiralTolerance(MScx-25, MMcy, TPA, BankBoothColor
ColorToleranceSpeed(1); | ColorToleranceSpeed(1);
|
if Length(TPA) <= 0 then | if Length(TPA) <= 0 then
Exit; | Exit;
ATPA := FloodFillTPA(TPA); | ATPA := FloodFillTPA(TPA);
SortATPAFrom(ATPA, point(MScx-15, MScy)); | SortATPAFrom(ATPA, point(MScx-15, MScy));
// DebugATPA(ATPA, ''); | // DebugATPA(ATPA, '');
if High(ATPA) < 3 then | if High(ATPA) < 3 then
H := High(ATPA) | H := High(ATPA)
else | else
H := 3; | H := 3;
|
for I := 0 to H do | for I := 0 to H do
begin | begin
TP := MiddleTPA(ATPA[I]); | TP := MiddleTPA(ATPA[I]);
|
MMouse(TP.x, TP.y, 5, 5); | MMouse(TP.x, TP.y, 5, 5);
|
if waitUpTextMulti(['ooth', 'ank'], 500) then | if waitUpTextMulti(['ooth', 'ank'], 500) then
begin | begin
getMousePos(x, y); | getMousePos(x, y);
Mouse(x, y, 0, 0, false); | Mouse(x, y, 0, 0, false);
Result := waitOption('ick', 500); | Result := waitOption('ick', 500);
Exit; | Exit;
end; | end;
end; | end;
end; end;

function WithdrawBank: Boolean; function WithdrawBank: Boolean;
var var
TPA: TPointArray; | TPA: TPointArray;
Area: TBox; | Area: TBox;
I, L, II: Integer; | I, L, II: Integer;
Index: TIntegerArray; | Index: TIntegerArray;
BlackCount: Integer; | BlackCount: Integer;
TP: TPoint; | TP: TPoint;
x, y: Integer; | x, y: Integer;
begin | begin
for I := 1 to 25 do | for I := 1 to 25 do
begin | begin
SetArrayLength(TPA, 0); | SetArrayLength(TPA, 0);
Area := BankIndexToMSBox(I); | Area := BankIndexToMSBox(I);
BlackCount := CountColor(BlackColor, Area.x1, Area.y1+5, | BlackCount := CountColor(BlackColor, Area.x1, Area.y1+5, A
Area.y2); | Area.y2);
writeLn('Slot['+IntToStr(I)+']: BlackCount = '+IntToStr(B | writeLn('Slot['+IntToStr(I)+']: BlackCount = '+IntToStr(Bl
if InRange(BlackCount, GlobalCount-10, GlobalCount+10) th | if InRange(BlackCount, GlobalCount-10, GlobalCount+10) the
begin | begin
L := GetArrayLength(Index); | L := GetArrayLength(Index);
SetArrayLength(Index, L+1); | SetArrayLength(Index, L+1);
Index[L] := I; | Index[L] := I;
end; | end;
end; | end;
|
writeLn('Length Index = '+IntToStr(Length(Index))); | writeLn('Length Index = '+IntToStr(Length(Index)));
if Length(Index) = 0 then | if Length(Index) = 0 then
Exit; | Exit;
|
for II := 0 to high(Index) do | for II := 0 to high(Index) do
begin | begin
if GlobalIndex <> 0 then | if GlobalIndex <> 0 then
if Index[II] <> GlobalIndex then | if Index[II] <> GlobalIndex then
continue; | continue;
Area := BankIndexToMSBox(Index[II]); | Area := BankIndexToMSBox(Index[II]);
FindColorsTolerance(TPA, GlobalColor, Area.x1, Area.y1, A | FindColorsTolerance(TPA, GlobalColor, Area.x1, Area.y1, Ar
if Length(TPA) > 0 then | if Length(TPA) > 0 then
begin | begin
TP := BankIndexToMSPoint(Index[II]); | TP := BankIndexToMSPoint(Index[II]);
MMouse(TP.x+5, TP.y+10, 5, 5); | MMouse(TP.x+5, TP.y+10, 5, 5);
getMousePos(x, y); | getMousePos(x, y);
if waitUpTextMulti(['aw', 'Raw', 'awr'], 500) then | if waitUpTextMulti(['aw', 'Raw', 'awr'], 500) then
begin | begin
writeLn('Found '+Capitalize(Players[CurrentPlayer].St | writeLn('Found '+Capitalize(Players[CurrentPlayer].Str
' at Bank Index '+IntToStr(Index[II])); | ' at Bank Index '+IntToStr(Index[II]));
Mouse(x, y, 0, 0, false); | Mouse(x, y, 0, 0, false);
result := WaitOption('All', 500); | result := WaitOption('All', 500);
if result then | if result then
Exit; | Exit;
end; | end;
end; | end;
end; | end;
end; end;

function ClickItem: Boolean; function ClickItem: Boolean;
var var
I: Integer; | I: Integer;
begin begin
for I := 1 to 28 do | for I := 1 to 28 do
begin | begin
if ExistsItem(I) then | if ExistsItem(I) then
begin | begin
InvMouse(I, 1); | InvMouse(I, 1);
Result := True; | Result := True;
Exit; | Exit;
end; | end;
end; | end;
end; end;

function SelectCook: Boolean; function SelectCook: Boolean;
var var
Count: Integer; | Count: Integer;
t: Integer; | t: Integer;
begin begin
t := getsystemtime; | t := getsystemtime;
repeat | repeat
Count := CountColor(RedText, MCx1, MCy1, MCx2, MCy2); | Count := CountColor(RedText, MCx1, MCy1, MCx2, MCy2);
if InRange(Count, 750, 850) then | if InRange(Count, 750, 850) then
begin | begin
Result := True; | Result := True;
Exit; | Exit;
end; | end;
until getsystemtime-t > 10000; | until getsystemtime-t > 10000;
end; | end;
<
function CookAll: Boolean; <
begin <
Mouse(MCcx, MCcy, 15, 15, false); <
result := WaitOption('All', 750); <
end; <
<
var <
t: Integer; <
FirstSlot: TItemInfo; <
<
begin <
SetUpSRL; <
DeclarePlayers; <
ActivateClient; <
repeat <
if not LoggedIn then <
LogInPlayer; <
<
SetGlobalColor; <
SetAngle(True); <
SetRun(True); <
<
repeat <
<
if not OpenBankBooth then <
begin <
writeLn('Could not open Bank, NextPlayer'); <
NextPlayer(False); <
Break; <
end; <
<
t := GetSystemTime; <
<
while GetSystemTime-t < 5000 do <
begin <
if BankScreen then <
Break; <
FindNormalRandoms; <
Wait(random(500)); <
end; <
<
Wait(300+Random(250)); <
Deposit(1, 28, True); <
<
if not WithdrawBank then <
begin <
writeLn('Failed to withdraw items, NextPlayer'); <
NextPlayer(False); <
Break; <
end; <
<
if not WalkToCookingArea then <
begin <
writeLn('Walking to Cooking Area Failed. NextPlayer') <
NextPlayer(False); <
Break; <
end; <
<
FirstSlot := CollectItemVariables(1); <
<
t := getsystemtime; <
if ClickItem then <
begin <
if not FindRange then <
begin <
writeLn('Could not find Range, NextPlayer'); <
NextPlayer(False); <
Break; <
end; <
<
while not SelectCook do <
begin <
wait(random(250)); <
FindNormalRandoms; <
if getsystemtime-t > 5000 then <
Exit; <
end; <
<
CookAll; <
<
WatchItem(FirstSlot); <
<
if not WalkToBankingArea then <
begin <
writeLn('Could not walk to Bank, NextPlayer'); <
NextPlayer(False); <
break; <
end; <
end; <
until Players[CurrentPlayer].Active = False; <
<
until AllPlayersInactive; <
end. <

Enjoy!

$ diff -y /tmp/tmp-diff /tmp/tmp-diff2 > /tmp/diff-out.patch
for those wondering

Rich

2010-10-15 16:58:08

From: Dervish
You haven't really lost unless you don't try.
So you're saying that you don't mind him trying? Did you apply with someone else's script?

Heavenguard

2010-10-15 19:26:10

What a disappointment… to think you would have devoted so much time into actually learning this. You were really an inspiration to me not too long ago, now your just a copier who does not even know the basics to this code. Ah well, guess its hard for someone to really even learn so much in a month; Can't say I didn't expect us to find this out.

I expect to hear some sort of response from you, Inspirations. Please tell us everything you can.

TomTuff

2010-10-16 00:03:08

village clown trophy? anyone agree?

Rich

2010-10-16 06:09:49

^ Nope. Just ban him.

Bad Boy JH

2010-10-16 09:07:15

A ban seems harsh, I think the appropriate punishment is a 'trophy of shame' and banned from applying for SRL Members for a certain period.

Rich

2010-10-16 09:37:39

^ Perhaps, but I think I read somewhere that plagiarism = ban. If not a ban, then never allowing him to apply to Members again, and the Village Clown 'cup'.

WT-Fakawi

2010-10-16 09:49:23

His shame is growing by the post. Since he isn't inclined to answer, I will close the thread and hope to hear from inspirations through some other channel.