SRL Archive - OSR Help

Hopeless - In dire need of help with a script


crealite

2013-03-12 08:15:15

Hi!
So I read all the tutorials and some of the script tutorials for fixing the anti-leeches in this script, but I just cant get over this step.
Would preciate if someone either pm'ed me with some helpfull tips or helped in teamview or skype.'

SCRIPT - Current error : [Error] C:\Users\TommPar\Downloads\[Upgraded] AIO Fighter.simba(28:12): colon (':') expected at line 27

program AIOFighter;    
//Shorteh96 would like to thank the following users:
// RequiredOne: I used part of your AutoFighter script as backbone.
// Eduard: I used a lot of your Fight Cave script as backbone to convert to SMART.
// Ogre: Thank you for helping me with my remedial errors in the chatbox every time I asked for help.
//Shorteh96 would like to take very little credit for this script
// as I have no idea how to code in all honesty but am capable of reading
// and copying premade code into a new working script. Thank you!

//Special thanks to Phury
//Brid Mayhem has updated the script with the following:
//Added more color options, Phury's Bone burying method, Toggle on/off for the bone looting/burying
//Added them to the progress report, Updated a few things with antiban method, Added more items able to be picked up
//Edited setup method, Monsters attacked, updated progress Report So it shows alot more, plus it's more organized.
//Also made it update more often, Made everything Smoother, Fixed up the bury bones(BuryAll) method

//There are [12] simple antileeches//

{$Define SMART}
{$i srl/srl.simba}
{$i P07Include.simba}

var
x, y: Integer;
Combat1, num1, num2, attnum, bonesInv, buriedBones, Bonecount, MAttacked:
////// CHOOSE TO BURY BONES //////
Function BuryBones; <--------------------------------------------------- Line 27
begin;
result := false; //true to bury, false to not.
end;
const

// REQUIRED CONFIGURATION BY USER:
FightStyle = 2; // 1 = Att, 2 = Str, 3 = Contr, 4 = Def
MNick = 'ow'; // Monster name without the first letter
MFullName = 'Cow'; // Monster's full name
MColor = 2967635; // Monster Color 1
MColor2 = 7042951; // Monster Color 2
MColor3 = 11975872; // Monster Color 3
MColor4 = 5926535; // Monster Color 4

// OPTIONAL CONFIGURATION BY USER
ABan1 = 'Strength'; // First skill for the anti-ban to check
ABan2 = 'Hitpoints' // Second skill for the anti-ban to check
Loot1 = 'Coins'; // Loot 1 name including the first letter
LColor1 = 1479346; // Color of Loot 1 to pick up
Loot2 = 'Coins'; // Loot 2 name including the first letter
LColor2 = 1479346; // Color of Loot 2 to pick up

// DON'T CHANGE THIS UNLESS YOU'RE HAVING PROBLEMS //
BonesName = 'Bones';
BonesColor = 14145500;

procedure P07_DeclarePlayers;
begin
P07_PlayerName := 'USERNAME'; // Username for 07Scape
P07_PlayerPass := 'PASSWORD'; // Password for 07Scape
end;
// END OF CONFIGURATION

procedure P07_SetRun(Run: Boolean);
var
x, y: integer;
begin
if not P07_TabInventoryTab(12) then
begin
writeln('ERROR: Could not P07_TabInventoryTab(12) -> Error in P07 include or random! Exiting');
Exit;
end;
if (FindColor(x, y, 4342852, 627, 416, 658, 444)) then
begin
writeln('-> Run = on!');

mouse(x, y, 1, 1, 1);
end;
writeln('-> Going to inventory tab');
P07_TabInventoryTab(4);
end;

