SRL Archive - OSR Help

Help with first script


asap1

2012-02-01 23:10:35

Im getting this error

[Error] (53:23): Identifier expected at line 52
Compiling failed.

Program Al_Kharid_Warrior_Killer;
{$i srl\srl\misc\smart.simba}
{$i SRL\SRL.simba}
{$i srl\srl\skill\fighting.simba}

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

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Bankpin Here
Players[0].BoxRewards := ['Xp'];
end;

Procedure Attackwarrior;
Var
x, y: Integer;
Begin
If FindObjCustom( x, y, ['att', 'warrior'], [1321795, 5325613, 6509099], 5) Then
Begin
GetMousePos (x, y);

Case Random (0) Of
0: Mouse (x, y, 5, 5, True);
End;
End;
End;

///// Credit goes to Tickyy
Procedure Bankit;
Var
i: Integer;
Begin
If (Not (LoggedIn)) Then Exit;
For i := 1 To 4 Do
Begin
If OpenBank('akb', True, True) Then
begin
Withdraw(10, 1, 28);
break;
end;
End;
Writeln('Banking Failed - Changing Players');
NextPlayer(False);
End;

Function LowHPLetsEat('lobster'): Boolean;
var
I, x, y: Integer;
begin
Result := (HPPercent < 50) and (LoggedIn);
If(not(Result)) then
Exit;

if Result then
If InvEmpty then
begin
Bankit;
end else
for i := 1 to 28 do
begin
InvMouse(I, 3);
Wait(RandomRange(150, 250));
if WaitUpText(What, RandomRange(250, 300)) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Exit;
end else
Continue;
end;
end;

begin
MouseSpeed := 15;
Smart_Server := 0;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;

ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;

If InvEmpty Then
Bankit else
Attackwarrior;
While(Infight)do
Wait(100);
LowHPLetsEat;
Until not LoggedIn;
end.

kevin33

2012-02-01 23:14:43

No spaces allowed in the name.

Supertrent1

2012-02-01 23:16:22

Change is to this
program AlKharidWarriorKiller;
{$i srl/srl/misc/smart.simba}
{$i SRL\SRL.simba}
{$i srl/srl/skill/fighting.simba}

begin
SetupSRL;
end.

asap1

2012-02-01 23:49:59

Hey can someone let me use their anti-ban and i will credit it to you because im very new and dont know how to do that yet i just want to make a script that will kill the warriors, eat, bank for more food and walk back to kill more.

program Al_Kharid_Warrior_Killer;
{$i srl/srl/misc/smart.simba}
{$i SRL\SRL.simba}
{$i srl/srl/skill/fighting.simba}

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

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Bankpin Here
end;

begin
Smart_Server := 0;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;

ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
end;

kevin33

2012-02-02 00:05:37

Sure you can use mine if you really want to.
I used StatsGuise in the script I was previously working on and then used a case statement for the antiban (small amount of it but you can add more if you wish):

procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End; //call this first


procedure FightingAntiban;
begin
Case Random(250) Of
0: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('attack', False) GameTab(28) End;
1: Begin StatsGuise('Antiban') SleepAndMoveMouse(7000 + Random(500)); End;
2: Begin StatsGuise('Antiban') GameTab(tab_Inv) ExamineInv; GameTab(28); End;
3: Begin StatsGuise('AntiBan') RandomAngle(1); End;
4: Begin StatsGuise('AntiBan') GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(28); End;
5: Begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('random', False); GameTab(28); End;
6: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('strength', False); GameTab(28); End;
7: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('defence', False); GameTab(28); End;
8: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('ranged', False); GameTab(28); End;
9: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('magic', False); GameTab(28); End;
10: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('constitution', False); GameTab(28); End;
end;
end;

Something like this. Feel free to alter it in any way you please.

asap1

2012-02-02 00:36:59

From: kevin33
Sure you can use mine if you really want to.
I used StatsGuise in the script I was previously working on and then used a case statement for the antiban (small amount of it but you can add more if you wish):

procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End; //call this first


procedure FightingAntiban;
begin
Case Random(250) Of
0: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('attack', False) GameTab(28) End;
1: Begin StatsGuise('Antiban') SleepAndMoveMouse(7000 + Random(500)); End;
2: Begin StatsGuise('Antiban') GameTab(tab_Inv) ExamineInv; GameTab(28); End;
3: Begin StatsGuise('AntiBan') RandomAngle(1); End;
4: Begin StatsGuise('AntiBan') GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(28); End;
5: Begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('random', False); GameTab(28); End;
6: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('strength', False); GameTab(28); End;
7: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('defence', False); GameTab(28); End;
8: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('ranged', False); GameTab(28); End;
9: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('magic', False); GameTab(28); End;
10: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('constitution', False); GameTab(28); End;
end;
end;

Something like this. Feel free to alter it in any way you please.


