SRL Archive - First Scripts

Lance's Monk Raper!


Lance

2009-02-09 15:21:50

Lance's Monk Raper!

Monk Raper1.0
- changed the GetHealed procedure so that it keeps on talking to the npc healer untill you have reached a 'maxHP' constant
- changed the FightMonks procedure so that it checks the monster to see if it is already fighting somone else, if it is it will not atack it. <– that dosnt always work, but its better than nothing

Proggys:

[==========================================]
.:: Lancerawks`s Monk Rape ::.
Monks Killed: 39
Times Healed: 6
This script has run for: 20min
[==========================================]
[==========================================]
.:: Lancerawks`s Monk Rape ::.
Monks Killed: 59
Times Healed: 20
This script has run for: 76min
[==========================================]
[==========================================]
.:: Lancerawks`s Monk Rape ::.
Monks Killed: 36
Times Healed: 9
This script has run for: 20min
[==========================================]
[==========================================]
.:: Lancerawks`s Monk Rape ::.
Monks Killed: 96
Times Healed: 17
This script has run for: 54min
[==========================================]
[==========================================]
.:: Lancerawks`s Monk Rape ::.
Monks Killed: 116 // this is a realistic number, my proggy #2 counted the monks wrong
Times Healed: 0 // wow theres something oviously wrong with my healing counter..
This script has run for: 87min
[==========================================]

Dervish

2009-02-09 15:26:02

Left your password in there, I pm it to you.

TomTuff

2009-02-09 15:26:11

you could have just posted as a .scar file :\
but i will try :D

Lance

2009-02-09 15:31:30

thanks Dr D. Dervish, i always do that :S
and thanks for testing tomtuff =]
and im sorry im not realy sure how to upload a .scar file to the fourms :S

TomTuff

2009-02-09 15:36:23

From: lancerawks
im not realy sure how to upload a .scar file to the fourms :S

when ur posting, up by the top to the right of the smiley of the icon is a paperclip. click it, click browse, then find and double click your scar file.
exit that popup, and post like normal :D

NCDS

2009-02-09 15:38:41

Not too bad, a few things:

I see you learned to use Scar Assistant :p


repeat
Status('In Fight...');
wait(Random(1000)+500);
until(not InFight);
Could be Replaced by simply just:

Status('In Fight...');


If(IsUpText(monster)) then Mouse(x, y, 2, 2, True)
else
begin
Mouse(x, y, 2, 2, False);
ChooseOption('ttac');
end;
That would better as a case statement, like:


case random(2) of
0 : Mouse( x, y, 2, 2, True);
1 : begin
Mouse( x, y, 2, 2, False);
ChooseOption('ttack');
end;
end;
That way it will Randomize how it clicks the monster.


killedMonks:=killedMonks+1

This can also be shortened into:


Inc(KilledMonks);

and Fail Safe's. Make sure you have lots and lots of fail safe's.

Theres a few things to work on and if you need any other help with anything be sure to let me know!

Good Luck.

TomTuff

2009-02-09 15:42:03

Line 111: [Error] (111:23): Unknown identifier 'CreateTPAFromText' in script C:\Program Files\SCAR 3.15\includes\SRL\SRL\Core\Players.scar

ERROR :(

:fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery:

Lance

2009-02-09 16:09:43

thanks tomtuff, i uploaded the file :]

and thankyou NCDS ill look into that, and actualy i havent realy learned the Scar Assistant.. i just figured that Status('In Fight…'); makes your status bar say 'in fight' :P lol.
Edit: hey man i changed my script and now its comeing up with this error;
[Runtime Error] : Exception: Access violation at address 006165B1 in module 'scar.exe'. Read of address 00000000 in line 355 in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Core/Login.scar

and tom.. umm ive never gotten that error before.. and i did a surch and "CreateTPAFromText" isnt in my script anywhere.. unless the surch missed it xD. but yeah i dont remember using that function either

NCDS

2009-02-09 16:16:18

From: tomtuff
Line 111: [Error] (111:23): Unknown identifier 'CreateTPAFromText' in script C:\Program Files\SCAR 3.15\includes\SRL\SRL\Core\Players.scar

ERROR :(

:fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery: :fiery:


Make sure your SRL is up to date, revision #31.

Lance

2009-02-09 16:59:25

mhm no i figured it out.. i forgot to set my acount back up after i had posted. *smacks his forhead* >.<

Edit: lol dervish, i didnt check my pm cause im stuipd and i freaked thinking someone had stolen my acount xD but thanks man i owe you x]

Z3pla12

2009-02-11 11:27:22

Nice title name =p
trying this out

FROST-2oo8

2009-02-13 18:52:40

Very nice for a first script :)

Smarter Child

2009-02-14 10:28:04

O, maybe I should make a failsafe for the Radial Walk.

But, doesn't it fix itself???

Procedure WalkToGetHealed:Boolean;
begin
if not LoggedIn then Exit;
FindNormalRandoms;
AntiBan;
MakeCompass('n');
SetAngle(true);
if RadialWalk(FindLadderColor, 90, 180, 72, 0, 0)then
begin
Mouse(x, y, 0, 0, false);
FFlag(0);
Result := true;
end;
end;

Make it something like that, though, mine will have an error because im fiddling around with linux and my SRL includes are gone Bologna.

Kyle Undefined

2009-02-14 10:44:33

K, not bad. But did most of it come from Smarter_Child and you just edited it? Anyway, here are some things you can change:

1)
procedure EnterMonaestary;
begin
if not LoggedIn then Exit;
FindNormalRandoms;
AntiBan;
if(not InFight)then
begin
if (FindSymbol(x, y, 'water')) then
begin
Status('Walking to Waterdrop...');
Wait(3000);
Mouse(x, y, 5, 5, true); //clicks
FFlag(0); //waits until the flag is gone
end;
end else Status('Fighting...');
end;
You should really have a failsafe in there just in case if it doesn't find the symbol. Also have a random wait in there. Static waits = bannage.
procedure EnterMonaestary;
begin
if not LoggedIn then
Exit;
FindNormalRandoms;
AntiBan;
if(not InFight)then
begin
if (FindSymbol(x, y, 'water')) then
begin
Status('Walking to Waterdrop...');
Wait(3000 + Random(500));
Mouse(x, y, 5, 5, true); //clicks
FFlag(0); //waits until the flag is gone
end;
end else
Status('Fighting...');
end;

2)
Procedure WalkToGetHealed;
begin
if not LoggedIn then Exit;
FindNormalRandoms;
AntiBan;
MakeCompass('n');
SetAngle(true);
RadialWalk(FindLadderColor, 90, 180, 72, 0, 0);
Mouse(x, y, 0, 0, false);
FFlag(0);
end;
This is ok. But you need the Mouse to be True not False, or have the ChooseOption after it. As for the RW, you need a failsafe just in case that failed.
Procedure WalkToGetHealed;
begin
if not LoggedIn then
Exit;
FindNormalRandoms;
AntiBan;
MakeCompass('n');
SetAngle(true);
RadialWalk(FindLadderColor, 90, 180, 72, 0, 0);
Mouse(x, y, 1, 1, True);
FFlag(0);
end;

3)
In your FightMonks procedure, you have a case for attacking but one line above it you already attack it. Why would you have the user declare the monster as a monk but if the script is only designed to kill monks? The monster uptext is not needed. Here is another way of doing it
procedure FightMonks;
begin
if not LoggedIn then
Exit;
AntiBan;
FindNormalRandoms;
if(InFight)then
begin
repeat
Status('In Fight...');
wait(Random(1000) + 500);
until(not InFight);
end else
if(not InFight) then
begin
if(not FindObjCustom(x, y, ['ttac', 'onk'], [monstercolor1, monstercolor2], (tolerance + 5))) then
EnterMonaestary;
FindObjCustom(x, y, ['ttac', 'onk'], [monstercolor1, monstercolor2], tolerance);
if(not IsFightAt(x, y)) then
begin
case random(2) of
0 : begin
Mouse(x, y, 2, 2, True);
GetMousePos(x, y);
Inc(KilledMonks);
end;
1 : begin
Mouse(x, y, 2, 2, False);
GetMousePos(x, y);
Wait(100 + Random(50));
ChooseOption('ttac');
Inc(KilledMonks);
end;
end;
end;
while IsFightAt(x, y) do
repeat
begin
Status('Waiting for fight...');
SleepAndMoveMouse(500 + Random(500));
currentHP := GetMMLevels('hp', ColorString);
end;
until((not InFight)or(currentHp < minHP));
end;
end;

4)
K, in your SetupSmart procedure, you never define world as you did in your const.
procedure SetupSmart;
begin
SMARTSetupEx(World, False, True, False);
Wait(5000);
SetTargetDC(SmartGetDC);
repeat
wait(100);
until(SmartGetColor(253, 233)<>1118604);
end;

5)

In your report procedure, I don't know why you do this
Writeln(' This script has run for: ' + IntToStr(time/(1000*60)) + 'min');
You can just use TimeRunning and it will print how long it has been running in days/hrs/mins
Writeln(' This script has run for: ' + TimeRunning);

6)

In your Main Loop you should never repeat until(false); That is bad. Try to use repeat…until(AllPlayersInactive); Which brings me up to another point, I never saw any multiplayer switching. And you have a Integer in your DP to set fight style, but you never utilize it. Your monster colors could be turned into a case so it can free up the constants. I would show you but I don't have time. My tree cutter has a good case with colors/uptext you can look at that if you want.

Overall, not a bad first script. Can be improved but not bad. If you ever need any help with anything feel free to PM me or hop on IRC. ;)

~Camo

Smarter Child

2009-02-14 14:38:45

No, most of it is his pure hard work. His RadialWalk fixes itself.

With more fixing and a little work this could be a worthy script. ( for macroing)

Edit : LANCE when bugs are fixed release to Srl Free For All.:)

Lance

2009-02-14 18:02:39

haha thanks all :) and sure ill look into those changes camo, im pleased it has generaly good responses

JPHamlett

2009-02-26 07:07:15

[==========================================]
.:: Lancerawks`s Monk Rape ::.
Monks Killed: 455
Times Healed: 0
This script has run for: 196min
[==========================================]
GTL: Freaky Forester