procedure SetMeUp;
begin
writeln('-- Configuring player --');
writeln('-> Checking AutoRetaliate.');
P07_AutoRetaliate(true);
writeln('-> Checking CombatStance');
if(FightStyle = 0) then
begin
writeln('ERROR: Please fill in the FightStyle settings!');
TerminateScript;
end;
P07_CombatStance(FightStyle);
writeln('-> CombatStance = '+Inttostr(FightStyle)+'');
writeln('-> Making Compass South');
P07_MakeCompassSouth;
writeln('-> Making Camera Angle High');
P07_MakeCameraAngleHigh;
P07_SetRun(true);
writeln('-- Configuration completed --');
writeln('');
progressreport;
buriedBones := 0;
bonesInv := DTMFromString('mQwAAAHicY2ZgYJjNxMCwAIgnA/FTIP8FED8G4uWzZwFJRoYNS5YwsAJZMMyIhIEAAG7VCG8=');
end;

procedure ProgressReport;
begin
Wait(5000);
writeln(' ');
writeln(' ');
writeln(' ');
writeln(' ');
writeln(' ');
writeln(' ');
writeln('-- AIO Fighter Release 0.1 ---------');
writeln('-------------------------------------');
writeln('-Time Running: '+TimeRunning+'!');
writeln('-------------------------------------');
Writeln('-'+MFullName+'s Attacked: ' + intToStr(MAttacked);
if BuryBones = true then
begin
Writeln('-Bones buried: ' + intToStr(buriedBones));
Writeln('-Prayer Exp gained: ' + intToStr(buriedBones*4));
Writeln('-Bones currently in inventory: ' + intToStr(boneCount));
end;
end;

procedure Random1;
begin
attnum := (Random(1000));
end;

procedure Attack;
var x, y: Integer;
begin
wait(500 + random(800))
if P07_FindObjCustom(x,y, ['ttack', MNick], [MColor, MColor2, MColor3, MColor4], 5) then
begin
if combat1 = (0) then
begin
P07_MouseBox(X, Y, X, Y, mouse_left);
wait(random(500));
MAttacked = MAttacked + 1;
end;
end;
progressreport
end;
procedure freeDTMz;
begin
FreeDtm(bonesInv);
end;
procedure buryAll
var repeatCounter :Integer;
begin
repeatCounter := 0;
FindDTM(bonesInv,x,y,559, 214,726, 463);
repeat
Mouse(x,y,3,3,true);
sleep(900 +(random(700));
repeatCounter := repeatCounter + 1;
buriedBones := buriedBones + 1;
ProgressReport;
until(FindDTM(bonesInv,x,y,559, 214,726, 463) = false);
end;
procedure boneReset;
begin
if boneCount <> 0 then
boneCount := 0;
end;
procedure Combat;
begin;
Combat1 := 1;

if (FindColor(X, Y, 65280, 220, 110, 330, 220)) then
begin
progressreport;
WriteLn('In Combat . . .);
Mouse(
end
else Combat1 := 0;
if BuryBones = true then
if P07_FindObjCustom(x,y, [BonesName], [BonesColor], 5) then
begin
wait (randomrange(100, 200));
ClickMouse2(mouse_right);
wait(randomrange(400, 900));
P07_ChooseOptionMulti([BonesName]);
boneCount := boneCount + 1;
progressreport;
end;
if (FindColor(X, Y, 65280, 220, 110, 330, 220)) = false then
if Loot1 = ('') = false then
if P07_FindObjCustom(x,y, [Loot1], [LColor1], 5) then
begin
wait (randomrange(100, 200));
ClickMouse2(mouse_right);
wait(randomrange(400, 900));
P07_ChooseOptionMulti([Loot1]);
progressreport;
end;
if Loot2 = ('') = false then
if P07_FindObjCustom(x,y, [Loot2], [LColor2], 5) then
begin
wait (randomrange(100, 200));
ClickMouse2(mouse_right);
wait(randomrange(400, 900));
P07_ChooseOptionMulti([Loot2]);
progressreport;
end;
if Loot3 = ('') = false then
if P07_FindObjCustom(x,y, [Loot3], [LColor3], 5) then
begin
wait (randomrange(100, 200));
ClickMouse2(mouse_right);
wait(randomrange(400, 900));
P07_ChooseOptionMulti([Loot3]);
progressreport;
end;
if Loot4 = ('') = false then
if P07_FindObjCustom(x,y, [Loot4], [LColor4], 5) then
begin
wait (randomrange(100, 200));
ClickMouse2(mouse_right);
wait(randomrange(400, 900));
P07_ChooseOptionMulti([Loot4]);
progressreport;
end;
progressreport;
end;

Procedure Antiban;
Begin
Writeln('Starting Anti-ban');
num2 := (5);
num1 = (random(27));
sleep(2000)
if num2 < num1 then
Case Random(10) Of
1: P07_HoverSkill(ABan1,RandomRange(2500,3500));
Writeln('Anti-Ban chosen - Hover skill' +ABan1+'!');
3: Boredhuman;
Writeln('Anti-Ban chosen this will be a breif pause!');
4: Wait(2500 + random(4500));
Writeln('Anti-Ban chosen - Pausing for a breif moment');
5: p07_HoverSkill(ABan2,RandomRange(2500,3500));
Writeln('Anti-Ban chosen - Hover skill' +ABan2+'!');
6: PickUpMouse;
Writeln('Anti-Ban chosen this will be a breif pause!');
7: RandomMovement;
Writeln('Anti-Ban chosen - Creating a random movement');
8: RandomRClick;
Writeln('Anti-Ban chosen - Random right click');
9: P07_MakeCompassdegree(randomrange(0, 360));
Writeln('Anti-Ban chosen - Hover skill' +ABan1+'!');
end;
progressreport;
end;

begin
P07_DeclarePlayers;
Addonterminate('freeDTMz');
SetupSRL();
SetupP07Include;
ClearDebug;
writeln('Welcome to the upgraded AIO fighter');
writeln('Please thank Phury and Shorteh96 for making this possible');
writeln('');
if (not P07_LoggedIn) then
P07_LogInPlayer;
SetMeUp;
repeat
if (not P07_LoggedIn) then
begin
P07_LogInPlayer;
SetMeUp;
end;
if combat1 = 0 then
Random1;
Combat;
if(P07_InvFull) then
begin
wait(2500);
buryAll;
boneReset;
end;
if Combat1 = 0 then
Attack;
Antiban;
progressreport
wait(2000 + random(100));
until (false)

Netzone

2013-03-12 08:44:09

Use the
 tags, it makes it much easier to read. As it is now, on line 27 put a semi-colon instead of a colon.

crealite

2013-03-12 10:08:32

I just cant seem to get it :P Even though I use a semi-colon it still keeps saying that a colon(':') is expected at line 27

Kevin

2013-03-12 10:18:25


Combat1, num1, num2, attnum, bonesInv, buriedBones, Bonecount, MAttacked:
////// CHOOSE TO BURY BONES //////
Function BuryBones; <--------------------------------------------------- Line 27
You are missing a lot of stuff that will cause errors in these 2 lines. Line 25 is what's missing the semicolon. Line 25 does not declare a variable type for the variables you declare. And line 27 also does not declare a return type for the function (if you don't want to return a variable from it, then simply name it a 'procedure' instead of a 'function'.

There very may be other errors throughout your code, but that's what I saw from the glance at your erring lines. Good luck!

crealite

2013-03-12 10:42:45

Alright, that didn't really help to make it right, but thanks anyways for the tips.

Kevin

2013-03-12 10:57:26

Here you name 2 variables (x and y) and give them the type integer, followed by a semicolon. (this line is good, but it's the example of done well)

x, y: Integer;
Here you name 8 variables, but you don't give them a type after the ":" and the line does not end with a semicolon (2 of the errors I describe).
Combat1, num1, num2, attnum, bonesInv, buriedBones, Bonecount, MAttacked:

Here you declare a procedure and don't return anything (this line is good, but it's the example of done well):

procedure P07_SetRun(Run: Boolean);
Here you declare a procedure as a function instead (like I tried to say)
Function BuryBones;

crealite

2013-03-12 11:01:21

Doing these changes gives a error such as "[Error] C:\Users\********\Downloads\[Upgraded] AIO Fighter.simba(30:11): Unknown identifier 'result' at line 29"
Sorry for all these question, Im just so hopepless when it comes to scripts and such cause its difficult to understand some of the terms not being a native english speaker

Kevin

2013-03-12 11:04:48

Looking further down (as I admitted only looking up to line 27 before) you have this:
Function BuryBones;   <--------------------------------------------------- Line 27
begin;
result := false; //true to bury, false to not.
end;
Why do you have a function that does nothing but return false? Is this for a user setting? If that is the case, then I suggest something more like:
const
BuryBones = false; //true to bury, false to not.
That way it's more setting oriented and you aren't calling a function to check something that is constant for the length of your script runtime.

crealite

2013-03-12 11:12:24

Yes indeed it is a user setting, but if I try to change it to const it just gives more errors. And it should work like that with few corrections on lines 19, 20, 22, 24, 26, 33, 35 (told by the guy who originally made this)
{$Define SMART}
{$i srl/srl.simba}
{$i P07Include.simba}

var
x , y: Integer;
Combat1, num1, num2, attnum, bonesInv, buriedBones, Bonecount, MAttacker: Integer;
////// CHOOSE TO BURY BONES //////
procedure BuryBones;
begin;
BuryBones = false; //true to bury, false to not.
end;
const

// REQUIRED CONFIGURATION BY USER:
FightStyle = 2; // 1 = Att, 2 = Str, 3 = Contr, 4 = Def
MNick = 'ow'; // Monster name without the first letter
MFullName = 'Cow'; // Monster's full name
MColor = 2967635; // Monster Color 1
MColor2 = 7042951; // Monster Color 2
MColor3 = 11975872; // Monster Color 3
MColor4 = 5926535; // Monster Color 4

Kevin

2013-03-12 11:23:21

{$Define SMART}
{$i srl/srl.simba}
{$i P07Include.simba}

var
x, y, Combat1, num1, num2, attnum, bonesInv, buriedBones, Bonecount, MAttacker: Integer;

const

// REQUIRED CONFIGURATION BY USER:
BuryBones = false; //true to bury, false to not.
FightStyle = 2; // 1 = Att, 2 = Str, 3 = Contr, 4 = Def
MNick = 'ow'; // Monster name without the first letter
MFullName = 'Cow'; // Monster's full name
MColor = 2967635; // Monster Color 1
MColor2 = 7042951; // Monster Color 2
MColor3 = 11975872; // Monster Color 3
MColor4 = 5926535; // Monster Color 4

It should be able to look like this without any errors. Granted, I'm writing this entirely within a browser as I don't have access to SIMBA atm, but this should be just fine.

crealite

2013-03-12 11:27:34

Alrigh, thanks alot. Got that part working finally, though seems like I've messed up something at the end since it gives me now a type mismatch error at line 93.
P07_CombatStance(FightStyle);
writeln('-> CombatStance = '+Inttostr(FightStyle)+'');
writeln('-> Making Compass South');
P07_MakeCompassSouth;
writeln('-> Making Camera Angle High');
P07_MakeCameraAngleHigh;
P07_SetRun(true); <----------------------------------this line being the 93rd
writeln('-- Configuration completed --');
writeln('');
progressreport;
buriedBones := 0;
bonesInv := DTMFromString('mQwAAAHicY2ZgYJjNxMCwAIgnA/FTIP8FED8G4uWzZwFJRoYNS5YwsAJZMMyIhIEAAG7VCG8=');
end;

Kevin

2013-03-12 11:38:06

Can't help with P07 issues as I have done absolutely 0 scripting for 07. Sorry, perhaps someone else can help you with that now.

Brid Mayhem

2013-03-13 02:09:32

I told you where each error subsides, each line they originated from. I specifically asked not to ask for further help as well. Mod/admin please close this thread.