n3ss3s
2009-02-13 07:09:50
We are going to have loads of these topics before it's gonna have any effects, but please! When you vote you don't have to hurry anywhere, don't give a quick skim over it and vote depending on whether it looks good or not, just don't vote if you don't feel like looking at it well.
Today's example! Antti Mies. Note that this thread is not intended to harm the applicant in any way, just make the voters sad - let's have some highlights of the poll, shall we? :)
Here is his script, doesn't matter if you look at it yet. Now some quotes from our voters -
Now to the facts that we've all waited for :)
a) The script doesn't use multiplayer, I actually lived when that was one of the requirements and one of the main concepts of SRL.
b) The only place the script uses If Not LoggedIn Then Exit or something similar are it's antiban procedures! Sure, it's stupid to do antiban while logged out, but how about trying to enter the boat when you're logged out?
c)
d)
Enjoy.
Today's example! Antti Mies. Note that this thread is not intended to harm the applicant in any way, just make the voters sad - let's have some highlights of the poll, shall we? :)
program PestControl;
// By antti mies
// :)
{.Include SRL\SRL\Misc\Smart.Scar}
{.include SRL/SRL.scar}
var
x, y, I, II, Deathss, Trips, Slept, SleepTime, SleepTimeX, Wins, Loses, Zeal: Integer;
First: Boolean;
Const
//------------------------SETUP------------------------------\\
Username = ''; //rs username
PassWord = ''; //rs password
CombatStyle = 'melee'; //combat style: melee/ranged/magick
SpendPointsOn = 'str'; //strength/attack/defence/hitpoints
//magic/ranged/prayer/dontspend
//-----------------------------------------------------------\\
procedure InBoatAntiBan;
begin
If(not LoggedIn)then Exit;
MouseSpeed := 12 + Random(3);
Case Random(10) of
0: MMouse(Random(MIX2), Random(MIY2), 10, 10);
1: HoverSkill('random', False);
2: PickUpMouse;
3: GameTab(1+Random(12));
4: SleepAndMoveMouse(400+Random(2200));
5: IdleTime(500+random(700), 600, 0.5+rand);
6: DoEmote(1+random(19));
7:
begin
Mouse(Random(MIX2), Random(MIY2), 0, 0, False);
if not ChooseOption('xamine') then
ChooseOption('ancel');
end;
8:
begin
MakeCompass(IntToStr(Random(360)));
MakeCompass('S');
end;
9:
case random(50) of
0: Typesend('cm0n');
1: Typesend('lol');
2: Typesend('1 more');
3: Typesend('plz');
4: Typesend('hurry');
5: Typesend('all on portals');
6: Typesend('someone stay in center');
7: Typesend('im getting full void');
8: Typesend('everyone in');
9: Typesend('all come in');
10: Typesend('XD');
end;
end;
Wait(500+random(500));
Gametab(4);
end;
procedure InGameAntiBan;
begin
If(not LoggedIn)then Exit;
MouseSpeed := 12 + Random(3);
Case Random(13) of
0: MMouse(Random(MIX2), Random(MIY2), 10, 10);
1: if Random(2) = 1 then HoverSkill('random', False);
2: PickUpMouse;
3: GameTab(1+Random(12));
4,5:SleepAndMoveMouse(400+Random(2200));
6: IdleTime(500+random(700), 600, 0.5+rand);
7,8:MMouse(Random(MSX2), Random(MSY2), 0, 0);
9: if Random(2) = 1 then RandomRClick;
10: MakeCompass(IntToStr(Random(360)));
11:
begin
if Random(2) = 1 then
begin
KeyDown(VK_LEFT);
if Random(2) = 1 then Wait(400+random(2500))
else SleepAndMoveMouse(400+random(2500));
KeyUp(VK_LEFT);
end else
begin
KeyDown(VK_RIGHT);
if Random(2) = 1 then Wait(400+random(2500))
else SleepAndMoveMouse(400+random(2500));
KeyUp(VK_RIGHT);
end;
end;
12:
begin
I := 500+random(800);
KeyDown(VK_DOWN);
if Random(2) = 1 then Wait(I)
else SleepAndMoveMouse(I);
KeyUp(VK_DOWN);
Wait(100+random(300));
KeyDown(VK_UP);
if Random(2) = 1 then Wait(I+random(400))
else SleepAndMoveMouse(I+random(400));
KeyUp(VK_UP);
end;
end;
Wait(200+random(500));
Gametab(4);
end;
procedure Terminate(Text: String);
begin
WriteLn(Text);
LogOut;
TerminateScript;
end;
Procedure LogIn;//Partly from SRL. Doesn't stop when the world is full.
begin
if (not(GraphicsSet)) then
begin
SetAutoingDefaults;
GraphicsSet := True;
end;
if LoggedIn then Exit;
Mouse(360, 180, 30, 7, True);
Mouse(313, 270, 30, 7, True);
TypeSend(Players[CurrentPlayer].Name);
TypeSend(Players[CurrentPlayer].Pass);
I := 0;
Wait(6000+random(1500));
if (not GetColor(420, 234) = 0) and (not GetColor(370, 231) = 0) and
(not GetColor(527, 182) = 15461355) then
Terminate('Failed to Log In');
repeat
Wait(3000);
Inc(I);
if LoggedIn then Break;
if I > 20 then Terminate('Failed to Log In');
if Random(3) = 1 then PickUpMouse;
if (GetColor(420, 234) = 0) and (GetColor(370, 231) = 0) then TypeSend('');
until(GetColor(527, 182) = 15461355);
Wait(1000+random(1000));
Mouse(210, 330, 345, 40, True);
Wait(4000+random(2000));
end;
procedure TakeBreak;
begin
Status('Sleeping');
LogOut;
Inc(Slept);
I := 300000+random(900000);//sleeptime
WriteLn('Sleeping for ' + IntToStr(I/60000) + 'minutes');
Wait(I/2);
WriteLn(IntToStr(I/2/60000) + ' minutes left');
Wait(I/2);
LogIn;
SetAngle(True);
SetRun(True);
MarkTime(SleepTime);
SleepTimeX := 3000000 + Random(6000000);
end;
procedure DeclarePlayers;
begin
HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := Username;
Players[0].Pass := Password;
Players[0].Nick := 'aaa';
Players[0].Active := True;
end;
Procedure Pray;
var
S: String;
PrayLvl: Integer;
Coords: Array of TPoint;
begin
GameTab(6);
PrayLvl := GetMMLevels('pray', S);
Coords := [IntToPoint(0, 0)];
case Lowercase(CombatStyle) of
'melee':
begin
if PrayLvl > 3 then Coords := [IntToPoint(590, 220)];
if PrayLvl > 6 then Coords := [IntToPoint(590, 220), IntToPoint(630, 220)];
if PrayLvl > 12 then Coords := [IntToPoint(630, 220), IntToPoint(590, 255)];
if PrayLvl > 15 then Coords := [IntToPoint(590, 255), IntToPoint(630, 255)];
if PrayLvl > 30 then Coords := [IntToPoint(630, 255), IntToPoint(705, 295)];
if PrayLvl > 33 then Coords := [IntToPoint(705, 295), IntToPoint(555, 330)];
end;
'ranged', 'range':
begin
if PrayLvl > 7 then Coords := [IntToPoint(665, 220)];
if PrayLvl > 25 then Coords := [IntToPoint(590, 290)];
if PrayLvl > 43 then Coords := [IntToPoint(555, 370)];
end;
'magic', 'mage':
begin
if PrayLvl > 8 then Coords := [IntToPoint(705, 220)];
if PrayLvl > 26 then Coords := [IntToPoint(630, 295)];
if PrayLvl > 44 then Coords := [IntToPoint(590, 370)];
end;
end;
If Coords[0].X = 0 then Exit;
for I := 0 to High(Coords) do
Mouse(Coords[i].x, Coords[i].y, 25, 20, True);
Wait(Random(600));
GameTab(4);
end;
function InGame: Boolean;
begin
if FindColor(x, y, 16711935, 368, 74, 370, 76) then
Result := True;
end;
function InBoat: Boolean;
begin
if FindColor(x, y, 16777113, 47, 83, 49, 85) then
Result := True;
end;
procedure GoInBoat;
var
P: TPointArray;
T2D: T2DPointArray;
begin
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.04, 0.18);
FindColorsSpiralTolerance(MMCX, MMCY, P, 3627893, MSX1, MSY1, MSX2, MSY2, 9);
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);
if Length(P) < 10 then Exit;
T2D := TPAtoATPAEx(P, 30, 30);
SetLength(P, 0);
for I := 0 to Length(T2D) - 1 do
begin
if Length(T2D[i]) > 8 then
begin
MiddleTPAEx(T2D[i], x, y);
MMouse(x-2, y-2, 5, 5);
Wait(150+random(60));
if IsUpTextMultiCustom(['ross', 'angp', 'lank']) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Wait(200+random(400));
if not First then Mouse(x-1, y-1, 3, 3, True);
Wait(1000+random(600));
if InBoat or InGame then Exit;
Mouse(x-1, y-1, 3, 3, True);
Wait(2200);
I := 0;
Exit;
end;
end;
end;
I := 0;
end;
function CenterColor: Integer;
var
P: TPointArray;
C: TIntegerArray;
begin
FindColorsSpiralTolerance(MMCX, MMCY, P, 2057081, MMX1, MMY1, MMX2, MMY2, 38);
C := GetColors(P);
ClearSameIntegers(C);
for I := 0 to Length(C)-1 do
if FindColoredAreaTolerance(x, y, C[i], MMX1, MMY1, MMX2, MMY2, 280, 0) then
begin
Result := C[i];
Exit;
end;
end;
function CenterMidlePoint: TPoint;
var
P: TPointArray;
begin
Result := IntToPoint(0, 0);
FindColorsTolerance(P, CenterColor, MMX1, MMY1, MMX2, MMY2, 0);
Result := MiddleTPA(P);
SetLength(P, 0);
if Distance(627, 85, Result.X, Result.Y) < 13 then
Result := IntToPoint(0, 0);
end;
procedure WalkCenter(Start: Boolean);
var
a, b: Integer;
P: TPoint;
begin
P := CenterMidlePoint;
if P.x = 0 then Exit;
if Start then
begin
Mouse(P.x-3, P.y-3, 7, 3, True);
Wait(100+random(1100));
Pray;
Flag;
Exit;
end;
MMouse(P.x-4, P.y-4, 9, 9);
GetMousePos(a, b);
If not InGame then Exit;
Mouse(a, b, 0, 0, True);
Wait(700);
Flag;
end;
procedure WaitForGameStart;
begin
MakeCompass('S');
if InGame then Exit;
repeat
if Random(20) = 1 then InBoatAntiBan;
Wait(200+Random(200));
until(InGame);
end;
function Dead: Boolean;
begin
if not FindBlackChatMessage('dear') then Exit;
if FindColor(x, y, FindWaterColor, MMCX-10, MMCY-10, MMCX+10, MMCY+10) then
begin
Result := True;
Inc(Deathss);
end;
end;
procedure Attack;
var
R, G, P: TPointArray;
T2D: T2DPointArray;
begin
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.05, 0.43);
FindColorsSpiralTolerance(MMCX, MMCY, R, 1646435, MSX1, MSY1, MSX2, MSY2, 3);
SetColorspeed2Modifiers(0.06, 0.40);
FindColorsSpiralTolerance(MMCX, MMCY, G, 2900504, MSX1, MSY1, MSX2, MSY2, 5);
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);
P := CombineTPA(R, G);
SetLength(R, 0);
SetLength(G, 0);
if Length(P) < 7 then Exit;
T2D := TPAtoATPAEx(P, 30, 30);
SetLength(P, 0);
for I := 0 to Length(T2D) - 1 do
begin
if Length(T2D[i]) > 5 then
begin
MiddleTPAEx(T2D[i], x, y);
MMouse(x-2, y-2, 5, 5);
Wait(100+random(40));
if IsUpTextMultiCustom(['Atta', 'ck Sh', 'ifter']) then
begin
GetMousePos(x, y);
if Random(13) = 1 then
begin
Mouse(x, y, 0, 0, False);
if not ChooseOption('ttack') then ChooseOption('ancel');
Wait(1800+random(2300));
Exit;
end;
Mouse(x, y, 0, 0, True);
Wait(1800+random(2300));
Exit;
end;
end;
end;
Wait(1200+random(600));
end;
procedure Proggy;
begin
WriteLn('------------------------');
WriteLn('Worked for: ' + TimeRunning);
WriteLn('We slept: ' + IntToStr(Slept) + ' times');
WriteLn('We did: ' + IntToStr(Trips) + ' trips');
WriteLn('-We won: ' + IntToStr(Wins) + ' games');
WriteLn('-We lost: ' + IntToStr(Loses) + ' games');
WriteLn('-Not enough zeal: ' + IntToStr(Zeal) + ' times');
WriteLn('-We died: ' + IntToStr(Deathss) + ' times');
WriteLn('------------------------');
WriteLn('Please post this proggy to my thread: http://www.villavu.com/forum/showthread.php?t=41269');
end;
procedure ChooseWorld144;
begin
Mouse(369, 244, 7, 4, True);
Wait(1300);
Mouse(101, 121, 4, 4, True);
Wait(1300);
Mouse(646, 121, 4, 4, True);
Wait(4000);
if FindText(x, y, '144', SmallChars, 95, 145, 170, 450) then Mouse(x, y+4, 50, 3, true);
Wait(1300);
end;
procedure WalkVoid;
begin
SymbolAccuracy := 0.6;
WriteLn('We have 250 points... going to spend some points');
MakeCompass('N');
If FindSymbol(x, y, 'magic shop') then Mouse(x+22, y+10, 4, 4, True);
Wait(3000+random(600));
Flag;
Wait(1000+random(600));
end;
procedure WalkPc;
begin
MakeCompass('S');
Mouse(630, 12, 4, 3, True);
Wait(3000+random(600));
Flag;
Wait(3000+random(600));
I := 0;
end;
function TalkVoid: Boolean;
var
P: TPointArray;
T2D: T2DPointArray;
begin
Result := False;
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(1.67, 0.29);
FindColorsSpiralTolerance(MMCX, MMCY, P, 3684669, MSX1, MSY1, MSX2, MSY2, 2);
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);
T2D := TPAtoATPAEx(P, 20, 20);
SetLength(P, 0);
for II := 0 to Length(T2D) - 1 do
begin
if Length(T2D[i]) > 4 then
begin
MiddleTPAEx(T2D[II], x, y);
MMouse(x-1, y-1, 3, 3);
Wait(130+random(50));
if IsUpTextMultiCustom(['Void', 'Knight']) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
Wait(400+random(200));
ChooseOption('xcha');
Wait(1000+random(600));
Flag;
Wait(2000+random(600));
Result := True;
Case Lowercase(SpendPointsOn) of
'attack','att','atk': Mouse(190, 67, 30, 6, True);
'defence','def': Mouse(190, 104, 30, 6, True);
'magic','mage': Mouse(190, 143, 30, 6, True);
'prayer','pray': Mouse(190, 181, 30, 6, True);
'strength','str': Mouse(407, 67, 30, 6, True);
'ranged','range': Mouse(407, 104, 30, 6, True);
'hitpoints','hp': Mouse(407, 113, 30, 6, True);
end;
Wait(1000+random(600));
Mouse(190, 290, 100, 30, True);
Wait(1000+random(600));
Exit;
end;
end;
end;
end;
procedure SpendPoints;
begin
If Lowercase(SpendPointsOn) = 'dontspend' then
Terminate('We have gotten 250 points...Stopping script');
WalkVoid;
I := 0;
repeat
Wait(3000+random(1000));
if I > 4 then Terminate('Failed spending the points');
Inc(I);
Until(TalkVoid);
WalkPc;
end;
procedure GetInBoat;
begin
II := 0;
repeat
Case II of
0: GoInBoat;
1,2:
begin
MakeCompass('S');
GoInBoat;
end;
3:
begin
SymbolAccuracy := 0.5;
If FindSymbol(x, y, 'minigame') then Mouse(x+10, y-20, 5, 5, True);
Flag;
Wait(1000+random(700));
GoInBoat;
end;
4: GoInBoat;
5: Terminate('Could not find boat');
end;
Wait(1000+random(500));
Inc(II);
if FindNPCChatText('already have', Nothing) then SpendPoints;
until(InBoat) or (InGame);
end;
Procedure WinOrLose;
begin
II := 0;
if First then Exit;
repeat
Inc(II);
Wait(100);
until FindNPCChatText('oi', Nothing) or (II > 50);
if FindNPCChatText('portals', Nothing) then Inc(Wins);
if FindNPCChatText('was killed', Nothing) then Inc(Loses);
if FindNPCChatText('noticed', Nothing) then Inc(Zeal);
end;
procedure ScriptTerminate;
begin
Proggy;
end;
procedure StartThings;
begin
First := True;
SetupSrl;
DeclarePlayers;
MouseSpeed := 12 + Random(3);
SmartSetupEx(144, True, True, False);
Wait(5000);
SetTargetDC(SmartGetDC);
repeat
Wait(300);
until(RSReady);
Wait(1000);
repeat
MMouse(369, 244, 7, 4);
GetMousePos(x, y);
until(X > 367);
SleepTimeX := 3000000 + Random(6000000);
MarkTime(SleepTime);
end;
procedure MainLoop;
begin
repeat
if TimeFromMark(SleepTime) > SleepTimeX then TakeBreak;
Status('Outside the boat');
WinOrLose;
GetInBoat;
Status('In the boat');
WaitForGameStart;
Status('In game');
WalkCenter(True);
if First then First := False;
repeat
WalkCenter(False);
if Dead then WalkCenter(True);
Attack;
if Random(8) = 1 then InGameAntiBan;
Wait(120);
until not InGame;
Inc(Trips);
until(False);
end;
begin
StartThings;
if not LoggedIn then
begin
ChooseWorld144;
LogIn;
end;
Retaliate(True);
SetRun(True);
SetAngle(True);
ClickToContinue;
MainLoop;
end.
Here is his script, doesn't matter if you look at it yet. Now some quotes from our voters -
I voted yes. He seems to know what he is doing
Nothing else, could be changed or altered this is the App of the month! This script is actually at a standard of an expert scripter. YES!
Good Job, liking it. Good use of TPAs and the use of ColorSpeed2Tolerance function.
If you can use that function well you probably have a good understanding of SRL functions
Now to the facts that we've all waited for :)
a) The script doesn't use multiplayer, I actually lived when that was one of the requirements and one of the main concepts of SRL.
b) The only place the script uses If Not LoggedIn Then Exit or something similar are it's antiban procedures! Sure, it's stupid to do antiban while logged out, but how about trying to enter the boat when you're logged out?
c)
procedure GoInBoat; Yes, excellent use of TPAs, how about failsafes? Oh right, they were just a trend? Well, he uses failsafes for the GoInBoat procedure in the GetInBoat procedure, you're gonna feel clumsy not having a handy boolean for such an important part of the script.d)
If FindSymbol(x, y, 'magic shop') then Mouse(x+22, y+10, 4, 4, True); else ? Enjoy.