PDA

View Full Version : Help For My First Auto Fighter



DaviDemon
07-16-2007, 04:39 AM
This is my first auto fighter I made recently and I need someone to fix it for me.

It keeps saying:

Failed when compiling
Line 50: [Error] (15205:1): Identifier expected in script C:\Documents & Settings ...

When you're done fixing with it can you PM it back to me?

Thanks (h)

Oh and BTW I just started to use Scar so I'm very new to macroing and botting.

Here's the script!

Program UltimateFighter;
{.Script Info:
# ScriptName = The Ultimate Auto Fighter
# Author = DaviDemon
# Description = A Runescape Auto Fighter
# Version = 1.0
# Date = 07/07/07
# Comments = The Best Auto Fighter Yet!
/Script Info}

{.Include SRL/SRL.Scar}
{.Includes/SRL/SRL/Core/Antiban.Scar}
{.Include SRL/SRL/Skill/Fighting.Scar}

Var
I, A: Integer;
Killed: Integer;
DidRandomHappen: Boolean;

// ~ CONSTANTS ~ //

Const
Colours1 = 1813715; // One colour of the monster
Colours2 = 11256008; // Another colour of the monster
Colours3 = 549375; // Last colour of the monster
MName = 'Man'; // The name of the monster you are fighting
MName2 = 'Man'; // Put the same name here
Time = 100; // How many monsters you want to kill
DirToRun = 'W'; // Which way to run if in a fight
AttackLvl = 30; // Put your attack level here

// ~ DECLARING PLAYERS ~ //

Procedure DeclarePlayers;
Begin
HowManyPlayers := 1; // Number of players you want to bot with
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ' '; // Username goes here
Players[0].Pass := ' '; // Password goes here
Players[0].Nick := ' '; // A nickname for your character goes here
Players[0].Active := False; // True - Currently on that account, False - Not on the account
Players[0].Skill := 'Strength'; // What fight style you want to attack with

NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);

// ~ RANDOM EVENTS ~ //

Function FindFastRandoms: Boolean;
Var
I: Integer;
Begin
For I := 1 To 8 Do
Begin
Case I Of
1: If FindDead Then
Result := True;
2: If FindMod Then
Result := True;
3: If FindMime Then
Result := True;
4: If FindMaze Then
Result := True;
5: If FindQuiz Then
Result := True;
6: If FindDemon Then
Result := True;
7: begin
If NoGameTab Then
Begin
Result := True;
Players[CurrentPlayer].Loc := 'No GameTab';
Logout;
Exit;
End;
End;
7: Begin
If InBlack Then
Begin
Result := True;
Players[CurrentPlayer].Loc := 'InBlack';
Logout;
Exit;
End;
End;
8: RC;
End;
Wait(1);
End;
If (Result = True) Then
DidRandomHappen := True;

// ~ ANTI RANDOMS ~ //

Procedure DoAntiRandoms;
Begin
FindTalk;
FindFastRandoms;
FindNormalRandoms;
PopUp('Continue')
If (FindFight = True) Then
Begin
RunAwayDirection('N');
Wait(10000 + Random(2000));
RunBack;
If Not LoggedIn Then NextPlayer(False);
End;
End;

// ~ ANTI BANS ~ //

Procedure AntiBans;
Begin
Case Random(10) of
2: MouseBox(MSX1, MSY1, MSX2, MSY2, 3);
4: HoverSkill('Fishing', False);
5: HoverSkill('Attack', False);
6: MouseBox(MIx1, MIY1, MIX2, MIY2, 3);
7: HoverSkill('Strength', False);
9: BoredHuman;
End;
End;

// ~ FIGHT STYLE ~ //

Procedure SetsFightMode;
Begin
GameTab(1);
If Players[CurrentPlayer].Skill = 'Attack' Then SetFightMode(2);
If Players[CurrentPlayer].Skill = 'Strength'Then SetFightMode(2);
If Players[CurrentPlayer].Skill = 'Defence' Then SetFightMode(2);
FindTalk;
End;

