SRL Archive - Outdated / Broken

[SRL] Fighter


ollie

2006-04-30 05:23:03

OK, this is one of my scripts! eerrrrm, i was learning from others scripts so this should be ok. i will try and add an auto eater later and maybe arrow pickup but that is for later!!

Give Feedback, i ran for 20 mins and it worked ok

Thanks For Using!!

//////////////////////////////////////////////////
// Fighter By Radeon/Ollie //
//////////////////////////////////////////////////
// Setup On Line 16 //
//////////////////////////////////////////////////
program RADFighter;
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/Fighting.scar}
var
ABCase1,ABCase2,FightMode: Integer;
ABMouse,Fighting,AutoLogin: Boolean;
Color1,Color2,Color3,tol: Integer;
RightOrLeft:integer;
user,pass:string;

Procedure Setup;
begin
{ User Setup}
User:='username';
Pass:='password';
FightMode:=2;
AutoLogin:=true;
{ Monster Setup }
Color1:=2969473; // Color Of Monster1 Here
Color2:=3427185; // Color Of Monster2 Here
Color3:=4350354; // Color Of Monster3 Here
tol:=10; // Tolerance to find the monster color. 10 is default
End;

procedure FindRandoms;
begin
FindNormalRandoms;
ClickToContinue;
CloseWindow;
FindLamp('mining');
FindDead;
FindMod;
FindMime;
FindMaze;
FindQuiz;
FindFrog;
FindDoctor;
FindDemon;

if Findname Then FindTalk;
end;

Procedure OpenFriends;
Begin
Mouse(584,485,5,5,true)
Wait(300+random(300))
End;

Procedure AntiBan1;
Begin
ABMouse:=True
Status('AntiBan Activated!')
ABCase1:=Random(4)
ABCase1:=Random(4)
Case ABCase1 Of
1:
Begin
MMouse(586,310,21,21)
Wait(100+Random(100))
MMouse(457,202,40,40)
Wait(100+Random(100))
MMouse(307,388,40,40)
Wait(100+Random(100))
MMouse(194,248,40,40)
Wait(100+Random(100))
MMouse(246,98,40,40)
Wait(100+Random(100))
FindRandoms;
End;
2:
Begin
Status('Checking Stats!')
Mouse(586,184,7,7,true)
Wait(20+Random(20))
GetMousePos(x,y)
MMouse(x,y,2,2)
Wait(125+Random(125))
MMouse(636,251,2,2)
Wait(12+random(9))
MMouse(648,222,7,7)
Wait(20+random(25))
GetMousePos(x,y)
MMouse(x,y,2,4)
Wait(1000+Random(1000))
FindRandoms;
End;
3:
Begin
MMouse(600,276,20,12)
Wait(45+Random(25))
MMouse(616,283,12,17)
Wait(45+Random(25))
MMouse(614,423,12,17)
Wait(190+Random(225))
Mouse(559,186,7,7,True)
Wait(500+Random(500))
GetMousePos(X,Y)
Wait(20+Random(5))
MMouse(x,y,2,6)
Mouse(584,187,2,2,true)
Wait(1000+random(200))
FindRandoms;
End;
End;
End;

