Ok i guess ill just give some pointers =0
procedure DeclarePlayers;
var
I: Integer;
begin
NumberOfPlayers(100); //Dont touch
CurrentPlayer := 0;
with Players[0] do
begin
Name := ''
Pass := '';
Nick := '';
BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal'];
Active := True;
integers[0] := 1000 //times to alch
end;
for I := High(Players) downto 0 do
begin
if Players[i].Active then
begin
NumberOfPlayers(i + 1);
Break;
end;
end;
end;
can be
procedure DeclarePlayers;
begin
NumberOfPlayers(1); //Dont touch
CurrentPlayer := 0;
with Players[0] do
begin
Name := ''
Pass := '';
Nick := '';
BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal'];
Active := True;
integers[0] := 1000 //times to alch
end;
end;
as your script only will only take 1 character (no multiplayer)
procedure setup;
var
magiclvl : integer;
begin
magiclvl := getskilllevel(6);
writeln(magiclvl);
if (magiclvl < 21)then
begin
writeln('Noobs don`t deserve to alch...');
Logout;
terminatescript;
end;
if ( magiclvl > 20 )then
begin
writeln('Training,eh?');
option := 1;
if (magiclvl > 54)then
begin
writeln('Ok, set course to high alchemy!');
option := 2;
end;
end;
end;
Wont work as your missing a end;
Edit: Found the end; O.o ok mabye it would work but it would WriteLn that your training and using HighAlch O.o
alt:
procedure setup;
begin
case GetSkillLevel(skill_Mage) of
1..20: begin
Players[CurrentPlayer].Loc := 'Low Magic Level';
WriteLn('Noobs don`t deserve to alch...');
Logout;
TerminateScript;
end;
21..53: begin
Players[CurrentPlayer].Loc := 'Low Alch''ing';
WriteLn('Training, Eh?');
option := 1;
end;
54..99: begin
Players[CurrentPlayer].Loc := 'High Alch''ing';
WriteLn('Ok, set course to high alchemy!');
option := 2;
end;
else
begin
Players[CurrentPlayer].Loc := 'Unknow Magic Level';
WriteLn('Error getting Magic Level');
Logout;
TerminateScript;
end;
end;
end;
procedure checkforitems;
var
x,y,runedtm,itemdtm : integer;
begin
runedtm := DTMFromString('78DA637464626078C6800204AB45C0342394C' +
'FE80754738F010D30A1AAF106F2DF1150630AE4BF22A0C601C8FF' +
'845F0D00CE02069A');
itemdtm := DTMFromString('78DA633CC0C4C0F0980105385A89806946289' +
'FF12C50CD030634C084AAE63490FF91809A5D40FE7B026A3601F9' +
'CFF0AB0100CD8208F9');
gametab(tab_Inv);
wait(1000+random(2000));
if(FindDtm(runedtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
begin
if(FindDtm(itemdtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
begin
freeDTM(runedtm);
freedtm(itemdtm); // This needs to be in the begin..end nesting
writeln('Items and Runes found, proceeding to alch');
end else
begin
writeln('Items not found, quitting.');
// terminatescript;
NextPlayer(False); // Switches Players Instead
end;
end;
end;
will only free dtms if it finds them O.o
another note You dont use multiplayer properly so no NextPlayer;
fix:
procedure checkforitems;
var
x, y, runedtm, itemdtm: integer;
begin
runedtm := DTMFromString('78DA637464626078C6800204AB45C0342394C' +
'FE80754738F010D30A1AAF106F2DF1150630AE4BF22A0C601C8FF' +
'845F0D00CE02069A');
itemdtm := DTMFromString('78DA633CC0C4C0F0980105385A89806946289' +
'FF12C50CD030634C084AAE63490FF91809A5D40FE7B026A3601F9' +
'CFF0AB0100CD8208F9');
gametab(tab_Inv);
wait(1000+random(2000));
try
if(FindDtm(runedtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
if(FindDtm(itemdtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
writeln('Items and Runes found, proceeding to alch')
else
begin
writeln('Items not found, quitting.');
terminatescript;
end
else
begin
writeln('Items not found, quitting.');
terminatescript;
end;
finally
FreeDTM(runedtm);
FreeDTM(itemdtm);
end;
end;
begin
SetupSRL;
{$IfDef SMART}
Smart_Server := Smart_World;
Smart_Signed := Signed_SMART;
Smart_Members := Members_World;
{$EndIf}
DeclarePlayers;
LoginPlayer;
wait(2000+random(500));
setup;
checkforitems;
alch;
writeln('Succesfully finished alcheming. Good day!');
end.
Smart_Server, Smart_Signed and Smart_Members need to be set before SetupSRL;
begin
{$IFDEF SMART}
Smart_Server := Smart_World;
Smart_Signed := Signed_SMART;
Smart_Members := Members_World;
{$ENDIF}
SetupSRL;
DeclarePlayers;
Wait(100 + Randon(100));
LoginPlayer;
Wait(2000 + Random(500));
setup;
checkforitems;
alch;
WriteLn('Succesfully finished alcheming. Good day!');
end.
Last in Antiban;
0..3 : Wait(1);
Why Wait(1)? You wouldnt even notice it…. mabye Wait(100 + Random(1000));