Coh3n
2011-04-28 12:53:05
I discovered the other day that the MSI Player Remote extension didn't compile, so I decided to check it out. Thing is, it doesn't say why, it just says
Here's the extension
Thanks,
Cohen
Loading extension C:\Simba\Extensions\msi_player_remote.sex
Extension Disabled - Did not compile
I've tried compiling it while open in Simba as well, but I got the same thing.Here's the extension
(**
* This extension was developed by Shuttleu. If you have any questions
* concerning this extension, please post in the MSI Forums here:
* [url]http://villavu.com/forum/forumdisplay.php?f=313[/url]
*
* - Coh3n
*
* - This extension was last updated 07 September 2010 by Coh3n
*)
program MSI_Player_Remote;
const
SKILL_ATTACK = 0;
SKILL_DEFENCE = 1;
SKILL_STRENGTH = 2;
SKILL_HITPOINTS = 3;
SKILL_HP = SKILL_HITPOINTS;
SKILL_RANGE = 4;
SKILL_PRAYER = 5;
SKILL_MAGIC = 6;
SKILL_COOKING = 7;
SKILL_WOODCUTTING = 8;
SKILL_FLETCHING = 9;
SKILL_FISHING = 10;
SKILL_FIREMAKING = 11;
SKILL_CRAFTING = 12;
SKILL_SMITHING = 13;
SKILL_MINING = 14;
SKILL_HERBLORE = 15;
SKILL_AGILITY = 16;
SKILL_THIEVING = 17;
SKILL_SLAYER = 18;
SKILL_FARMING = 19;
SKILL_RUNECRAFTING = 20;
SKILL_HUNTER = 21;
SKILL_CONSTRUCTION = 22;
SKILL_SUMMONING = 23;
SKILL_DUNGEONEERING = 24;
PLAYER_TXT_PATH = IncludePath + 'MSI\Remote.txt';
type
TPlayer = record
Scripts: TStringArray;
Location: string;
Active: boolean;
LengthOfScripts: integer;
end;
TPlayerArray = array of TPlayer;
var
Players: TPlayerArray;
HowManyPlayers: Integer;
Locations, ScriptNames: TStringArray;
VarPageControl: TPageControl;
TabPages: array of TTabSheet;
MainForm: TForm;
ActiveLabel: array of TLabel;
ScriptLabel: array of array of TLabel;
LocationLabel: array of TLabel;
ActiveBox: array of TCheckBox;
Script: array of array of TComboBox;
Location: array of TComboBox;
Done: array of TButton;
Cancel: array of TButton;
function MostScripts: Integer;
var
I: Integer;
begin
for I := 0 to High(Players) do
if (Players[I].LengthOfScripts > Result) then
Result := Players[I].LengthOfScripts;
end;
// Procedure printed from printLocations() in ExtensionTools.simba (MSI/Extensions/)
procedure LoadLocations();
begin
Locations := ['Powerskilling', 'Lost', '', '', '', '', '', '', '', '', 'Varrock East Trees', 'Varrock East Oaks', 'Varrock East Bank', 'Varrock East Mine', 'Varrock East Fountain', 'Varrock West Bank', 'Varrock West Mine', '', '', '', 'Grand Exchange Bank', 'Grand Exchange Yews', '', '', '', '', '', '', '', '', 'Draynor Village Bank', 'Draynor Village Willows', 'Draynor Village Trees', 'Draynor Village Oaks', 'Draynor Village Fishing Spots', 'Draynor Village Clay Mine', 'Draynor Village Yews', '', '', '', 'Rimmington Yews', 'Rimmington Clay Rocks', 'Rimmington Tin Rocks', 'Rimmington Copper Rocks', 'Rimmington Iron Rocks 1', 'Rimmington Iron Rocks 2', 'Rimmington Gold Rocks', 'Rimmington Willows', '', '', 'Falador East Bank', 'Falador West Bank', 'Falador West Mine', '', '', '', '', '', '', '', 'Port Sarim Willows', 'Port Sarim Yews', 'Port Sarim Deposit Box', '', '', '', '', '', '', '', 'Lumbridge Swamp West Mine', 'Lumbridge Swamp East Mine', '', '', '', '', '', '', '', '', 'Edgeville Bank', 'Edgeville Yews', '', '', '', '', '', '', '', '', 'Barbarian Village Mine', 'Barbarian Village Fishing Spot', '', '', '', '', '', '', '', '', 'Seers Village Magic Trees', 'Seers Village Bank', 'Seers Village Maples', 'Seers Village Yews', '', '', '', '', '', '', 'Mining Guild', '', '', '', '', '', '', '', '', '', 'Al Kharid Bank', 'Al Kharid Cooking Range', 'Stiles On Karamja', 'Karamja Fishing Spot', '', '', '', '', '', '', 'Catherby Bank', 'Catherby Fishing Spots'];
ScriptNames := ['', '', '', '', '', '', '', '', '', '', 'Powerchopper', 'Varrock East Trees', 'Varrock East Oaks', 'Grand Exchange Yews', 'Draynor Willows', 'Draynor Normals', 'Draynor Oaks', 'Draynor Village Yews', 'Rimmington Yews', 'Rimmington Willows', 'Port Sarim Willows', 'Port Sarim Yews', 'Seers Village Magics', 'Seers Village Maples', 'Seers Village Yews', 'Edgeville Yews', '', '', '', '', 'Powerminer', 'Varrock East Miner', 'Varrock West Miner', 'Lumby Swamp West Miner', 'Barbarian Village Miner', 'Rimmington Clay Miner', 'Rimmington Tin Miner', 'Rimmington Copper Miner', 'Rimmington Iron Miner 1', 'Rimmington Iron Miner 2', 'Rimmington Gold Miner', '', 'Draynor Clay', 'Falador West Miner', '', '', '', '', '', '', 'Powerfisher', 'Draynor Village Fisher', 'Barbarian Village Fisher', '', 'Catherby Fisher', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'Al-Kharid Cooker', '', '', '', '', '', '', '', '', '', 'Alcher', '', '', '', '', '', '', '', '', '', ''];
end;
procedure SetupPlayers;
var
I, J: Integer;
begin
SetArrayLength(Players, HowManyPlayers);
for I := 0 to High(Players) do
with Players[I] do
begin
Active := StrToBool(ReadINI(IntToStr(I), 'Active', PLAYER_TXT_PATH));
Location := Locations[StrToInt(ReadINI(IntToStr(I), 'Location', PLAYER_TXT_PATH))];
LengthOfScripts := StrToInt(ReadINI(IntToStr(I), 'ScriptAmount', PLAYER_TXT_PATH));
SetLength(Scripts, LengthOfScripts);
for J := 0 to High(Scripts) do
Scripts[J] := ScriptNames[StrToInt(ReadINI(IntToStr(I), 'Script' + IntToStr(J), PLAYER_TXT_PATH))];
end;
end;
procedure SetupGlobals;
var
I, L: Integer;
begin
L := Length(Players);
SetLength(TabPages, L);
SetLength(ActiveLabel, L);
SetLength(ScriptLabel, L);
SetLength(LocationLabel, L);
SetLength(ActiveBox, L);
SetLength(Script, L);
SetLength(Location, L);
SetLength(Done, L);
SetLength(Cancel, L);
for I := 0 to High(Players) do
begin
SetLength(ScriptLabel[I], Players[I].LengthOfScripts);
SetLength(Script[I], Players[I].LengthOfScripts);
end;
end;
var
MSIMenu, PlayerMenuItem: TMenuItem;
procedure Click(Sender: TObject);
var
I, J, K: integer;
begin
for I := 0 to High(Players) do
begin
if (Sender = Cancel[I]) then
begin
WriteLn('Canceled...');
MainForm.ModalResult := mrOk;
Exit;
end;
if (Sender = Done[I]) then
begin
WriteLn('Saving...');
WriteINI('Changed', 'Changed', 'True', PLAYER_TXT_PATH);
for J := 0 to High(Players) do
begin
WriteINI(IntToStr(J), 'Active', BoolToStr(ActiveBox[J].Checked), PLAYER_TXT_PATH);
for K := 0 to High(Locations) do
if (Locations[K] = Location[J].Text) then
WriteINI(IntToStr(J), 'Location', IntToStr(K), PLAYER_TXT_PATH);
end;
MainForm.ModalResult := mrOk;
Exit;
end;
end;
end;
procedure InitTabs;
var
I, X: integer;
begin
MainForm := TForm.Create(nil);;
with MainForm do
begin
BorderStyle := bsSingle;
SetBounds(350, 150, 400, 93 + 25);
Caption := 'MSI Player Remote developed by Shuttleu';
end;
VarPageControl := TPageControl.Create(MainForm);
with VarPageControl do
begin
Parent := MainForm;
Align := alClient
end;
for I := 0 to High(Players) do
begin
TabPages[I]:= TTabSheet.Create(MainForm);
with TabPages[I] do
begin
Caption := 'Player ' + Inttostr(I);
PageControl := VarPageControl;
end;
ActiveLabel[I] := TLabel.Create(TabPages[I]);
with ActiveLabel[I] do
begin
Parent := TabPages[I];
Font.Style := [fsBold];
Left := 145;
Top := 25;
Width := 25;
Height := 15;
Caption := 'Active:';
end;
LocationLabel[I] := TLabel.Create(TabPages[I]);
with LocationLabel[I] do
begin
Parent := TabPages[I];
Font.Style := [fsBold];
Left := 145;
Top := 50;
Width := 30;
Height := 15;
Caption := 'Location:';
end;
ActiveBox[I] := TCheckBox.Create(TabPages[I]);
with ActiveBox[I] do
begin
Parent := TabPages[I];
Left := 215;
Top := 23;
Width := 17;
Height := 16;
TabOrder := 8;
Checked := Players[I].Active;
end;
Location[I] := TComboBox.Create(TabPages[I]);
with Location[I] do
begin
Parent := TabPages[I];
Left := 215;
Top := 48;
Width := 165;
Height := 21;
ItemHeight := 13;
TabOrder := 10;
Text := Players[I].Location;
with Items do
begin
for X := 0 to High(Locations) do
if (Length(Locations[X]) > 0)then
Add(Locations[X]);
end;
end;
Done[I] := TButton.Create(TabPages[I]);
with Done[I] do
begin
Parent := TabPages[I];
Left := 15;
Top := 13;
Height := 25;
Width := 100;
Caption := 'Save';
OnClick := @Click;
end;
Cancel[I] := TButton.Create(TabPages[I]);
with Cancel[I] do
begin
Parent := TabPages[I];
Left := 15;
Top := 48;
Height := 25;
Width := 100;
Caption := 'Cancel';
OnClick := @Click;
end;
end;
end;
procedure PRemote(Sender: TObject);
begin
if (Sender = PlayerMenuItem) then
begin
LoadLocations;
HowManyPlayers := StrToIntDef(ReadINI('HowMany', 'HowMany', PLAYER_TXT_PATH), -1);
if (HowManyPlayers > -1) then
begin
Writeln('Opening Player Remote');
SetupPlayers;
SetupGlobals;
InitTabs;
MainForm.ShowModal;
end else
Writeln('You have to run an MSI script before you can use the player remote!');
end;
end;
procedure FindMSIMenu;
var
I: integer;
begin
for I := 0 to Simba_MainMenu.Items.Count - 1 do
if (Simba_MainMenu.Items.Items[i].Caption = 'MSI') then
begin
MSIMenu := Simba_MainMenu.Items.Items[i];
Exit;
end;
MSIMenu := TMenuItem.Create(Simba_MainMenu);
MSIMenu.Caption := 'MSI';
MSIMenu.Visible := False;
Simba_MainMenu.Items.Add(MSIMenu);
end;
procedure Init;
begin
FindMSIMenu;
PlayerMenuItem := TMenuItem.Create(MSIMenu);
PlayerMenuItem.Caption := 'Player Remote';
PlayerMenuItem.OnClick := @PRemote;
MSIMenu.Add(PlayerMenuItem);
end;
procedure Attach;
begin;
MSIMenu.Visible := True;
end;
Procedure Detach;
begin
MSIMenu.Visible := False;
end;
function GetName : string;
begin;
result := 'MSI Player Remote';
end;
function GetVersion : string;
begin;
result := '1.0';
end;
begin
end.
Hopefully someone can help me out.Thanks,
Cohen
^(What I posted along with the MSI updater)
^(Just what I posted)