Procedure AntiBan2;
Begin
ABCase2:=Random(7)
ABCase2:=Random(7)
Case ABCase2 Of
1:
Begin
MMouse(266,175,250,160)
Wait(300+Random(50))
MMouse(266,175,250,160)
Wait(300+Random(50))
MMouse(266,175,250,160)
Wait(300+Random(50))
FindRandoms;
End;
2:
Begin
MMouse(266,175,250,160)
Wait(50+Random(50))
MMouse(266,175,250,160)
Wait(300+Random(50))
MMouse(266,175,250,160)
Wait(50+Random(50))
MMouse(266,175,250,160)
Wait(800+Random(50))
MMouse(266,175,250,160)
Wait(50+Random(50))
OpenFriends;
FindRandoms;
End;
3:
Begin
Wait(2000+Random(1200))
FindRandoms;
End;
4:
Begin
MMouse(327,199,300,180)
Wait(400+Random(400))
MMouse(327,199,300,180)
Wait(75+Random(400))
MMouse(327,199,300,180)
Wait(400+Random(400))
FindRandoms;
End;
5:
Begin
MMouse(327,199,300,180)
Wait(400+Random(400))
MMouse(327,199,300,180)
Wait(400+Random(400))
MMouse(327,199,300,180)
Wait(400+Random(400))
MMouse(327,199,300,180)
MMouse(327,199,300,180)
Wait(400+Random(400))
OpenFriends;
FindRandoms;
End;
6:
Begin
GetMousePos(X,Y)
MMouse(x,y,2,2)
GetMousePos(X,Y)
MMouse(x,y,2,2)
Wait(25+Random(20))
GetMousePos(X,Y)
MMouse(x,y,2,2)
Wait(25+Random(20))
FindRandoms;
End;
7:
Begin
GetMousePos(X,Y)
MMouse(x,y,2,2)
Wait(105+Random(20))
GetMousePos(X,Y)
MMouse(x,y,2,2)
GetMousePos(X,Y)
MMouse(x,y,2,2)
Wait(200+Random(22))
GetMousePos(X,Y)
MMouse(x,y,2,2)
Wait(200+Random(22))
FindRandoms;
End;
End;
End;

Procedure RenameScar;
begin
DisguiseScar('iTunes');
end;

Procedure FindFoe;
begin
If FindColorTolerance(x,y,Color1,0,0,511,330,tol) or
FindColorTolerance(x,y,Color2,0,0,511,330,tol) or
FindColorTolerance(x,y,Color3,0,0,511,330,tol) then
Begin
MMouse(x,y,15,19)
Wait(100+random(200))
MMouse(x,y,2,2)
If IsTextInAreaEx(4,4,55,24,x,y,'Attack',100,UpChars,True,false,0,1,14475232) then
Begin
RightOrLeft:=Random(3)
RightOrLeft:=Random(3)
Case RightOrLeft of
1:
Begin
GetMousePos(X,Y)
Mouse(x,y,0,0,false)
Wait(100+Random(100))
If IsTextInAreaEx(x-250,y-250,x+250,y+250,x,y,'Attack',100,UpChars,True,false,0,1,14475232) then
begin
Wait(25+random(100))
MMouse(x,y,20,3)
GetMousePos(x,y)
MMouse(x,y,30,2)
GetMousePos(x,y)
Mouse(x,y,0,0,true)
Wait(5000+random(500))
GetMousePos(X,Y)
End;
End;
2:
Begin
GetMousePos(x,y)
Mouse(x,y,0,1,true)
GetMousePos(X,Y)
wait(5000+random(500))
GetMousePos(X,Y)
End;
End;
End;
End;
If not FindColorTolerance(x,y,Color1,0,0,511,330,tol) or
FindColorTolerance(x,y,Color2,0,0,511,330,tol) or
FindColorTolerance(x,y,Color3,0,0,511,330,tol) then
Begin
Wait(500+Random(300))
End;
end;

Procedure Engine;
Begin
Repeat
Wait(20+Random(20))
If FindColorTolerance(x,y,65280,0,0,508,330,10) Then
Begin
Fighting:=True;
End
If Not FindColorTolerance(x,y,65280,0,0,508,330,10) Then
Begin
Fighting:=False;
End
If Fighting=False Then
Begin
FindFoe;
End;
If Fighting=True Then
Begin
AntiBan2;
End;
Until(False);
End;

Procedure SetFighting;
Begin
Mouse(559,177,7,7,True)
Wait(500+Random(1000))
Case FightMode Of
1:
Begin
Status('FightMode = 1')
Mouse(598,285,10,10,true)
Wait(1000+Random(1000))
End;
2:
Begin
Status('FightMode = 2')
Mouse(600,325,10,10,true)
Wait(1000+Random(1000))
End;
3:
Begin
Status('FightMode = 3')
Mouse(597,366,10,10,true)
Wait(1000+Random(1000))
End;
4:
Begin
Status('FightMode = 4')
Mouse(600,406,10,10,true)
Wait(1000+Random(1000))
End;
End;
End;



