Thread Tools Display Modes
11-19-08, 04:31 AM   #1
Darkmystress
A Murloc Raider
Join Date: Nov 2008
Posts: 4
Mod works some times, then sometimes throws errors and won't load

Ok, I've been working on this dang script for almost 2 days now, more often than not the script will throw the same 2 errors, but every once in a while it will run just fine.

The errors I am getting are:
  1. <string>:"Main:OnLoad":2: Attempt to call global 'Buah_Start' (a nil value)
  2. <string>:"Main:OnUpdate":1: Attempt to call global 'DKA' (a nil Value)

I just cannot seem to figure out what is cause the errors most of the time but not always. following is the source for both the xml and lua

.xml
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/">

	<Script file="dkalerter.lua"/>

	<Frame name="Buah_Red" toplevel="true" hidden="true" parent="UIParent">
		<Size>
			<AbsDimension x="2000" y="2000"/>
		</Size>
		<Anchors>
			<Anchor point="CENTER"/>
		</Anchors>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="$parentBackground" setAllPoints="true">
					<Color r="1" g="0" b="0" a="0.4"/>
				</Texture>
			</Layer>
		</Layers>
	</Frame>

	<Frame name="Buah_Blue" toplevel="true" hidden="true" parent="UIParent">
		<Size>
			<AbsDimension x="2000" y="2000"/>
		</Size>
		<Anchors>
			<Anchor point="CENTER"/>
		</Anchors>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="$parentBackground" setAllPoints="true">
					<Color r="0" g="0" b="1" a="0.4"/>
				</Texture>
			</Layer>
		</Layers>
	</Frame>

	<Frame name="Main" toplevel="true" hidden="false" parent="UIParent">
		<Size>
			<AbsDimension x="1" y="1"/>
		</Size>
		<Anchors>
			<Anchor point="CENTER"/>
		</Anchors>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="$parentBackground" setAllPoints="true">
					<Color r="0" g="0" b="0" a="0"/>
				</Texture>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
				self.TimeSinceLastUpdate = 0
				Buah_Start()
			</OnLoad>
			<OnUpdate>
				DKA()
				Checker(self, elapsed)
			</OnUpdate>
			<OnEvent>
			</OnEvent>
		</Scripts>
	</Frame>

</Ui>
.lua
Code:
Reset_Interval = 900.0
Seal_Interval = 0.2
local Sealinc = 0
local sound = 1
local flash = 1
local soundt = "|cff33ff99 on"
local flasht = "|cff33ff99 on"

function Checker(self, elapsed)
	self.TimeSinceLastUpdate = self.TimeSinceLastUpdate + elapsed;
	if (self.TimeSinceLastUpdate > Reset_Interval) then
		self.TimeSinceLastUpdate = 0
	end
end

function Buah_Start()
	SLASH_BUAHALARM1 = "/dkalerter"
	SLASH_BUAHALARM2 = "/dka"
	SlashCmdList["BUAHALARM"] = Buahhelp
end

function Buahhelp(msg)
	if (msg=="sound on") then
		sound = 1
		soundt = "|cff33ff99 On"
	end
	if (msg=="sound off") then
		sound = 0
		soundt = "|cff33ff99 Off"
	end
	if (msg=="flash on") then
		flash = 0
		flasht = "|cff33ff99 On"
	end
	if (msg=="flash off") then
		flash = 0
		flasht = "|cff33ff99 Off"
	end
	if (msg=="about") then
		DEFAULT_CHAT_FRAME:AddMessage("|cffad081eDeathknight Alerter|cffffffff - Version 0.1 - Created November 18, 2008")
		DEFAULT_CHAT_FRAME:AddMessage("Created By: |cff4cb3feFoxyknight|cffffffff - Dawnbreaker US")
		DEFAULT_CHAT_FRAME:AddMessage("This addon currently only tracks the Freezing Fog and Sudden Death procs.")
	if (msg=="") then
		DEFAULT_CHAT_FRAME:AddMessage("Sound Control: /dkalerter sound on/off")
		DEFAULT_CHAT_FRAME:AddMessage("Flash Control: /dkalerter flash on/off")
	end
	DEFAULT_CHAT_FRAME:AddMessage("Current Configurations: Sound="..soundt.."|cffffffff Flash="..flasht)
