SRL Archive - Help and Support

Need help on Nickname - _ -


Naike

2008-02-24 06:30:31

Me and EvilChicken! Is making an AutoAlcher that will be in the Free for all section ;).
When you run you get Math.Scar popup! Has something to do with NickName i thing…
program AutoAlcher;
{.include SRL/SRL.scar}
{.include srl/srl/skill/magic.scar}


{==================================| SETUP |===================================}

const
YourSRLID = ''; // Your SRL stats account ID.
YourSRLPass = ''; // Your SRL stats account Password.

{==================================| SETUP |===================================}
{======================| Don't touch anything below this! |====================}

var
EndInitForm: Boolean;
frmDesign: TForm;
UserLabel, PassLabel, NickLabel, AlchLabel : TLabel;
UserEdit, PassEdit, NickEdit, AlchEdit: TEdit;
StartBottom, ExitBottom: TButton;
AlchingBox: TComboBox; FQ: Byte;
X, Y, AlchObject, Count, AlchAmount, AlchItemColor, ExpGot, CurrentLevel,
StartLevel, LoopPlayed, CLVL: Integer;
Username, Password, Nickname, Alchwhat : String;

procedure Loader(sender: TObject);
begin
Username := UserEdit.Text;
Password := PassEdit.Text;
Nickname := NickEdit.Text;
AlchAmount := StrToInt(AlchEdit.Text);
Alchwhat := AlchingBox.Text;
frmDesign.ModalResult:= mrOk;
end;

Procedure Exiter(sender: TObject);
Begin
frmDesign.ModalResult:= mrOk;
TerminateScript;
end;

procedure Proggy;
begin
Status('Printing progress report..');
ClearDebug;
CurrentLevel := GetSkillInfo('Magic', false);
CLVL := Startlevel - CurrentLevel;
WriteLn(' ');
WriteLn(' ');
WriteLn('=========================================================');
WriteLn('=======| N1ke! & EvilChicken!''S AutoAlcher v2! |========');
WriteLn('---------------------------------------------------------');
Writeln('-> Ran for ' + TimeRunning);
Writeln('-> Done ' + IntToStr(Count) + ' Alches');
Writeln('-> Got ' + IntToStr(Expgot) + ' magic exp');
if CLVL > 0 then begin
Writeln('-> Gained ' + IntToStr(CLVL) + 'magic levels.');
ReportVars[1] := CLVL;
end;
Writeln('=========================================================');
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 AntiBan;
Begin
if(not(loggedin))then exit;
Status('Preforming antiban..');
case random(160) of
0,8,9: RandomMovement;
1: RandomRClick;
2,13 : HoverSkill('magic', False);
3,10,11,12,14,15,16: RandomAngle;
4: GameTab(1 + Random(12));
5: SetRun(True);
6: SetAngle(True);
7: SetAngle(False);
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 FindColor(AlchItemColor, X, Y, MIX1, MIY1, MIX2, MIY2)then
MMouse(x, y, 5, 5) else LogOut;
Mouse(x, y, 5, 5, True);
Inc(Count);
Inc(ReportVars[0]);
ExpGot := ExpGot + 65;
FTWait(RandomRange(3, 6));
End;
End;

procedure InitFormOnClose(Sender : TObject; var Action : TCloseAction);
begin
if(not(frmDesign.ModalResult = 1))then
EndInitForm := True;
end;

procedure InitForm;
begin
frmDesign := CreateForm;
with frmDesign do
begin
OnClose := @InitFormOnClose;
BorderStyle := bsSingle;
BorderIcons := [];
Left := 259;
Top := 104;
ClientWidth := 225;
ClientHeight := 152;
Caption := 'This shouldnt be visible.';
Color := clLightBlue;
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 := 32;
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;
AlchLabel := TLabel.Create(frmDesign);
with AlchLabel do
begin
Parent := frmDesign;
Left := 40;
Top := 112;
Width := 66;
Height := 19;
Caption := ' Alches :';
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 := 48;
Width := 89;
Height := 21;
Hint := 'Username here!';
ParentShowHint := False;
ShowHint := True;
TabOrder := 8;
end;
PassEdit := TEdit.Create(frmDesign);
with PassEdit do
begin
Parent := frmDesign;
Left := 120;
Top := 16;
Width := 89;
Height := 21;
Hint := 'Password here!';
ParentShowHint := False;
ShowHint := True;
TabOrder := 9;
end;
StartBottom := TButton.Create(frmDesign);
with StartBottom do
begin
Parent := frmDesign;
Left := 64;
Top := 145;
Width := 49;
Height := 25;
Caption := 'Start';
TabOrder := 10;
ModalResult := MrOk;
end;
ExitBottom := TButton.Create(frmDesign);
with ExitBottom do
begin
Parent := frmDesign;
Left := 136;
Top := 145;
Width := 49;
Height := 25;
Caption := 'Exit';
TabOrder := 11;
ModalResult := 2;
end;
NickEdit := TEdit.Create(frmDesign);
with NickEdit do
begin
Parent := frmDesign;
Left := 120;
Top := 80;
Width := 89;
Height := 21;
Hint := 'Nickname here!';
ParentShowHint := False;
ShowHint := True;
TabOrder := 12;
end;
AlchEdit := TEdit.Create(frmDesign);
with AlchEdit do
begin
Parent := frmDesign;
Left := 120;
Top := 112;
Width := 89;
Height := 21;
Hint := 'How many alches you want to do?';
ParentShowHint := False;
ShowHint := True;
TabOrder := 13;
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;
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);
GetSelf.WindowState := wsMinimized;
MainInitForm;
GetSelf.WindowState := wsNormal;
if(EndInitForm)then
TerminateScript;
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;
Players[0].Integers[0] := AlchAmount;
Players[0].Strings[0] := AlchWhat;
AlchObject := DTMFromString('78DA637460626078CC800256CF2901D38C503' +
'EA33F50CD530634C088AAC604A8E61901353640351F08A8F101AA' +
'F944404D0050CD5D026A4C816AEEE3570300144A09FA');
LoginPlayer;
StartLevel := GetSkillInfo('Magic', false);
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 LogOut;
repeat
Alch;
AntiBan;
Inc(LoopPlayed);
if LoopPlayed mod FQ = 0 then Proggy;
until(Count > Players[0].Integers[0])or(not(LoggedIn));
LogOut;