Procedure Login;
Var
ClickHereToPlay, Tx, Ty, C : Integer;
Begin;
if(AutoLogin)then
ClickHereToPlay := BitmapFromString(29, 2, 'z78DA7373230C0C' +
'C0C0CCD4D0C0C014971A73376323232333274367034B08896902A' +
'60804983A1A9A1A58E03219228B693BB209585C8BC30DC800EA5A' +
'BCFE4251EF6A6460688AE95A2C2683CD040002BE5286');
If(Not(LoggedIn))Then
Begin
Wait(1000);
ClickOption('Cancel', 1);
ClickOption('Exist', 1);
If(ClickOption('Username', 1))Then
Begin
TypeSend(''+User+'');
Wait(100 + Random(100));
Mouse(327, 272, 0, 0, True);
TypeSend(''+Pass+'');
Wait(100 + Random(100));
End;
ClickOption('Login', 1);
MarkTime(Mark);
Repeat
Wait(100);
Until(Not(FindText(Tx, ty, 'onnect', UpChars, 240, 200, 530, 240)))Or(TimeFromMark(Mark) > 20000);
Repeat
Wait(1000);
Until(FindBitmapToleranceIn(ClickHereToPlay, X, Y, 380, 290, 620, 380, 20));
Wait(1000 + Random(500));
Mouse(x, y, 20, 2, True);
Repeat
Wait(1000);
C := C+1;
Until(LoggedIn)Or(C >= 600);
End;
FreeBitmap(ClickHereToPlay);
End;


begin
{ MAIN Stuff Here }
Setup;
SetupSRL;
RenameScar;
Login;
SetChat('Off', 1);
SetChat('Off', 2);
SetChat('Off', 3);
SetFighting;
Engine;
end.
repeat
FindRandoms;
wait(300+random(150));
Engine;
end.

WT-Fakawi

2006-04-30 05:53:11

nice.
Copule of things though…

FindNormalRandoms has all the other randoms included, so no need for
  ClickToContinue;
CloseWindow;
FindLamp('mining');
FindDead;
FindMod;
FindMime;
FindMaze;
FindQuiz;
FindFrog;
FindDoctor;
FindDemon;


Your AntiBan. What does it do? If it only moves the mouse around I suggest you use IdleTime. This will move the mouse for you, very undetectable.

Try using the Player Array. You have got it all almost worked out. Either way, you need to set the Screen NickName (Players[CurrentPlayer].Nick) in order for the FindName to work properly.

Also, you could reduce on the Engine loop, but other than that….

You are almooost there. Good show though. Rep +

ollie

2006-04-30 06:10:09

thanks, ill expand on those on my next version!

phantombmx

2006-04-30 06:14:46

lookin good, can use what fawki said, but you are definately on your way! :) many of the things you made procedures for are already in srl, such as setting the attack mode.. that is found in srl>srl>core>gametab.scar.. so just find out its name, and use it like you would any other thing in an include..

ollie

2006-04-30 06:43:53

to say its my first proper scar script (Not Including Login/Auto Talk) i think i did ok

ollie

2006-04-30 10:49:24

Heres What i Attempted !, to add a few stuff but i kept getting errors and it wouldnt fight the monster
//////////////////////////////////////////////////
// Fighter By Radeon/Ollie //
//////////////////////////////////////////////////
// Setup On Line 20 //
//////////////////////////////////////////////////
program RADFighter;
{The Includes im Including}
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/Fighting.scar}
var
ABCase1,ABCase2,FightMode,EatHp,RightOrLeft,
FoodColour,CurrentHpLvl,Color1,Color2,Color3,
tol: Integer;
ABMouse,Fighting,AutoLogin,EatFood: Boolean;
user,pass:string;

