I have some sort of problem with the function "CastSpell(35)". It says that its an unkown identifier but I didn't think you would need to identify it.
Script below:
SCAR Code:
Program AutoAlcher;
{.include SRL/SRL.scar}
Var
AlchesDone, x,y :integer;
Const
NumberOfAlches = 10; //How many alches you want to do
Magelvl = '1'; //Type your mage lvl in for auto-respond
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';//Your runescape username
Players[0].Pass := '';//Your runescape password
Players[0].Nick := '';//3 letter of your runescape username
Players[0].Active := True;
End;
Var
DTM: integer;
Procedure DeclareDTM;
Begin
DTM := DTMFromString('78DA637CCDC4C0A0C9C80002CC0C10F0FF3F0' +
'3831C906604B3FFFF677C03546388AA26292A0AAE060418DF03D5' +
'E8A3AA99D6C88BAAE62B508D2EAA9A4513D351D57C04AA3140550' +
'3924551F301D3AE0DD3F951D40000D0AA12BB');
End;
Procedure ClickHighAlch;
Begin
if CastSpell(35) then
Begin
WriteLN('Click High Alch');
WriteLN('Clicking Yew Long');
End;
if not CastSpell(35) then
Begin
WriteLN('Cant cast High Alch');
WriteLN('Make sure you have anough runes');
End;
End;
Procedure ClickYewLong;
Begin
if(FindDTM(DTM,x,y,1,1,799,600))then
Begin
Mouse(x,y,2,2,true);
End;
Wait(800 + random(150))
if not(FindDTM(DTM,x,y,1,1,767,503)) then
Begin
WriteLN('Couldnt find any yew longs');
WriteLN('Logging out and terminating script');
Logout;
TerminateScript;
End;
End;
Procedure Alch;
Begin
Gametab(7);
Repeat
ClickHighAlch;
Wait(500 + random(300))
ClickYewLong;
Wait(1900 + random(300))
Until (AlchesDone >= NumberOfAlches);
AlchesDone := AlchesDone + 1
End;
Function InChatLine(myString: string): Boolean;
Begin
Result := ( pos(myString, TheLine) <> 0 );
End;
Function ChatBack: Boolean; // By Lorax(SL Scripts)
Begin
SaveToChatLog;
if ( OldLine = TheLine ) or ( pos(Players[CurrentPlayer].Nick, TheName) <> 0 ) then
Exit;
if InChatLine(Players[CurrentPlayer].Nick) then
Begin
Wait(1000 + Random(500));
case Random(6) of
0: TypeSend('hello');
1: TypeSend('hi');
2: TypeSend('hey');
3: TypeSend('hey you');
4: TypeSend('yo');
5: TypeSend('sup?');
End;
Result := True;
Exit;
End;
if ( InChatLine('mage') or InChatLine('magic') or InChatLine('age') ) and
( InChatLine('lv') or InChatLine('leve') ) then
Begin
Wait(1000 + Random(500));
case Random(2) of
0: TypeSend ('im '+(magelvl)+'');
1: Typesend ('me,'+(magelvl)+'.');
End;
Result := True;
Exit;
End;
if InChatLine('hi ') or InChatLine('ello') or InChatLine('sup') or
InChatLine('whats up') then
Begin
Wait(1000 + Random(500));
case Random(4) of
0: TypeSend('hello');
1: TypeSend('hey');
2: TypeSend('hey there');
3: TypeSend('hi');
End;
Result := True;
Exit;
End;
if InChatLine('lol') or InChatLine('hehe') or InChatLine('hihi') or
InChatLine('haha') then
Begin
Wait(1000 + Random(500));
case Random(4) of
0: TypeSend('...');
1: TypeSend('lool');
2: TypeSend('rofl');
End;
Result := True;
Exit;
End;
Result := True;
Exit;
End;
Procedure ProgressReport;
Begin
ClearDebug
WriteLn('<<<<<<<<<<<<Auto Alcher v1.0>>>>>>>>>>>>');
WriteLn('Alched for ' + TimeRunning + ' ');
WriteLn('Did ' + IntToStr(AlchesDone) + ' High Alches ');
WriteLn('Earnt ' + IntToStr(AlchesDone * 65) + ' XP');
WriteLn('<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>');
WriteLn(' ');
WriteLN('Please post progress reports on thread')
WriteLn(' ')
Wait(2000 + random(200))
End;
Procedure AntiRandoms;
Begin
ChatBack;
FindNormalRandoms;
FindTalk;
End;
Procedure Prepare;
Begin
SetupSRL;
ClearDebug;
DeclareBMPs;
ActivateClient;
Wait(10);
DeclarePlayers;
Wait(10);
LoginPlayer;
Wait(10);
SRLRandomsReport;
GameTab(7);
End;
Begin
Prepare;
Repeat
if (Not(LoggedIn)) then
Exit;
Alch;
AntiRandoms;
ProgressReport;
Until (AlchesDone >= NumberOfAlches);
If (AlchesDone >= NumberOfAlches) then
Logout;
ProgressReport;
FreeDTM(DTM);
End.
All help very apreciated