PDA

View Full Version : [Reflection 2] Stun alcher BETA



Wizkid
07-24-2011, 04:12 PM
It's hell expensive to do stun alching, so I've only managed to come to a BETA stage.

It's stable, and works for now :)
Any donations is accepted! (Especially soul runes)

You need to start loggedin and already casted one stun on the NPC(so the script doesn't have to go look for it)

Fill in the form, and you're all set :o

Note: 150k/h magic experience


[===========================]
[ StunAlcher 0.1 BETA ]
[ by Wizkid ]
[===========================]
[ Time Running : 34M 57S ]
[ Start Level : 83 ]
[ Start XP : 2747403 ]
[ Gained Level(S) : 0 ]
[ Gained XP : 90210 ]
[ XP To Level : 113760 ]
[ XP/H : 154866 ]
[===========================]
[ StunAlcher 0.1 ]
[===========================]


program Stunalcher;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
{$i srl\srl\skill\magic.scar}
{$i srl\srl\misc\reports.scar}

var
Form: TVariantArray;
MyForm : TForm;
Edits: Array [0..3] of TEdit;
List: TComboBox;
CBoxs: Array [0..1] of TCheckBox;
SArr: TStringArray;
BArr: TBooleanArray;
Terminate: Boolean;
NPCName: String;

Const
i_StartExp = 0;
i_CurExp = 1;
i_xpHour = 2;
i_xpToLvl = 3;
i_CurLvl = 5;
i_StartLvl = 6;

procedure OnStart(Sender : TObject);
var
Run: Boolean;
begin;
Run := True;

If Lowercase(List.Text) = 'lampskill' then
begin
Run := False;
Writeln('Choose a lampskill!');
end;

If (Edits[0].Text = '')or(Edits[1].Text = '')or
(Edits[0].Text = 'Username')or(Edits[1].Text = 'Password')or
(Edits[2].Text = 'World')or(Edits[3].Text = '')or
(Edits[3].Text = 'NPC Name')then
begin
Run := False;
Writeln('Please fill in the form correctly!');
end;

If Run then
begin
SArr := [Edits[0].Text, Edits[1].Text, Edits[2].Text, List.Text, Edits[3].Text];
BArr := [CBoxs[0].Checked, CBoxs[1].Checked];

NPCName := SArr[4];

WriteINI('userinfo', 'user', SArr[0], ScriptPath + 'wizform.ini');
WriteINI('userinfo', 'pass', SArr[1], ScriptPath + 'wizform.ini');

WriteINI('otherinfo', 'lampskill', SArr[3], ScriptPath + 'wizform.ini');
WriteINI('otherinfo', 'npcname', SArr[4], ScriptPath + 'wizform.ini');

WriteINI('smartinfo', 'world', SArr[2], ScriptPath + 'wizform.ini');
WriteINI('smartinfo', 'member', BoolToStr(CBoxs[0].Checked), ScriptPath + 'wizform.ini');
WriteINI('smartinfo', 'signed', BoolToStr(CBoxs[1].Checked), ScriptPath + 'wizform.ini');

MyForm.ModalResult:= mrOk;
end;
end;

procedure OnExit(Sender : TObject);
begin;
MyForm.ModalResult:= mrOk;
Terminate := True;
end;

function FormInit: Boolean;
var
Button: Array [0..1] of TButton;
I: Integer;
tSArr: TStringArray;
begin;
Result := false;
MyForm := TForm.Create(nil);
MyForm.Width := 150;
MyForm.Height := 290;
MyForm.BorderStyle := bsSingle;
MyForm.Color := clWhite;
MyForm.Position := poDesktopCenter;

For I:=0 to 3 do
begin
Edits[I] := TEdit.Create(MyForm);
Edits[I].Parent := MyForm;
end;

For I:=0 to 1 do
Edits[I].SetBounds(20, 10+(I*35), 105, 30);

Edits[2].SetBounds(20, 90, 105, 30);
Edits[3].SetBounds(20, 130+(3*35), 105, 30);

Edits[1].PasswordChar := '*';

List := TComboBox.Create(MyForm);
List.Parent := MyForm;
List.SetBounds(20, 180, 105, 25);
tSArr := ['Lampskill', 'Attack', 'Strength', 'Defence', 'Range', 'Magic', 'Hitpoints',
'Prayer', 'runecrafting', 'Agility', 'Herblore', 'Theiving', 'Crafting',
'Fletching', 'Slayer', 'Mining', 'Smithing', 'Fishing', 'Cooking',
'Firemaking', 'Woodcutting', 'Farming', 'Construction', 'Hunter', 'Summoning'];
For I:=0 to High(tSArr)do
List.ITEMS.Add(tSArr[I]);

For I:=0 to 1 do
begin
CBoxs[I] := TCheckBox.Create(MyForm);
CBoxs[I].Parent := MyForm;
CBoxs[I].SetBounds(32, 115+(22*I), 25, 25);
end;
CBoxs[0].Caption := 'Members';
CBoxs[1].Caption := 'Signed';

For I:=0 to 1 do
begin
Button[I] := TButton.Create(MyForm);
Button[I].Parent := MyForm;
Button[I].SetBounds(25+(I*50), 263, 50, 25);
end;

Button[0].OnClick := @OnStart;
Button[0].Caption := 'Start';
Button[1].OnClick := @OnExit;
Button[1].Caption := 'Exit';

If ReadINI('userinfo', 'user', ScriptPath + 'wizform.ini') = '' then
begin
Edits[0].Caption := 'Username';
Edits[1].Caption := 'Password';
Edits[2].Caption := 'World';
Edits[3].Caption := 'NPC Name';
List.Caption := 'Lampskill';
end else
begin
Edits[0].Caption := ReadINI('userinfo', 'user', ScriptPath + 'wizform.ini');
Edits[1].Caption := ReadINI('userinfo', 'pass', ScriptPath + 'wizform.ini');
Edits[2].Caption := ReadINI('smartinfo', 'world', ScriptPath + 'wizform.ini');

Edits[3].Caption := ReadINI('otherinfo', 'npcname', ScriptPath + 'wizform.ini');
List.Caption := ReadINI('otherinfo', 'lampskill', ScriptPath + 'wizform.ini');


CBoxs[0].Checked := (ReadINI('smartinfo', 'member', ScriptPath + 'wizform.ini') = 'True');
CBoxs[1].Checked := (ReadINI('smartinfo', 'signed', ScriptPath + 'wizform.ini') = 'True');
end;

MyForm.ShowModal;
MyForm.Free;
end;

Procedure ShowForm;
begin
ThreadSafeCall('FormInit', Form);
end;

Procedure Setup;
begin
HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := SArr[0];
Players[0].Pass := SArr[1];
Players[0].Active := True;

LampSkill := SArr[3];
end;

Procedure SetSpellbook;
begin
SetSpellMode(True, False, True, False);
end;

Procedure AntiBan;
begin
If Not LoggedIn then
Exit;

Case Random(100)of
0: SleepAndMoveMouse(1000+Random(4000));
6..11: MakeCompass(Random(360));
12:
begin
GameTab(tab_Inv);
Wait(200+Random(1000));
GameTab(tab_Magic);
end;
13..16:
begin
GameTab(tab_Stats);
Wait(200+Random(1000));
GameTab(tab_Magic);
end;
end;
end;

Function SelectStun: Boolean;
var
iTime: Integer;
begin
MarkTime(iTime);
Result := GetCurrentTab = tab_Magic;
If Not Result then
Repeat
Wait(100+Random(150));
If (TimeFromMark(iTime) > 7000)then
begin
Result := GameTab(tab_Magic);
Break;
end;
until(GetCurrentTab = tab_Magic);

If Result then
MouseBox(589, 341, 603, 354, 1);
end;

Function CastStun: Boolean;
var
NPC: TNPC;
P: TPoint;
begin
If Not LoggedIn then
Exit;

If R_FindNPC(NPCName, False, NPC)then
begin

While Not GetCurrentTab = Tab_Magic do
Wait(100+Random(100));

If Not SelectStun then
begin
R_FindRandoms;
Exit;
end;

P := R_TileToMS(NPC.Tile, Round(NPC.Height div 2));
MMouse(P.X, P.Y, 2, 2);

If R_WaitUpText(NPCName, 200+Random(100))then
begin
GetMousePos(P.X, P.Y);
Mouse(P.X, P.Y, 0, 0, True);
Result := True;
end;

end;
end;

Function StunAlch: Boolean;
var
P: TPoint;
begin
If Not LoggedIn then
Exit;

Result := CastStun;
If Result then
begin
MouseBox(610, 292, 629, 307, 1);
Wait(20+Random(200));
GetMousePos(P.X, P.Y);
Mouse(P.X, P.Y, 0, 0, True);
Wait(250+Random(200));
end;
end;

Procedure SetupPlayer;
begin
SetAngle(True);
SetSpellbook;
GameTab(tab_Inv);
If Not Players[0].Booleans[0] then
begin
Players[0].Booleans[0] := True;

Players[0].Integers[i_StartExp] := R_GetSkillExp(SKILL_Magic);
Players[0].Integers[i_StartLvl] := R_GetSkillLevel(SKILL_Magic);
end;
end;

Procedure Report;
var
I: Integer;
begin
ClearDebug;

Players[0].Integers[i_CurLvl] := R_GetSkillLevel(SKILL_Magic);
Players[0].Integers[i_CurExp] := R_GetSkillExp(SKILL_Magic);
Players[0].Integers[i_xpToLvl] := R_GetSkillExpToLevel(SKILL_Magic);
Players[0].Integers[i_XpHour] := Round(((Players[CurrentPlayer].Integers[i_CurExp] - Players[CurrentPlayer].Integers[i_StartExp]) * 3600) div (GetTimeRunning div 1000));

SRLProgressReport(ResultDebugBox, 'StunAlcher', 'Wizkid', '0.1 BETA',
['Time running',
'Start level',
'Start XP',
'Gained level(s)',
'Gained XP',
'XP To level',
'XP/h'],
[MsToTime(GetTimeRunning, Time_Short),
Players[0].Integers[i_StartLvl],
Players[0].Integers[i_StartExp],
Players[0].Integers[i_CurLvl] - Players[0].Integers[i_StartLvl],
Players[0].Integers[i_CurExp] - Players[0].Integers[i_StartExp],
Players[0].Integers[i_xpToLvl],
Players[0].Integers[i_xpHour]]);
end;

begin
ShowForm;
If Terminate then
TerminateScript;

SMART_Members := BArr[0];
SMART_Server := StrToIntDef(SArr[2], -1);
SMART_Signed := BArr[1];

{Setup}
SetupSRL;
Setup;

If Not LoggedIn then
begin
Writeln('Please start loggedin and interacting with a NPC');
While Not LoggedIn do
Wait(1000);
end;

SetupPlayer;
Repeat
If Not LoggedIn then
begin
Writeln('Not LoggedIn');
NextPlayer(False);
SetupPlayer;
end;

Report;
StunAlch;
AntiBan;
R_FindRandoms;
Until(AllPlayersInactive);
end.

Home
08-03-2011, 07:06 AM
Looks great mate. Woah 150k / h? That's awsome :)

My bro will find use for this :P

~Home