{This is the User Setup}
Procedure Setup;
begin
{ User Setup}
User:='';
Pass:='';
FightMode:=2;
AutoLogin:=true;
{ Food Setup }
EatFood:=true; //Do You Want To Eat?
EatHp:=20; //Put Food in 1st Slot, Colour Will Get Automatically Detected
{ Monster Setup }
Color1:=13029070; // Color Of Monster1 Here
Color2:=2907003; // Color Of Monster2 Here
Color3:=14607331; // Color Of Monster3 Here
tol:=10; // Tolerance to find the monster color. 0 is default
End;
{This Finds Randoms and Solves Them}
procedure FindRandoms;
begin
FindNormalRandoms;
if Findname Then FindTalk;
end;

{This Randomly Switches Tabs, Stats Bag and Quests etc..}
Procedure RandomTabMoves;
Begin;
GameTab(1+random(12));
Status('Clicked Random Tab')
End;


{This moves mosue randomly and stops you getting banned!}
Procedure AntiBan1;
Begin
ABMouse:=True
Status('AntiBan Activated!')
ABCase1:=Random(4)
ABCase1:=Random(4)
Case ABCase1 Of
1:
Begin
MMouse(586,310,21,21)
Wait(100+Random(100))
MMouse(457,202,40,40)
Wait(100+Random(100))
MMouse(307,388,40,40)
Wait(100+Random(100))
MMouse(194,248,40,40)
Wait(100+Random(100))
MMouse(246,98,40,40)
Wait(100+Random(100))
RandomChat;
RandomTabMoves;
End;
2:
Begin
Status('Checking Stats!')
Mouse(586,184,7,7,true)
Wait(20+Random(20))
GetMousePos(x,y)
MMouse(x,y,2,2)
hoverskill('random')
Wait(125+Random(125))
MMouse(636,251,2,2)
Wait(12+random(9))
MMouse(648,222,7,7)
Wait(20+random(25))
GetMousePos(x,y)
MMouse(x,y,2,4)
Wait(1000+Random(1000))
RandomTabMoves;
RandomChat;
FindRandoms;
End;
3:
Begin
MMouse(600,276,20,12)
Wait(45+Random(25))
MMouse(616,283,12,17)
Wait(45+Random(25))
MMouse(614,423,12,17)
Wait(190+Random(225))
Mouse(559,186,7,7,True)
Wait(500+Random(500))
GetMousePos(X,Y)
Wait(20+Random(5))
MMouse(x,y,2,6)
Mouse(584,187,2,2,true)
Wait(1000+random(200))
RandomChat;
RandomTabMoves;
FindRandoms;
End;
End;
End;

Procedure AntiBan2;
Begin
ABCase2:=Random(7)
ABCase2:=Random(7)
Case ABCase2 Of
1:
Begin
MMouse(266,175,250,160)
Wait(300+Random(50))
MMouse(266,175,250,160)
Wait(300+Random(50))
MMouse(266,175,250,160)
Wait(300+Random(50))
RandomTabMoves;
FindRandoms;
End;
2:
Begin
MMouse(266,175,250,160)
Wait(50+Random(50))
MMouse(266,175,250,160)
Wait(300+Random(50))
MMouse(266,175,250,160)
Wait(50+Random(50))
MMouse(266,175,250,160)
Wait(800+Random(50))
MMouse(266,175,250,160)
Wait(50+Random(50))
RandomTabMoves;
FindRandoms;
End;
3:
Begin
Wait(2000+Random(1200))
RandomTabMoves;
FindRandoms;
End;
4:
Begin
MMouse(327,199,300,180)
Wait(400+Random(400))
MMouse(327,199,300,180)
Wait(75+Random(400))
MMouse(327,199,300,180)
Wait(400+Random(400))
RandomTabMoves;
FindRandoms;
RandomChat;
End;
5:
Begin
MMouse(327,199,300,180)
Wait(400+Random(400))
MMouse(327,199,300,180)
Wait(400+Random(400))
MMouse(327,199,300,180)
Wait(400+Random(400))
MMouse(327,199,300,180)
MMouse(327,199,300,180)
Wait(400+Random(400))
RandomTabMoves;
FindRandoms;
End;
6:
Begin
GetMousePos(X,Y)
MMouse(x,y,2,2)
GetMousePos(X,Y)
MMouse(x,y,2,2)
Wait(25+Random(20))
GetMousePos(X,Y)
MMouse(x,y,2,2)
Wait(25+Random(20))
RandomTabMoves;
FindRandoms;
End;
7:
Begin
GetMousePos(X,Y)
MMouse(x,y,2,2)
Wait(105+Random(20))
GetMousePos(X,Y)
MMouse(x,y,2,2)
GetMousePos(X,Y)
MMouse(x,y,2,2)
Wait(200+Random(22))
GetMousePos(X,Y)
MMouse(x,y,2,2)
Wait(200+Random(22))
RandomTabMoves;
FindRandoms;
End;
End;
End;