// ~ ATTACK MONSTER ~ //
Procedure Attack Monster;
Begin
Killed:= Killed + 1;
SetsFightMode;
Repeat
If FindObj(X,Y,MName,Colours1,5) Or
FindObj(X,Y,MName,Colours2,5) Or
FindObj(X,Y,MName,Colours3,5) Then
DoAntiRandoms;
AutoTalker;
MMouse(X,Y,0+Random(2),0+Random(3));
Mouse(X,Y,0,0+Random(3),True);
DoAntiRandoms;
If (Not(Loggedin)) Then NextPlayer(False);
DoAntiRandoms;
Wait(1000+random(300));
If (Not(LoggedIn)) Then NextPlayer(False);
Until(InFight= False);
End;

// ~ PROGRESS REPORT ~ //

Procedure ProgressReport;
Begin
Writeln('Worked For : ' + ScriptTime2(2))
Writeln('Killed '+ IntToStr(Killed) + MName2);

// ~ MAIN LOOP ~ //

Begin
Repeat
A := A + 1;
ClearDebug;
ActivateClient;
SetupSRL;
DeclarePlayers;
LoginPlayer;
HighestAngle;
MakeCompass('N');
DoAntiRandoms;
AttackMonster;
DoAntiRandoms;
AntiBans;
ProgressReport;
If (Not(LoggedIn)) Then NextPlayer(False);
If (Time=A)Then
Begin
NextPlayer(True);
HighestAngle;
MakeCompass('N');
Writeln('Switched players successfully :)');
End;
Until(False);
End.

LordGregGreg
07-16-2007, 05:04 AM
This is my first auto fighter I made recently and I need someone to fix it for me.

It keeps saying:

Failed when compiling
Line 50: [Error] (15205:1): Identifier expected in script C:\Documents & Settings ...

When you're done fixing with it can you PM it back to me?

Thanks (h)

Oh and BTW I just started to use Scar so I'm very new to macroing and botting.
Yeah, so I know how to fix that error... and I would love to. But you need kinda post the script so I can :P :duh:

Also, im not going to fix your script for you, no one will unless you pay them.(and this froum doesn't sell or buy anything...so ure guna have to live with help that is going to make you think) All I will do is teach you and help you understand what you did wrong.

Oh, and none of this PM ing stuff, put it here so every one else can learn too.

DaviDemon
07-17-2007, 06:27 AM
There I posted the script...

Now can you fix it?

LordGregGreg
07-17-2007, 07:12 AM
Ask me if you have any questions. It is VERY important you understand what I fixed. You can save alot of trouble by compiling your script as you go, and unles you are copying, thats not a problem.


You never ended your declare plars procedure. put a "end" after it

You never ended your find fast randomes procedure

remeber, you start everry procedure wiht a begin, and you must also end it with a "end;"

You cannot have a method name "attack monster" spaces are not allows. You cannot have a method "attackMonster" either because it has already been made in srl

You call an "autoTalker" procedure that doesnt exist

You never ended your progress report procedure.

You forgot a semi Colon "PopUp('Continue')" here
and here "Writeln('Worked For : ' + ScriptTime2(2));"


Is this script yours? how do you have errors all over the place like this?



PROGRAM UltimateFighter;

{.Script Info:
# ScriptName = The Ultimate Auto Fighter
# Author = DaviDemon
# Description = A Runescape Auto Fighter
# Version = 1.0
# Date = 07/07/07
# Comments = The Best Auto Fighter Yet!
/Script Info}

{.Include SRL/SRL.Scar}
{.Includes/SRL/SRL/Core/Antiban.Scar}
{.Include SRL/SRL/Skill/Fighting.Scar}

VAR
I, A: INTEGER;
Killed: INTEGER;
DidRandomHappen: BOOLEAN;

// ~ CONSTANTS ~ //

CONST
Colours1 = 1813715;
// One colour of the monster
Colours2 = 11256008;
// Another colour of the monster
Colours3 = 549375;
// Last colour of the monster
MName = 'Man';
// The name of the monster you are fighting
MName2 = 'Man'; // Put the same name here
Time = 100;
// How many monsters you want to kill
DirToRun = 'W';
// Which way to run if in a fight
AttackLvl = 30;
// Put your attack level here

// ~ DECLARING PLAYERS ~ //

PROCEDURE DeclarePlayers;
BEGIN
HowManyPlayers := 1;
// Number of players you want to bot with
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ' '; // Username goes here
Players[0].Pass := ' '; // Password goes here
Players[0].Nick := ' ';
// A nickname for your character goes here
Players[0].Active := False;
// True - Currently on that account, False - Not on the account
Players[0].Skill := 'Strength';
// What fight style you want to attack with

NickNameBMP := CreateBitmapMaskFromText(
Players[CurrentPlayer].Nick, UpChars);
END;
// ~ RANDOM EVENTS ~ //

FUNCTION FindFastRandoms: BOOLEAN;
VAR
I: INTEGER;
BEGIN
FOR I := 1 TO 8 DO
BEGIN
CASE I OF
1:
IF FindDead THEN
Result := True;
2:
IF FindMod THEN
Result := True;
3:
IF FindMime THEN
Result := True;
4:
IF FindMaze THEN
Result := True;
5:
IF FindQuiz THEN
Result := True;
6:
IF FindDemon THEN
Result := True;
7:
BEGIN
IF NoGameTab THEN
BEGIN
Result := True;
Players[CurrentPlayer].Loc := 'No GameTab';
Logout;
Exit;
END;
END;
7:
BEGIN
IF InBlack THEN
BEGIN
Result := True;
Players[CurrentPlayer].Loc := 'InBlack';
Logout;
Exit;
END;
END;
8:
RC;
END;
Wait(1);
END;
IF (Result = True) THEN
DidRandomHappen := True;
END;

// ~ ANTI RANDOMS ~ //

PROCEDURE DoAntiRandoms;
BEGIN
FindTalk;
FindFastRandoms;
FindNormalRandoms;
PopUp('Continue');
IF (FindFight = True) THEN
BEGIN
RunAwayDirection('N');
Wait(10000 + Random(2000));
RunBack;
IF NOT LoggedIn THEN
NextPlayer(False);
END;
END;

// ~ ANTI BANS ~ //

PROCEDURE AntiBans;
BEGIN
CASE Random(10) OF
2:
MouseBox(MSX1, MSY1, MSX2, MSY2, 3);
4:
HoverSkill('Fishing', False);
5:
HoverSkill('Attack', False);
6:
MouseBox(MIx1, MIY1, MIX2, MIY2, 3);
7:
HoverSkill('Strength', False);
9:
BoredHuman;
END;
END;

// ~ FIGHT STYLE ~ //

PROCEDURE SetsFightMode;
BEGIN
GameTab(1);
IF Players[CurrentPlayer].Skill = 'Attack' THEN
SetFightMode(2);
IF Players[CurrentPlayer].Skill = 'Strength' THEN
SetFightMode(2);
IF Players[CurrentPlayer].Skill = 'Defence' THEN
SetFightMode(2);
FindTalk;
END;

// ~ ATTACK MONSTER ~ //
PROCEDURE AttackAMonster;
BEGIN
Killed := Killed + 1;
SetsFightMode;
REPEAT
IF FindObj(X, Y, MName, Colours1, 5) OR FindObj(
X, Y, MName, Colours2, 5) OR FindObj(X, Y, MName, Colours3, 5) THEN
DoAntiRandoms;
//AutoTalker;
MMouse(X, Y, 0 + Random(2), 0 + Random(3));
Mouse(X, Y, 0, 0 + Random(3), True);
DoAntiRandoms;
IF (NOT (Loggedin)) THEN
NextPlayer(False);
DoAntiRandoms;
Wait(1000 + random(300));
IF (NOT (LoggedIn)) THEN
NextPlayer(False);
UNTIL (InFight = False);
END;

// ~ PROGRESS REPORT ~ //

PROCEDURE ProgressReport;
BEGIN
Writeln('Worked For : ' + ScriptTime2(2));
Writeln('Killed ' + IntToStr(Killed) + MName2);
END;

// ~ MAIN LOOP ~ //

BEGIN
REPEAT
A := A + 1;
ClearDebug;
ActivateClient;
SetupSRL;
DeclarePlayers;
LoginPlayer;
HighestAngle;
MakeCompass('N');
DoAntiRandoms;
AttackAMonster;
DoAntiRandoms;
AntiBans;
ProgressReport;
IF (NOT (LoggedIn)) THEN
NextPlayer(False);
IF (Time = A) THEN
BEGIN
NextPlayer(True);
HighestAngle;
MakeCompass('N');
Writeln('Switched players successfully :)');
END;
UNTIL (False);
END.



Ask me if you have any questions. It is VERY important you understand what I fixed. You can save alot of trouble by compiling your script as you go, and unles you are copying, thats not a problem.

DaviDemon
07-17-2007, 08:53 AM
Wow gee thnx... i probably need to learn a lot more about making scripts...

Thanks for the great help you gave me and i'll also rep+ you.

yeah the script is mine but i used methods from other peoples scripts.

My bad, didnt realise the 'end' was missing. thank you lorgreggreg soooo much..

have you tested it btw? o_O

anyways yeah ok

cya

LordGregGreg
07-17-2007, 02:12 PM
yw, make sure you understand everything i changed :)