end

function DKA()
	this:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
	this:SetScript("OnEvent", function(self, event, ...)
		local timestamp, eventType, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags = select(1)
		local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11 = select(9)
		if eventType == "SPELL_AURA_APPLIED" then
		if srcName == UnitName("player") then
			if (arg2 == "Death Trance!" or "Freezing Fog") then
				if (sound > 0) then
					PlaySoundFile("Interface\\Addons\\dkalerter\\sounds\\warn.mp3")
				end
				if (flash > 0) then
					if not self.FlashFrame then
						local flasher = CreateFrame("Frame", "DKAFlashFrame")
							flasher:SetToplevel(true)
							flasher:SetFrameStrata("FULLSCREEN_DIALOG")
							flasher:SetAllPoints(UIParent)
							flasher:EnableMouse(false)
							flasher:Hide()
							flasher.texture = flasher.CreateTexture(nil, "BACKGROUND")
							flasher.texture:SetTexture("Interface\\FullScreenTextures\\LowHealth")
							flasher.texture:SetAllPoints(UIParent)
							flasher.texture:SetBlendMode("ADD")
							flasher:SetScript("OnShow", function(self)
								self.elapsed = 0
								self:SetAlpha(0)
							end)
							flasher:SetScript("OnUpdate", function(self, elapsed)
								elapsed = self.elapsed + elapsed
								if elapsed < 2.6 then
									local alpha = elapsed % 1.3
									if alpha < 0.15 then
										self:SetAlpha(alpha / 0.15)
									elseif alpha < 0.9 then
										self:SetAlpha(1 - (alpha - 0.15) / 0.6)
									else
										self:SetAlpha(0)
									end
								else
									self:Hide()
								end
								self.elapsed = elapsed
							end)
							self.FlashFrame = flasher
					end
				self.FlashFrame:Show()
				end
			self.TimeSinceLastUpdate = 0
			end
		end
	end
	end)
end
I could really use some help on this.
 
11-20-08, 04:11 AM   #2
Venorize
A Defias Bandit
 
Venorize's Avatar
Join Date: Nov 2008
Posts: 2
Smile Wonderful!

You won't get any help from me. Hi, remember me? Vandalist? I am the person who's addon code you stole in an attempt to call it your own.

The addon doesn't work because your changing the base code of my addon in an attempt to add in your own with the lack of understanding on the structure of the addon.

In short, In an attempt to steal my addon, change the color, and then call it your own, you failed.

I already filed with curse.com that you take down the stolen addon, as it violates a copyright.

Have a wonderful day;

Venorize (aka; Vandalist)
 
11-20-08, 07:08 AM   #3
Shirik
Blasphemer!
Premium Member
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2007
Posts: 818
You have a frame named Main? That sounds like a great way to cause collisions with other addons.

That being said, after the error occurs, go to your WoW/Logs folder and grab the FrameXML.log file and paste it here. That may contain useful information.
__________________
たしかにひとつのじだいがおわるのお
ぼくはこのめでみたよ
だけどつぎがじぶんおばんだってことわ
しりたくなかったんだ
It's my turn next.

Shakespeare liked regexes too!
/(bb|[^b]{2})/
 
11-20-08, 07:12 AM   #4
Shirik
Blasphemer!
Premium Member
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2007
Posts: 818
I am getting the following error when compiling your Lua code. Are you sure these are the only errors you are getting? Check your blocks and try again:

test.lua:102: `end' expected (to close `function' at line 22) near `<eof>'

EDIT: You appear to be missing an "end" at line 43.

You should get a better bug tracking addon if it did not report this problem.
__________________
たしかにひとつのじだいがおわるのお
ぼくはこのめでみたよ
だけどつぎがじぶんおばんだってことわ
しりたくなかったんだ
It's my turn next.

