Naike
2008-02-29 15:28:09
Getting a Runtime error in my script after about an hour of alching and i dont have a clue why!
If you figure it out i give you a cookie and some milk xD
Good luck and may the best scripter win ;O
Script :
Error :
If you figure it out i give you a cookie and some milk xD
Good luck and may the best scripter win ;O
Script :
{==================================| SETUP |===================================}
program AutoAlcher;
const
YourSRLID = ''; // Your SRL stats account ID.
YourSRLPass = ''; // Your SRL stats account Password.
WorldNumber = 159; // S.M.A.R.T. world number.
Signed = True; // Use signed JAVA applet? True reccomended for less lag.
RunDir = 'N'; // Direction to run if fight is found.
{==================================| SETUP |====================================
======================| Don't touch anything below this! |======================
___ _ ___ _ _ _
/ _ \ | | / _ \| | | | | |
/ /_\ \_ _| |_ ___ / /_\ \ | ___| |__ ___ _ __| |
| _ | | | | __/ _ \| _ | |/ __| '_ \ / _ \ '__| |
| | | | |_| | || (_) | | | | | (__| | | | __/ | |_|
\_| |_/\__,_|\__\___/\_| |_/_|\___|_| |_|\___|_| (_)
- By N1KE! and EvilChicken!
Alchs any noted item anywhere. Have equal amount of noted items and nature
runes and noted items in inventory.
______________________________________________________________________________
| |
| INSTRUCTIONS: |
|______________________________________________________________________________|
1. Use with SCAR Divi 3.14 and Revision #14.
2. Setup line 5 - 9.
3. Have a fire staff equipped, and the same amount of nature runes and noted
items you want to alch in your inventory. This script alchs all noted items.
4. Press play.
5. Fill out form correctly.
6. SCAR minimizes and S.M.A.R.T. loads. Please wait.
7. Enjoy yourself (uuh..) while the script runs.
8. Post the progress report you get on the thread you got this script from.
}
{.include SRL/SRL/Misc/Smart.scar}
{.include SRL/SRL.scar}
{.include srl/srl/skill/magic.scar}
var
frmDesign: TForm; Plantes, FQ: Byte;
UserLabel, PassLabel, NickLabel: TLabel;
UserEdit, PassEdit, NickEdit: TEdit;
StartBottom, ExitBottom: TButton;
X, Y, AlchObject, Count, AlchItemColor,
ExpGot, CL, SL, LP, CLVL, RANCHCKEVERY: Integer;
Username, Password, Nickname: String;
EndInitForm: Boolean;
procedure Loader(sender: TObject);
begin
Username := UserEdit.Text;
Password := PassEdit.Text;
Nickname := NickEdit.Text;
frmDesign.ModalResult:= mrOk;
end;
procedure InitFormOnClose(Sender : TObject; var Action : TCloseAction);
begin
if (not(frmDesign.ModalResult = 1)) then
EndInitForm := True;
end;
Procedure DrawImages(Sender: TObject);
var
picture : Integer;
Begin
picture := BitmapFromString(200, 250, 'beNrt3dty2sgagFF' +
'bCImDwXYMxMnkWEnlnXKbyvs/gjNd6hqKAYMl0SIYrXWR8p7xvtid' +
'r/5uaYN0dfWH1H79+vX79++fP39e0v+oq6ur6+vrq3o0QPKurBU11' +
'Z9UukJXOFxxqfNqndY6Njlx/MjaSkhOpO3KjKKpLMtGo9F1ZbMcXd' +
'H6EBXEqMqyDD+EcsIPjui0NqrErtZH9PDn+heeDcy6sc9kMhmPx+t' +
'JtR5Tjli0Np1Oh8PhuOLoTiqDwSAMqFBX2qtCvZH8boM5RotrRl1h' +
'XvFK09r3OxYKXaEr+nnEcr4iVVe7H8qyUCTpyn14dIWu0Jiu+uzNm' +
'zenOcZz2ebz+YkHlzXvQ1S6IrnlcrlarXRFWo+PjyGtTkeWrvppNp' +
't115Vze28tFouQ1vH9bH5Dx30GTjmpdEVHUekKXWEfpOeZWQ3Wsix' +
'LlZbFpIuRZSl6ZTab3dzc2AdJ3lVHaTm399Zyuby9vV0sFg8PD11f' +
'FVrt/ghFzefz8GeqeeU+A5tbYf0HE+mKv3j1pyt0ha7Qla7QFbpCV' +
'LqiUUL1o9IVx48mXaErzrAr5ytcD3J5dVkWdIWu0BXoCl2hK9iy9S' +
'LL+mlZOg7XUpalrkhVVFm5ruiKhGJX63nV6Ihl9frp9vb25uZmPp9' +
'Pp9M8zw8PrqbDSleXarFYfPjw4dn3ldzd3cWowp/xWQ0HHk9U59Wo' +
'uuqPjx8//lN5eHi4rzw+PoaQYlRhTE0mkzCmppU6p/dGUenqIr179' +
'261Wi0qoajYUvghTKc4qdZPlSmK4pjv1OuqV8IO+P79+/BnHFObwy' +
'pM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mi9Glkxp7AbhnkVGgs/x//HOW1auuqzuBXGB0KGqOKD1HTF8e' +
'LIis+wTfWhPl0RxKN703O7C0b+Fl2hKwCA7i4Pt16O0+6Y5HqQtfX' +
'rS9o9hsiTi3j2K/OxqN15VfPdXrpi37AKtt5CuFtOnaJ0xZ/qe6nx' +
'y4Oxh31viLtqwqryZ+fdcLoi4dTaelmqrkgidLV+ZWrNw7moOJ6iO' +
'H1glgVdceJgdMW5HbSsDB0d4C0OuuKvZKMrOhpHjaLSFU13uppdSQ' +
'tdcQ4nc1shXVzr1UzLGnLM5Z6uSJWWC0M6PWLZDTm+qyMnG+wGk2S' +
'yQRc7JuiKV3HlCLribKPSFcmL0hXJc9IV3UWlK3TFmXRVpzfLRRej' +
'zJrQ3SiD47uyDugK+yDO7QJDV+iKsxLfFa4rXtdocr8dXXHm9w10R' +
'R37XhJ3oBNd8aKtl3nVSUVX1BlWjbo6Zh98enqy5v3pqv7IOvJw9V' +
'Sx7Bcvz/PDRemK099VaBGVrqSVKqqn/7O20kp4L1RXNKqrUVS6Iu1' +
'xXVqkHVm6oouptRmSrkgyuDZnlHnVt1q66OppP2tOu66eDrKSpL02' +
'BF2hKy44LYuDrminLMvj47EPsmUwGOR53tEtBV311nA4DF2Fuoqi0' +
'BUJ98HiP10corb/xb++9aaM');
SafeCopyCanvas(GetBitmapCanvas(picture), frmDesign.Canvas, 0, 0, 200, 250, 0, 0, 200, 250);
FreeBitmap(picture);
end;
procedure Proggy;
var
CTAB: Byte;
begin
Status('Printing progress report..');
ClearDebug;
CTAB := GetCurrentTab;
CL := GetSkillInfo('Magic', false);
GameTab(CTAB);
CLVL := SL - CL;
WriteLn(' ');
WriteLn(' ');
WriteLn('=========================================================');
WriteLn('=======| N1KE!&EvilChicken!''s AutoAlcher v0.21! |========');
WriteLn('---------------------------------------------------------');
Writeln('-> Ran for ' + TimeRunning + '.');
Writeln('-> Did ' + IntToStr(Count) + ' alches.');
Writeln('-> Got ' + IntToStr(Expgot) + ' magic XP.');
if CLVL > 0 then begin
Writeln('-> Gained ' + IntToStr(CLVL) + 'magic levels.');
ReportVars[1] := CLVL;
end;
if Plantes > 0 then
WriteLn('-> Handeled ' + IntToStr(Plantes) + ' plants.');
Writeln('=========================================================');
SRLRandomsReport;
end;
procedure StopScript;
begin
if(LoggedIn)then begin
Proggy;
LogOut;
end;
if(not(Players[0].loc = ''))then WriteLN(Players[0].loc);
TerminateScript;
end;
Procedure RandomAngle;
begin
if(not(loggedin))then exit;
Status('Rorating camera angle to random position..');
case random(4) of
0: Begin
KeyDown(vk_left);
FTWait(RandomRange(1, 16));
KeyUp(vk_left);
End;
1: Begin
KeyDown(vk_right);
FTWait(RandomRange(1, 16));
KeyUp(vk_right);
End;
2: Begin
KeyDown(vk_left);
FTWait(RandomRange(1, 7));
KeyUp(vk_left);
KeyDown(vk_right);
FTWait(RandomRange(1, 7));
KeyUp(vk_right);
End;
3: Begin
KeyDown(vk_right);
FTWait(RandomRange(1, 7));
KeyUp(vk_right);
KeyDown(vk_left);
FTWait(RandomRange(1, 7));
KeyUp(vk_left);
End;
End;
End;
Procedure AlchColorIs;
Begin
GameTab(4);
FTWait(RandomRange(2, 4)); // In case of lag.
if FindDtm(AlchObject, X, Y, MIX1, MIY1, MIX2, MIY2) then
AlchItemColor := GetColor(X, Y) else StopScript;
FreeDTM(AlchObject);
End;
Procedure AntiBan;
Begin
if(not(loggedin))then exit;
Status('Preforming antiban..');
case random(150) of
0,11,12: RandomMovement;
1,13: RandomRClick;
2,14: HoverSkill('magic', False);
3,15,16: RandomAngle;
4: GameTab(1 + Random(12));
5: SetRun(True);
6: SetAngle(True);
7: SetAngle(False);
8: DoEmote(1 + random(36));
9: Wait2(RandomRange(1000, 17000), true);
10: SleepAndMoveMouse(RandomRange(1000, 17000));
end;
end;
procedure Alch;
begin
Status('Alching..');
if(not(loggedin))then exit;
if not(CastSpell(35))then LogOut;
FTWait(RandomRange(3, 6));
if not GetCurrentTab = 4 then CastSpell(35) else begin
if not FindColor(X, Y, AlchItemColor, MIX1, MIY1, MIX2, MIY2)then
AlchColorIs else Mouse(x, y, 5, 5, True);
Inc(Count);
Inc(ReportVars[0]);
ExpGot := ExpGot + 65;
FTWait(RandomRange(3, 6));
End;
End;
procedure InFight;
begin
if FindColor(x, y, 65280, 230, 130, 280, 180) or FindColor(x, y, 255,
230, 130, 280, 180) then begin
Status('Found figthing random, avoiding..');
Inc(Fights);
RunAway(RunDir, true, 1, 25000);
end;
end;
procedure LoginPlayerLoop;// Hy, thanks mate.
var
CX, CY, ClickHereToPlay: Integer;
begin
if(Players[0].Active = False)then StopScript;
if(not(LoggedIn))then
begin
LoginPlayer;
FindNormalRandoms;
Exit;
end;
ClickHereToPlay := BitmapFromString(33, 1, 'z78DA758E510E80300843' +
'AF54C0E2F6E94CB8FF9134123392693FFA41FA4A23A6F0888443D' +
'26DC000A7DCE7F458F23EE444E721444B6A0F53D58FE44F4365B7' +
'067D37AC3D95AADF2F50962C79');
Wait(250);
if FindBitmap(cx, cy, ClickHereToPlay) then
begin
Mouse(CX, CY, 20, 20, True);
Wait(RandomRange(5000, 10000));
end;
FreeBitmap(ClickHereToPlay);
end;
procedure HandlePlant; // Originally taken from EvilChicken!s AgilityMiceTrainer.
begin
if FindColorSpiralTolerance(x, y, 945492, MSX1, MSY1, MSX2, MSY2, 5)then
begin
Status('Found plant random, handling..');
Mouse(x, y, 3, 3, true);
Wait(RandomRange(2000, 5000));
if(FindBlackChatMessage('ready'))then
begin
Wait(RandomRange(8000, 18000));
repeat
if FindColorSpiralTolerance(x, y, 878416, MSX1, MSY1, MSX2, MSY2, 5)then
begin
Mouse(x, y, 4, 4, true);
Wait(RandomRange(2500, 4000));
end;
until FindBlackChatMessage('fruit') or
not FindColorSpiralTolerance(x, y, 878416, MSX1, MSY1, MSX2, MSY2, 5);
ReportVars[0] := 1;
Inc(Plantes);
WriteLn('Plant handled!');
end;
end;
end;
procedure FindRandoms;
begin
Status('Searching for random events..');
LoginPlayerLoop;
InFight;
FindNormalRandoms;
Wait(1);
FindMod;
HandlePlant;
end;
procedure InitForm;
begin
frmDesign := CreateForm;
with frmDesign do
begin
OnClose := @InitFormOnClose;
OnPaint := @DrawImages;
BorderStyle := bsSingle;
BorderIcons := [];
Left := 259;
Top := 104;
ClientWidth := 225;
ClientHeight := 130;
Caption := 'This shouldnt be visible.';
Color := clBlack;
Font.Color := clWindowText;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
PixelsPerInch := 96;
BorderStyle := BsNone;
end;
UserLabel := TLabel.Create(frmDesign);
with UserLabel do
begin
Parent := frmDesign;
Left := 16;
Top := 16;
Width := 83;
Height := 19;
Caption := 'Username : ';
Font.Color := clWindowText;
Font.Height := -16;
Font.Name := 'Constantia';
Font.Style := [];
end;
PassLabel := TLabel.Create(frmDesign);
with PassLabel do
begin
Parent := frmDesign;
Left := 16;
Top := 48;
Width := 73;
Height := 19;
Caption := 'Password :';
Font.Color := clWindowText;
Font.Height := -16;
Font.Name := 'Constantia';
Font.Style := [];
end;
NickLabel := TLabel.Create(frmDesign);
with NickLabel do
begin
Parent := frmDesign;
Left := 16;
Top := 80;
Width := 80;
Height := 19;
Caption := 'Nickname :';
Font.Color := clWindowText;
Font.Height := -16;
Font.Name := 'Constantia';
Font.Style := [];
end;
UserEdit := TEdit.Create(frmDesign);
with UserEdit do
begin
Parent := frmDesign;
Left := 120;
Top := 16;
Width := 89;
Height := 21;
Hint := 'Type in username here.';
ParentShowHint := False;
ShowHint := True;
TabOrder := 8;
end;
PassEdit := TEdit.Create(frmDesign);
with PassEdit do
begin
Parent := frmDesign;
Left := 120;
Top := 48;
Width := 89;
Height := 21;
Hint := 'Type in password here.';
ParentShowHint := False;
ShowHint := True;
TabOrder := 9;
end;
StartBottom := TButton.Create(frmDesign);
with StartBottom do
begin
Parent := frmDesign;
Left := 64;
Top := 120
Hint := 'Click here to start the script.';
ParentShowHint := False;
ShowHint := True;
Width := 49;
Height := 25;
Caption := 'Start';
TabOrder := 10;
OnClick := @Loader;
end;
ExitBottom := TButton.Create(frmDesign);
with ExitBottom do
begin
Parent := frmDesign;
Left := 136;
Top := 120;
Width := 49;
Height := 25;
Caption := 'Exit';
Hint := 'Click here to exit.';
ParentShowHint := False;
ShowHint := True;
TabOrder := 11;
ModalResult := 5;
end;
NickEdit := TEdit.Create(frmDesign);
with NickEdit do
begin
Parent := frmDesign;
Left := 120;
Top := 80;
Width := 89;
Height := 21;
Hint := 'Type in nickname here.';
ParentShowHint := False;
ShowHint := True;
TabOrder := 12;
end;
end;
procedure SafeInitForm;
var
V : TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('InitForm', V);
end;
procedure ShowInitFormModal;
begin
frmDesign.ShowModal;
end;
procedure SafeShowInitFormModal;
var
V : TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('ShowInitFormModal', V);
end;
procedure MainInitForm;
begin
try
SafeInitForm;
SafeShowInitFormModal;
finally
FreeForm(frmDesign);
except
WriteLn('An error seems to have occurred in: InitForm');
end;
end;
Begin
ClearDebug;
Status('Setting up player..');
GetSelf.Visible := False;
MainInitForm;
GetSelf.Visible := True;
if(EndInitForm)then TerminateScript;
SmartSetupEx(WorldNumber, False, Signed);
GetApplication.Minimize;
SetTargetDC(SmartGetDC);
SetupSRL;
ScriptID := '671';
LampSkill := 'magic';
if(YourSRLID = '')or(YourSRLPass = '')then
begin
SRLID := '4066';
SRLPassword := 'helloworld';
end else
begin
SRLID := YourSRLID;
SRLPassword := YourSRLPass;
end;
FQ := RandomRange(30, 70);
RANCHCKEVERY := RandomRange(10, 35);
HowManyPlayers := 1;//Don't touch
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := Username;
Players[0].Pass := Password;
Players[0].Nick := Nickname;
Players[0].Active := True;
AlchObject := DTMFromString('78DA633CC8C4C010CEC8800C362DAA64F80FA' +
'441A2FF8180F122504D30AA1A902C23540D98B70DA82682809AC3' +
'40354904D49C07AA49C6AF06005A550C8B');
LoginPlayer;
SL := GetSkillInfo('Magic', false);
AlchColorIs;
MMouse(x, y, 4, 4);
FTWait(2); GetMousePos(x, y);
HoldMouse(x, y, true);
MMouse(573, 358, 4, 4);
FTWait(2);
GetMousePos(x, y);
ReleaseMouse(x, y, true);
FTWait(2);
repeat
if(NoGameTab)then FindRandoms;
if LP mod RANCHCKEVERY = 0 then FindRandoms;
if not(loggedin)then LogInPlayerLoop;
if LP mod FQ = 0 then Proggy;
Alch;
AntiBan;
Inc(LP);
until(not(LoggedIn));
StopScript;
end.Error :
[Runtime Error] : Exception: Access violation at address 007286DA in module 'scar.exe''. Read of address 00000000 in line 203