Smarter Child

2009-02-27 10:38:23

^ Nice progress report.

Get more progress reports k?? but use this script instead….

{

[=====================================================================]*

[========== .:: Lancerawks's Monk Rape ::. ==============]*

[========== ==============]*

[========== -set up from lines 27 - 47/67 ==============]*

[========== -level up an army of lower level players ==============]*

[========== -start at the monestary west of edgevill ==============]*

[========== -needs no food, the monks heal you! ==============]*

[========== -this is my FIRST script ever so ==============]*

[========== please post proggys! ==============]*

[========== ==============]*

[========== Thanks! -Lance ==============]*

[========== ==============]*

[=====================================================================]*

}

program MonkRape;

{.Include SRL/SRL/Misc/SMART.SCAR}

{.Include SRL/SRL.SCAR}

{.include SRL\SRL\Skill\Fighting.scar}



var

x, y, killedMonks, time, timesHealed, currentHP : Integer;

ColorString : String;



const

minHP = 15; //how low the hp can get before the auto will go to heal

maxHP = 25; //the script will continue healing untill your hp heals to this point. DO NOT set higher than your real hp or it will just continue healing forever.

world = 37;

monstercolor1 = 7906002;

monstercolor2 = 8760022;

tolerance = 4;

monster = 'onk';



procedure DeclarePlayers;

begin

HowManyPlayers := 1;

NumberOfPlayers(HowManyPlayers);

CurrentPlayer := 0;



Players[0].Name :='';

Players[0].Pass :='';

Players[0].Nick :='';

Players[0].Active := True;

Players[0].Integers[0] := 2; // Fight style to use

{

Players[1].Name :='';

Players[1].Pass :='';

Players[1].Nick :='';

Players[1].Active := True;

Players[1].Integers[0] := 2;

}

{

Players[2].Name :='';

Players[2].Pass :='';

Players[2].Nick :='';

Players[2].Active := True;

Players[2].Integers[0] := 2;

}

{

Players[3].Name :='';

Players[3].Pass :='';

Players[3].Nick :='';

Players[3].Active := True;

Players[3].Integers[0] := 2;

}

end;



////////////////////////////////DONT TOUCH ANYTHING LOWER THAN HERE////////////////////////////////



(*¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\

|| Good AntiBan that works...................... ||

|| Made by : Smarter_Child :p(from smarter lol).......... ||

\\_________________________________________________________________*)



Procedure AntiBan;

begin

if not LoggedIn then Exit;

case Random(22) of

1:RandomRClick;

2:HoverSkill('Firemaking', False);

3:BoredHuman;

4:HoverSkill('WoodCutting', False);

5:RandomRClick;

6:BoredHuman;

7:SleepAndMoveMouse(3600);

end;

end;



procedure EnterMonaestary;

begin

if not LoggedIn then Exit;

FindNormalRandoms;

AntiBan;

if(not InFight)then

begin

if (FindSymbol(x, y, 'water')) then

begin

Status('Walking to Waterdrop...');

Wait(3000);

Mouse(x, y, 5, 5, true); //clicks

FFlag(0); //waits until the flag is gone

end;

end else Status('Fighting...');

end;





(*¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\

|| Finds the ladder on minimap to get healed lol ||

|| Made By : Smarter Child.............................:p ||

|| Edited By: Lancerawks.....................:P ||

\\_________________________________________________________________*)

Procedure WalkToGetHealed;

begin

if not LoggedIn then Exit;

FindNormalRandoms;

AntiBan;

MakeCompass('n');

SetAngle(true);

RadialWalk(FindLadderColor, 90, 180, 72, 0, 0);

Mouse(x, y, 0, 0, false);

FFlag(0);

end;



function GetHealed: Boolean;

var

Colors: TIntegerArray;

X, Y, I, A, M, curCTS: Integer;

TPA: TPointArray;

ATPA: T2DPointArray;



begin

repeat

if not LoggedIn then Exit;

FindNormalRandoms;

AntiBan;

Result := False;

if not LoggedIn then exit;

curCTS := GetColorToleranceSpeed;

Colors := [8747899, 2636614, 3493468, 3691619];

for I := 0 to 3 do

begin

ColorToleranceSpeed(1);

FindColorsSpiralTolerance(MSCX, MSCY, TPA, Colors[i], MSX1, MSY1, MSX2, MSY2, 15);

if Length(TPA) = 0 then Continue;

ATPA := TPAtoATPAEx(TPA, 20, 20);

M := High(ATPA);

for A := 0 to M do

if MiddleTPAEx(ATPA[A], X, Y) then

begin

MMouse(X, Y, 6, 6);

Wait(100 + Random(50));

if Pos('bbot', RS_GetUpText) > 0 then

begin

GetMousePos(X, Y);

Mouse(X, Y, 0, 0, false);

ChooseOption('alk');

Wait(1000);

ClickToContinue;

Wait(Random(2000)+500);

FindNPCChatText('heal', ClickLeft);

Wait(Random(2000)+500);

ClickToContinue;

Wait(Random(2000)+500);

ClickToContinue;

Wait(Random(2000)+500);

ClickToContinue;

Inc(timesHealed)

currentHP := GetMMLevels('hp', ColorString);

EnterMonaestary;

Result := True;

ColorToleranceSpeed(curCTS);

currentHP := GetMMLevels('hp', ColorString);

Writeln('Health is ' + IntToStr(currentHP) + '/' + IntToStr(maxHP));

end;

end;

end;

ColorToleranceSpeed(curCTS);

until(currentHP >= maxHP);

end;



procedure FightMonks;

begin

if not LoggedIn then Exit;

AntiBan;

FindNormalRandoms;

if(InFight) then

begin

repeat

Status('In Fight...');

wait(Random(1000)+500);

until(not InFight);

end else if(not InFight) then

begin

if(not FindObjCustom(x, y, ['ttac', monster], [monstercolor1, monstercolor2], (tolerance+5))) then EnterMonaestary; //if you cannot find any monsters, walk to waterdrop

FindObjCustom(x, y, ['ttac', monster], [monstercolor1, monstercolor2], tolerance); //surches for the monster, finds its position (x,y)

if(not IsFightAt(x, y)) then //checks the (x,y) coordanates for a HP bar to see if that monster is already fighting someone

begin

If(IsUpText(monster)) then Mouse(x, y, 2, 2, True); //if it finds the monsters name

case random(2) of

0 : begin

Mouse(x, y, 2, 2, True); //left click on the monster

Inc(KilledMonks); //KilledMonks++

end;

1 : begin

Mouse(x, y, 2, 2, False); //right click on the monster

ChooseOption('ttac'); //chose attack

Inc(KilledMonks); //KilledMonks++

end;

end;

end;

Wait(1000);

Status('Waiting for fight...');

Flag;

Wait(1000)

Status('Fighting...');

repeat

Wait(500);

currentHP := GetMMLevels('hp', ColorString);

until((not InFight) or (currentHp < minHP));

end;

end;



procedure SetupSmart;

begin

SMARTSetupEx(2, False, True, False);

Wait(5000);

SetTargetDC(SmartGetDC);

repeat

wait(100);

until(SmartGetColor(253, 233)<>1118604);

end;



procedure Report;

begin

if not LoggedIn then Exit;

time := GetTimeRunning;

ClearDebug;

Writeln('[==========================================]');

Writeln(' .:: Lancerawks`s Monk Rape ::.');

Writeln(' Monks Killed: ' + IntToStr(killedMonks));

Writeln(' Times Healed: ' + IntToStr(timesHealed));

Writeln(' This script has run for: ' + TimeRunning);

Writeln('[==========================================]');

end;



begin

SetUpSRL;

SetupSmart;

ClearDebug;

ActivateClient;

DeclarePlayers;

LogInPlayer;

EnterMonaestary;

SetAngle(true);

repeat

Report;

FightMonks;

Wait(3000);

if currentHP<minHP then

begin

EnterMonaestary;

WalkToGetHealed;

GetHealed;

end;

until(false);

LogOut;

TerminateScript;

end.

Nice.