End.


I get this message :
SRL Compiled in 15 msec
Creating the NickTPA.
Nickname isnt set, taking the username instead..
[Runtime Error] : Exception: in line 58 in script C:\Program\SCAR 3.14\includes\SRL/SRL/Core/Math.scar

Help me and get a cookie ;)

- Peace, N1ke!

mastaraymond

2008-02-24 06:52:18

From: N1ke!
Me and EvilChicken! Is making an AutoAlcher that will be in the Free for all section ;).
When you run you get Math.Scar popup! Has something to do with NickName i thing…
program AutoAlcher;
{.include SRL/SRL.scar}
{.include srl/srl/skill/magic.scar}


{==================================| SETUP |===================================}

const
YourSRLID = ''; // Your SRL stats account ID.
YourSRLPass = ''; // Your SRL stats account Password.

{==================================| SETUP |===================================}
{======================| Don't touch anything below this! |====================}

var
EndInitForm: Boolean;
frmDesign: TForm;
UserLabel, PassLabel, NickLabel, AlchLabel : TLabel;
UserEdit, PassEdit, NickEdit, AlchEdit: TEdit;
StartBottom, ExitBottom: TButton;
AlchingBox: TComboBox; FQ: Byte;
X, Y, AlchObject, Count, AlchAmount, AlchItemColor, ExpGot, CurrentLevel,
StartLevel, LoopPlayed, CLVL: Integer;
Username, Password, Nickname, Alchwhat : String;

procedure Loader(sender: TObject);
begin
Username := UserEdit.Text;
Password := PassEdit.Text;
Nickname := NickEdit.Text;
AlchAmount := StrToInt(AlchEdit.Text);
Alchwhat := AlchingBox.Text;
frmDesign.ModalResult:= mrOk;
end;

Procedure Exiter(sender: TObject);
Begin
frmDesign.ModalResult:= mrOk;
TerminateScript;
end;

procedure Proggy;
begin
Status('Printing progress report..');
ClearDebug;
CurrentLevel := GetSkillInfo('Magic', false);
CLVL := Startlevel - CurrentLevel;
WriteLn(' ');
WriteLn(' ');
WriteLn('=========================================================');
WriteLn('=======| N1ke! & EvilChicken!''S AutoAlcher v2! |========');
WriteLn('---------------------------------------------------------');
Writeln('-> Ran for ' + TimeRunning);
Writeln('-> Done ' + IntToStr(Count) + ' Alches');
Writeln('-> Got ' + IntToStr(Expgot) + ' magic exp');
if CLVL > 0 then begin
Writeln('-> Gained ' + IntToStr(CLVL) + 'magic levels.');
ReportVars[1] := CLVL;
end;
Writeln('=========================================================');
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 AntiBan;
Begin
if(not(loggedin))then exit;
Status('Preforming antiban..');
case random(160) of
0,8,9: RandomMovement;
1: RandomRClick;
2,13 : HoverSkill('magic', False);
3,10,11,12,14,15,16: RandomAngle;
4: GameTab(1 + Random(12));
5: SetRun(True);
6: SetAngle(True);
7: SetAngle(False);
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 FindColor(AlchItemColor, X, Y, MIX1, MIY1, MIX2, MIY2)then
MMouse(x, y, 5, 5) else LogOut;
Mouse(x, y, 5, 5, True);
Inc(Count);
Inc(ReportVars[0]);
ExpGot := ExpGot + 65;
FTWait(RandomRange(3, 6));
End;
End;

procedure InitFormOnClose(Sender : TObject; var Action : TCloseAction);
begin
if(not(frmDesign.ModalResult = 1))then
EndInitForm := True;
end;

procedure InitForm;
begin
frmDesign := CreateForm;
with frmDesign do
begin
OnClose := @InitFormOnClose;
BorderStyle := bsSingle;
BorderIcons := [];
Left := 259;
Top := 104;
ClientWidth := 225;
ClientHeight := 152;
Caption := 'This shouldnt be visible.';
Color := clLightBlue;
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 := 32;
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;
AlchLabel := TLabel.Create(frmDesign);
with AlchLabel do
begin
Parent := frmDesign;
Left := 40;
Top := 112;
Width := 66;
Height := 19;
Caption := ' Alches :';
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 := 48;
Width := 89;
Height := 21;
Hint := 'Username here!';
ParentShowHint := False;
ShowHint := True;
TabOrder := 8;
end;
PassEdit := TEdit.Create(frmDesign);
with PassEdit do
begin
Parent := frmDesign;
Left := 120;
Top := 16;
Width := 89;
Height := 21;
Hint := 'Password here!';
ParentShowHint := False;
ShowHint := True;
TabOrder := 9;
end;
StartBottom := TButton.Create(frmDesign);
with StartBottom do
begin
Parent := frmDesign;
Left := 64;
Top := 145;
Width := 49;
Height := 25;
Caption := 'Start';
TabOrder := 10;
ModalResult := MrOk;
end;
ExitBottom := TButton.Create(frmDesign);
with ExitBottom do
begin
Parent := frmDesign;
Left := 136;
Top := 145;
Width := 49;
Height := 25;
Caption := 'Exit';
TabOrder := 11;
ModalResult := 2;
end;
NickEdit := TEdit.Create(frmDesign);
with NickEdit do
begin
Parent := frmDesign;
Left := 120;
Top := 80;
Width := 89;
Height := 21;
Hint := 'Nickname here!';
ParentShowHint := False;
ShowHint := True;
TabOrder := 12;
end;
AlchEdit := TEdit.Create(frmDesign);
with AlchEdit do
begin
Parent := frmDesign;
Left := 120;
Top := 112;
Width := 89;
Height := 21;
Hint := 'How many alches you want to do?';
ParentShowHint := False;
ShowHint := True;
TabOrder := 13;
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;
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);
GetSelf.WindowState := wsMinimized;
MainInitForm;
GetSelf.WindowState := wsNormal;
if(EndInitForm)then
TerminateScript;
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;
Players[0].Integers[0] := AlchAmount;
Players[0].Strings[0] := AlchWhat;
AlchObject := DTMFromString('78DA637460626078CC800256CF2901D38C503' +
'EA33F50CD530634C088AAC604A8E61901353640351F08A8F101AA' +
'F944404D0050CD5D026A4C816AEEE3570300144A09FA');
LoginPlayer;
StartLevel := GetSkillInfo('Magic', false);
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 LogOut;
repeat
Alch;
AntiBan;
Inc(LoopPlayed);
if LoopPlayed mod FQ = 0 then Proggy;
until(Count > Players[0].Integers[0])or(not(LoggedIn));
LogOut;

End.


I get this message :
SRL Compiled in 15 msec
Creating the NickTPA.
Nickname isnt set, taking the username instead..
[Runtime Error] : Exception: in line 58 in script C:\Program\SCAR 3.14\includes\SRL/SRL/Core/Math.scar

Help me and get a cookie ;)

- Peace, N1ke!

Nickname isnt set, taking the username instead..


Obviously.. You haven't set the Player Array right..
Either you got empty players, or your player isn't set correctly.