Shakespeare liked regexes too!
/(bb|[^b]{2})/

Last edited by Shirik : 11-20-08 at 07:14 AM.
 
11-20-08, 11:55 PM   #5
Darkmystress
A Murloc Raider
Join Date: Nov 2008
Posts: 4
well, I found the problem and got it fixed.

As for Venorize he needs to get his facts straight before flaming, cause if he had looked at the mod page I had posted, i had given him credit for the original code and that I had changed a few things. I love how people just see that the mod came from them, but never actually read to see that they were given credit. His supposed copyright is bogus as his site it is linked to doesn't even have a copyright on it and no license in any form. It's like one of those "I made a site and so there for anything I put on it is copyrighted." Copyrights and trademarks are only valid if registered, look up the laws and info before trying to say your stuff is copyrighted. If nothing else go under a free license like GNU.

EDIT: and thank you Shirik, that was one of the biggest things causing the problem, I was doing everything in notepad which was also putting invalid characters in random places, so using Blua made the difference.

Last edited by Darkmystress : 11-21-08 at 12:00 AM.
 
11-20-08, 11:58 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Absence of license =/= absence of copyright. His addon was copyrighted as soon as it was written. It is the actual presence of a license which allows people to copy/redistribute things.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

 
11-21-08, 12:05 AM   #7
Darkmystress
A Murloc Raider
Join Date: Nov 2008
Posts: 4
Info on Copyrights even for software

http://www.nationaltechcenter.org/in...ht-protection/

If you don't want to read it all, there is a simple answer copyrights are registered, nothing is copyrighted till then.
 
11-21-08, 12:13 AM   #8
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Nothing is enforceable until registered.

Registration of copyright

No registration of your copyright is necessary. However, it may be beneficial to pursue registration by the U.S. Copyright Office. If someone attempts to use your work and claim it as their own, you will not be able to defend your position without having registered your work at the Copyright Office.
....
To ensure entitlement to statutory damages for infringements upon a copyrighted work, you must register your copyright within three months of the first publication date or anytime before the date the copyright infringement began.
And that is only US law, also.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

 
11-21-08, 12:17 AM   #9
Darkmystress
A Murloc Raider
Join Date: Nov 2008
Posts: 4
being that the sites in question are all located in the US that means they are governed by US laws.

trust me I have run a few online businesses and know what all goes into it, and to make sure to watch for server locations of who is hosting.
 
11-21-08, 12:41 AM   #10
Venorize
A Defias Bandit
 
Venorize's Avatar
Join Date: Nov 2008
Posts: 2
Stealing someone else work, modifying a tiny portion of it, and then calling it your own is still theft. Giving them credit doesn't mean squat unless you received permission to take their work and modify it in the first place.

Anyways, curse.com removed his addon for me so I am not worried about it anymore.

 
11-21-08, 08:25 AM   #11
Psoewish
A Scalebane Royal Guard
 
Psoewish's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 447
Let's look at this in a human way.

Frankly, none of us cares about the legal stuff surrounding copyright when we're talking about a WoW addon. In the end you stole someone else's work and that is not nice.

No matter how "right" you are in the face of the law, we don't care because it still makes you a thief from our point of view.
 
11-21-08, 12:24 PM   #12
Cairenn
Credendo Vides
 
Cairenn's Avatar
Premium Member
WoWInterface Admin
Join Date: Mar 2004
Posts: 7,134
Locking this as it has gotten out of hand. Flame fests aren't allowed on this site, take it somewhere else.
__________________
“Do what you feel in your heart to be right — for you’ll be criticized anyway.” ~ Eleanor Roosevelt
~~~~~~~~~~~~~~~~~~~
Co-Founder & Admin: MMOUI
FaceBook Profile, Page, Group
Avatar Image by RaffaeleMarinetti
 

WoWInterface » Developer Discussions » Lua/XML Help » Mod works some times, then sometimes throws errors and won't load


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off