{This Renames Scar To A Different Title}
Procedure RenameScar;
begin
DisguiseScar('iTunes');
end;

{This Finds The Monster And Attacks It!, with a random Right Or Left Click}
Procedure FindFoe;
begin
Status('Looking For Monster')
If FindColorTolerance(x,y,Color1,0,0,511,330,tol) or
FindColorTolerance(x,y,Color2,0,0,511,330,tol) or
FindColorTolerance(x,y,Color3,0,0,511,330,tol) then
Begin
MMouse(x,y,15,19)
Wait(100+random(200))
MMouse(x,y,2,2)
If IsTextInAreaEx(x-250,y-250,x+250,y+250,x,y,'Attack',100,UpChars,True,false,0,1,14475232) then
Begin
RightOrLeft:=Random(3)
RightOrLeft:=Random(3)
Case RightOrLeft of
1:
Begin
GetMousePos(X,Y)
Mouse(x,y,0,0,false)
Wait(100+Random(100))
If IsTextInAreaEx(x-250,y-250,x+250,y+250,x,y,'Attack',100,UpChars,True,false,0,1,14475232) then
begin
Wait(25+random(100))
MMouse(x,y,20,3)
GetMousePos(x,y)
MMouse(x,y,30,2)
GetMousePos(x,y)
Mouse(x,y,0,0,true)
Wait(5000+random(500))
GetMousePos(X,Y)
Status('Fighting')
End;
End;
2:
Begin
GetMousePos(x,y)
Mouse(x,y,0,1,true)
GetMousePos(X,Y)
wait(5000+random(500))
GetMousePos(X,Y)
End;
End;
End;
End;
If not FindColorTolerance(x,y,Color1,0,0,511,330,tol) or
FindColorTolerance(x,y,Color2,0,0,511,330,tol) or
FindColorTolerance(x,y,Color3,0,0,511,330,tol) then
Begin
Wait(500+Random(300))
End;
end;


{This is the Engine For The Fighter}
Procedure Engine;
Begin
Repeat
Wait(20+Random(20))
If FindColorTolerance(x,y,65280,0,0,508,330,10) Then
Begin
Fighting:=True;
End
If Not FindColorTolerance(x,y,65280,0,0,508,330,10) Then
Begin
Fighting:=False;
End
If Fighting=False Then
Begin
FindFoe;
End;
If Fighting=True Then
Begin
AntiBan2;
End;
Until(False);
End;

{This Sets The Fightmode}
Procedure SetFighting;
Begin
Mouse(559,177,7,7,True)
Wait(500+Random(1000))
Case FightMode Of
1:
Begin
Status('FightMode = 1')
Mouse(598,285,10,10,true)
Wait(1000+Random(1000))
End;
2:
Begin
Status('FightMode = 2')
Mouse(600,325,10,10,true)
Wait(1000+Random(1000))
End;
3:
Begin
Status('FightMode = 3')
Mouse(597,366,10,10,true)
Wait(1000+Random(1000))
End;
4:
Begin
Status('FightMode = 4')
Mouse(600,406,10,10,true)
Wait(1000+Random(1000))
End;
End;
End;