naw, soz , didnt have time to test it, i dont really play rs anymore anyhows. When it compiled, i was happy enough.

Good luck.

Johura
07-18-2007, 07:32 AM
Make sure you get your standards right. Standards are a way to keep your script neat and tidy. Every thing which appears in bold has to be in lower case and also you start each line underneath a line which is bold with two spaces.

Example:

This:
PROCEDURE DeclarePlayers;
BEGIN
HowManyPlayers := 1;
// Number of players you want to bot with
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ' '; // Username goes here
Players[0].Pass := ' '; // Password goes here
Players[0].Nick := ' ';
// A nickname for your character goes here
Players[0].Active := False;
// True - Currently on that account, False - Not on the account
Players[0].Skill := 'Strength';
// What fight style you want to attack with

NickNameBMP := CreateBitmapMaskFromText(
Players[CurrentPlayer].Nick, UpChars);
END;

Should be this:


procedure DeclarePlayers;
begin
HowManyPlayers := 1; // Number of players you want to bot with
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ' '; // Username goes here
Players[0].Pass := ' '; // Password goes here
Players[0].Nick := ' '; // A nickname for your character goes here
Players[0].Active := False; // True - Currently on that account, False - Not on the account
Players[0].Skill := 'Strength'; // What fight style you want to attack with

NickNameBMP := CreateBitmapMaskFromText(
Players[CurrentPlayer].Nick, UpChars);
end;


One more thing. Is this :
NickNameBMP := CreateBitmapMaskFromText(
Players[CurrentPlayer].Nick, UpChars);
needed in declare players? Someone confirm that please.

LordGregGreg
07-18-2007, 02:12 PM
wait... no one ever told me they had to be in lower case... and i like them in upper case..

mabey im wrong, got a link to prove it to me?

destroyface
07-19-2007, 10:16 PM
no but i made my first power cutter it is way worse than urs but i learned from whocares547 or sumthing like that

Bonfield
07-23-2007, 01:54 PM
Make sure you get your standards right.

One more thing. Is this :
NickNameBMP := CreateBitmapMaskFromText(
Players[CurrentPlayer].Nick, UpChars);
needed in declare players? Someone confirm that please.

yeah make your you understand about standards they make it alot easier to fix mistakes and easier to read

SCAR]NickNameBMP := CreateBitmapMaskFromText(
Players[CurrentPlayer].Nick, UpChars);[/SCAR]
is used to make a mask of the users nick for randoms and stuff like that