Thank you so much

kevin33

2012-02-02 00:43:52

Np. It should still work but it may not with all the updates. I never bothered to check when I stopped making the script.

asap1

2012-02-02 01:56:41

Ok i have gotten this far and i wanted to know if im headed the right way and will the script know when the pin screen comes up and put the pin in or do i have to add that to the script?

program Al_Kharid_Warrior_Killer;
{$i srl/srl/misc/smart.simba}
{$i SRL\SRL.simba}
{$i srl/srl/skill/fighting.simba}

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

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Bankpin Here
Players[0].BoxRewards := ['Xp'];
end;

begin
Smart_Server := 0;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;

ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
end.

/////All credit for anti-ban goes to kevin33////
procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;

procedure FightingAntiban;
begin
Case Random(250) Of
0: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('attack', False) GameTab(28) End;
1: Begin StatsGuise('Antiban') SleepAndMoveMouse(7000 + Random(500)); End;
2: Begin StatsGuise('Antiban') GameTab(tab_Inv) ExamineInv; GameTab(28); End;
3: Begin StatsGuise('AntiBan') RandomAngle(1); End;
4: Begin StatsGuise('AntiBan') GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(28); End;
5: Begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('random', False); GameTab(28); End;
6: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('strength', False); GameTab(28); End;
7: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('defence', False); GameTab(28); End;
8: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('ranged', False); GameTab(28); End;
9: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('magic', False); GameTab(28); End;
10: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('constitution', False); GameTab(28); End;
end;

/////Credit goes to Tickyy////
Procedure Bankit;
Var
i: Integer;
Begin
If (Not (LoggedIn)) Then Exit;
For i := 1 To 4 Do
Begin
If OpenBank('veb', True, True) Then
Withdraw(10, 1, 28);
End;
Writeln('Banking Failed - Changing Players');
NextPlayer(False);
End;








end.

Edit: Im using a lot of other peoples stuff to LEARN so plz dont think im just leeching off of their stuff to make a script im just trying to learn

kevin33

2012-02-02 01:58:05

You are on the right track. To answer your question: Yes you will have to add the pin support to the script so it will enter it when the screen pops up.

asap1

2012-02-02 02:06:11

From: kevin33
You are on the right track. To answer your question: Yes you will have to add the pin support to the script so it will enter it when the screen pops up.


Thank you for your help ill read more and add the pin support tomorrow. I been reading about scripting for over 6 hours and its 2am so im going to bed

kevin33

2012-02-02 02:09:04

Yo before you go. You left your user and pass in the script. I hope I got to it first. I will pm you with your new password.

asap1

2012-02-02 17:34:35

Hey i was wondering what is the best way to make the script eat? I have been reading up on DTM's but idk if they are the best to use for eating

kevin33

2012-02-02 17:46:12

Look at other fighting scripts and figure out the best method using them. Never made a cb script before so I really dont know what the best method is.

'Toxin

2012-02-02 17:47:17

From: asap1
Hey i was wondering what is the best way to make the script eat? I have been reading up on DTM's but idk if they are the best to use for eating


For eating purposes, DTM's are a decent way to go on about it, however you may need to update them frequently based on Jagex's updates.

asap1

2012-02-02 19:09:40

bump look at first post im in need of help

Supertrent1

2012-02-03 17:31:59

From: asap1
bump look at first post im in need of help


Do you want the script to eat the food. If so, what kind of food is it?

asap1

2012-02-03 17:54:33

From: Supertrent1
Do you want the script to eat the food. If so, what kind of food is it?

Yes i want it to eat and i want it to eat lobsters

Tickyy

2012-02-03 18:22:08

Hey asap1 :)!

First of all, its good to know that you're trying to learn how to make your own script, don't worry nobody was born with any kind of abilities, so don't worry. Also don't worry about copying from others, that's how i started as well! Good to see that you already started to credit, that's great! Now i will try to fix your script a little bit, remove unnecessary things and do the best from it, and i am going to give you the first steps of the things that you're trying to do.

First of all, here's your script edited by me:

Program Al_Kharid_Warrior_Killer;
{$i srl\srl\misc\smart.simba}
{$i SRL\SRL.simba}
{$i srl\srl\skill\fighting.simba}

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

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Bankpin Here
Players[0].BoxRewards := ['Xp'];
end;

///// All credit for anti-ban goes to kevin33
procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;

procedure FightingAntiban;
begin
StatsGuise('Antiban')
Case Random(11) Of
0: Begin GameTab(tab_Stats) HoverSkill('attack', False) End;
1: Begin SleepAndMoveMouse(7000 + Random(500)); End;
2: Begin GameTab(tab_Inv) ExamineInv; End;
3: Begin RandomAngle(1); End;
4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); End;
5: Begin GameTab(tab_Stats) HoverSkill('random', False); End;
6: Begin GameTab(tab_Stats) HoverSkill('strength', False); End;
7: Begin GameTab(tab_Stats) HoverSkill('defence', False); End;
8: Begin GameTab(tab_Stats) HoverSkill('ranged', False); End;
9: Begin GameTab(tab_Stats) HoverSkill('magic', False); End;
10: Begin GameTab(tab_Stats) HoverSkill('constitution', False); End;
end;
end;