{This is like a human click VERY Undetectable}
Procedure ClickHuman(X, Y:Integer; Left:Boolean);
Begin;
HoldMouse(X, Y, Left);
Wait(20+Random(15));
ReleaseMouse(X, Y, Left);
End;

{This Logs The User In}
Procedure Login;
Var
ClickHereToPlay, Tx, Ty, C : Integer;
Begin;
Status('Beggining Auto-Login')
if(AutoLogin)then
ClickHereToPlay := BitmapFromString(29, 2, 'z78DA7373230C0C' +
'C0C0CCD4D0C0C014971A73376323232333274367034B08896902A' +
'60804983A1A9A1A58E03219228B693BB209585C8BC30DC800EA5A' +
'BCFE4251EF6A6460688AE95A2C2683CD040002BE5286');
If(Not(LoggedIn))Then
Begin
Wait(1000);
ClickOption('Cancel', 1);
ClickOption('Exist', 1);
If(ClickOption('Username', 1))Then
Begin
TypeSend(''+User+'');
Wait(100 + Random(100));
Mouse(327, 272, 0, 0, True);
TypeSend(''+Pass+'');
Wait(100 + Random(100));
End;
ClickOption('Login', 1);
MarkTime(Mark);
Repeat
Wait(100);
Until(Not(FindText(Tx, ty, 'onnect', UpChars, 240, 200, 530, 240)))Or(TimeFromMark(Mark) > 20000);
Repeat
Wait(1000);
Until(FindBitmapToleranceIn(ClickHereToPlay, X, Y, 380, 290, 620, 380, 20));
Wait(1000 + Random(500));
Mouse(x, y, 20, 2, True);
Repeat
Wait(1000);
C := C+1;
Until(LoggedIn)Or(C >= 600);
End;
FreeBitmap(ClickHereToPlay);
End;

{This Finds The Food Color}
Procedure GetFoodColour;
Begin;
GameTab(4);
Wait(200+Random(100));
MMouse(628, 374, 4, 4);
Wait(100+Random(100));
GetMousePos(X, Y);
If(IsUpText('Eat'))Then
Begin
FoodColour := GetColor(X, Y);
End Else
Begin
MMouse(663, 224, 6, 6);
GetMousePos(X, Y);
Wait(100+Random(100));
If(IsUpText('Eat'))Then
FoodColour := GetColor(X, Y);
End;
End;

{This Eats the Food with the Colour already Saved}
Procedure Munch;
Begin;
GameTab(2);
CurrentHpLvl := GetSkillAmount('HitPoints');
If(CurrentHpLvl < EatHp)Then
Begin
GameTab(4);
Wait(100+Random(300));
MMouse(21+Random(400), 50+Random(400), 6, 6);
Wait(100+Random(450));
If(FindColorSpiral(X, Y, FoodColour, 553, 207, 737, 460))Then
Begin
MMouse(X, Y, 4, 4);
Wait(100+Random(100));
ClickHuman(X, Y, True);
End Else
Begin
WriteLn('Oh Noes! Run out of food!!');
RandomChat;
LogOut;
End;
End;
End;

{This is the main method}
begin
{ MAIN }
Setup;
SetupSRL;
RenameScar;
Login;
SetChat('Off', 1);
SetChat('Friends', 2);
SetChat('On', 3);
RandomChatEvery(3+random(15));
LeaveScreenEvery(1+random(13));
RotateEvery(1+random(5));
AntiBan;
SetFighting;
Engine;
End.
{This is where we repeat our script functions}
repeat
SetChat('Off', 1);
SetChat('Friends', 2);
SetChat('On', 3);
FindRandoms;
FindFoe;
RandomChat;
wait(300+random(15));
Engine;
FindFoe;
end;