Blockland Forums > Modification Help

Auto Loading Compass

Pages: (1/2) > >>

jes00:

Trying to make a script to auto load the compass, I cannot figure out why it does not work, to errors.

--- Code: ---//=========================================================================
// GUI Stuff
//=========================================================================
CompassWaypointGUI_File_Filename.delete();

CompassWaypointGUI_File.getObject(0).getObject(1).command = "CompassWaypointGUI.saveWaypointDelay();";
//Save button^^

CompassWaypointGUI_File.getObject(0).getObject(2).command = "CompassWaypointGUI.loadWaypointDelay();";
//Load button^^
//=========================================================================
// Functions
//=========================================================================
function CompassWaypointGUI::saveWaypointDelay()
{
%hostName = getSubStr($ServerInfo::Name, 0, strStr($ServerInfo::Name, "\'"));

%host = %host @ "'s server";

CompassWaypointGUI.saveWaypoints(%host);
}

function CompassWaypointGUI::loadWaypointDelay(%filename)
{
%hostName = getSubStr($ServerInfo::Name, 0, strStr($ServerInfo::Name, "\'"));

%host = %host @ "'s server";

if(isFile("config/client/WP/" @ %hostName @ "'s server.txt"))
CompassWaypointGUI.loadWaypoints(%host);
}

package Compass_Load
{
function serverConnection::onConnectionAccepted()
{
%host = getSubStr($ServerInfo::Name, 0, strStr($ServerInfo::Name, "\'"));


if(isFile("config/client/WP/" @ %host @ "'s server.txt"))
{
%filename = "config/client/WP/" @ %host @ "'s server.txt";

CompassWaypointGUI.loadWaypointDelay(%filename);
}

parent::onConnectionAccepted();
}
};
activatePackage(Compass_Load);

--- End code ---


Kalphiter:

Debug, otherwise we won't find the problem.

jes00:


--- Quote from: Kalphiter on January 23, 2012, 11:46:47 AM ---Debug, otherwise we won't find the problem.

--- End quote ---
What?

Ipquarx:


--- Quote from: Kalphiter on January 23, 2012, 11:46:47 AM ---Figure it out
--- End quote ---
Made him easier to understand

jes00:


--- Quote from: Ipquarx on January 23, 2012, 01:46:39 PM ---Made him easier to understand

--- End quote ---
But that's kinda the point of the Coding Help topic; for when you can't "figure it out".

Pages: (1/2) > >>

Go to full version