Alias being called on connect, and error triggered

Post Reply
Yetzederixx
Posts: 186
Joined: Sun Nov 14, 2010 5:57 am

Alias being called on connect, and error triggered

Post by Yetzederixx »

I shouldn't be having anything happen upon connect, yet I get these two errors:

Code: Select all

*** starting new session ***
[ERROR:] object:<Toggle: Autohide> function:<Alias22>
         <[string "function Alias22()..."]:8: attempt to call global 'makeAutohideLabel' (a nil value)>
[ERROR:] object:<Show Colors> function:<Action6>
         <[string "function Action6()..."]:2: attempt to call global 'showColors' (a nil value)>
[ERROR:] object:<WindowResizeEvent> function:<handleWindowResizeEvent>
         <attempt to call a nil value>
Here's the autohide alias toggle, which is use as an alias and for a button as well:

Code: Select all

if (isAutohideOn) then 
	turnAutohideOff()
else 
	isAutohideOn = true
	enableAlias("Autohide")
	enableTrigger("Autohide")
	makeAutohideLabel()
end
And the makeAutohideLabel fn:

Code: Select all

function makeAutohideLabel()
	local w, h = getMainWindowSize()
	
	if (not isAutohideLabelMade) then
		createLabel("lblAutohide", 0, 0, 0, 0, 1)
		setLabelClickCallback("lblAutohide", "turnAutohideOff")
		setBackgroundColor("lblAutohide", 0, 0, 255, 150) -- r, g, b, trans
		echo("lblAutohide", [[<p><b><center><font size="14" color ="red">Autohide On</font></center></b></p>]])
		isAutohideLabelMade = true
	end
	
	-- Just incase I've resized the program window
	resizeWindow("lblAutohide", 200, 35) -- w, h
	moveWindow("lblAutohide", w - 215, 0) -- x, y
	
	showWindow("lblAutohide")
end

function turnAutohideOff()
	disableTrigger("Autohide")
	disableAlias("Autohide")
	hideWindow("lblAutohide")
	
	isAutohideOn = false
end
I'm not even sure why it's calling these on connection as I can't even figured out how to do the on connect script in the first place and use triggers to log in right now. The code is identical to another alias/button for another label, with location/color changes, that doesn't trigger any error so I'm stumped.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Alias being called on connect, and error triggered

Post by Heiko »

Ignore those errors. Button scripts are being run once as part of the profile loading process before you are connected to the MUD. This way buttons and menus can be used as easy configuration tools. Any send() etc. commands that might be in those scripts will have no effect as you aren't yet connected.

Post Reply