///// Credit goes to Tickyy
Procedure Bankit;
Var
i: Integer;
Begin
If (Not (LoggedIn)) Then Exit;
For i := 1 To 4 Do
Begin
If OpenBank('veb', True, True) Then
begin
Withdraw(10, 1, 28);
break;
end;
End;
Writeln('Banking Failed - Changing Players');
NextPlayer(False);
End;

As you can see I've fixed your standards, removed some unnecessary stuff(but you probably won't know what exactly but i am going to show you :p).

__

begin
Smart_Server := 0;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;

ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
end.

This used to be at the top of the script but this is actually the mainloop. What is a mainloop? Mainloop is basically like this, you can do 1000 of functions and procedures, but if you want to use them you have to call them at the mainloop. The mainloop is always at the end of the script and always ends with a dot!

__

procedure FightingAntiban;
begin
Case Random(250) Of
0: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('attack', False) GameTab(28) End;
1: Begin StatsGuise('Antiban') SleepAndMoveMouse(7000 + Random(500)); End;
2: Begin StatsGuise('Antiban') GameTab(tab_Inv) ExamineInv; GameTab(28); End;
3: Begin StatsGuise('AntiBan') RandomAngle(1); End;
4: Begin StatsGuise('AntiBan') GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(28); End;
5: Begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('random', False); GameTab(28); End;
6: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('strength', False); GameTab(28); End;
7: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('defence', False); GameTab(28); End;
8: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('ranged', False); GameTab(28); End;
9: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('magic', False); GameTab(28); End;
10: Begin StatsGuise('Antiban') GameTab(tab_Stats) HoverSkill('constitution', False); GameTab(28); End;
end;

This antiban is the unnecessary part that i mentioned. You missed a "end;" and the StatsGuise procedure is ok, but unnecessary imo, so i changed it to this:

procedure FightingAntiban;
begin
StatsGuise('Antiban')
Case Random(250) Of
0: Begin GameTab(tab_Stats) HoverSkill('attack', False) End;
1: Begin SleepAndMoveMouse(7000 + Random(500)); End;
2: Begin GameTab(tab_Inv) ExamineInv; End;
3: Begin RandomAngle(1); End;
4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); End;
5: Begin GameTab(tab_Stats) HoverSkill('random', False); End;
6: Begin GameTab(tab_Stats) HoverSkill('strength', False); End;
7: Begin GameTab(tab_Stats) HoverSkill('defence', False); End;
8: Begin GameTab(tab_Stats) HoverSkill('ranged', False); End;
9: Begin GameTab(tab_Stats) HoverSkill('magic', False); End;
10: Begin GameTab(tab_Stats) HoverSkill('constitution', False); End;
end;
end;


__

/////Credit goes to Tickyy////
Procedure Bankit;
Var
i: Integer;
Begin
If (Not (LoggedIn)) Then Exit;
For i := 1 To 4 Do
Begin
If OpenBank('veb', True, True) Then
Withdraw(10, 1, 28);
End;
Writeln('Banking Failed - Changing Players');
NextPlayer(False);
End;

To:

///// Credit goes to Tickyy
Procedure Bankit;
Var
i: Integer;
Begin
If (Not (LoggedIn)) Then Exit;
For i := 1 To 4 Do
Begin
If OpenBank('veb', True, True) Then
begin
Withdraw(10, 1, 28);
break;
end;
End;
Writeln('Banking Failed - Changing Players');
NextPlayer(False);
End;

Another begin and end; was added because the break was needed the function itself will exit in case bank is open(SRL failsafe) but still… it loops.

_

now here's a gift from me for the "eating" part.

Function LowHPLetsEat(What: String): Boolean;
var
I, x, y: Integer;
begin
Result := (HPPercent < 50) and (LoggedIn);
If(not(Result)) then
Exit;

if Result then
If InvEmpty then
begin
Logout;
TerminateScript;
end else
for i := 1 to 28 do
begin
InvMouse(I, 3);
Wait(RandomRange(150, 250));
if WaitUpText(What, RandomRange(250, 300)) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Exit;
end else
Continue;
end;
end;

Just call LowHPLetsEat('lobster'): for lobster, edit the lobster to salmon or whatever you like. It will start eating if hp is below 50 %

so basically that's it… look around the tutorials and read carefully, you can join the IRC and ask for help there.

GL :)!

asap1

2012-02-03 18:30:11

Thank you so much for fixing my script it was getting messy and for the eating :)