Jump to content

Lua not working in fight class editor


Ordush

Recommended Posts

Hey all
I tried to make an in-game frame using lua just the way i would with lua in-game in any other way (macros etc).
So in the "spellname" area in the creator i wrote in my code, and i set it to "not spell, is lua script"
Ending up with this:

      <SpellName>if not FrameCreated then
  FrameCreated = true

    StatusFrame = CreateFrame("Frame")
      StatusFrame:ClearAllPoints()
    StatusFrame:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8X8",})
    StatusFrame:SetBackdropColor(0,0,0,.4)
    StatusFrame:SetHeight(60)
    StatusFrame:SetWidth(122)
    StatusFrame:SetPoint("TOPLEFT",ChatFrame1, 0,90)
	StatusFrame:SetMovable(true)
	StatusFrame:EnableMouse(true)
	StatusFrame:RegisterForDrag("LeftButton")
	StatusFrame:SetScript("OnDragStart", frame.StartMoving)
	StatusFrame:SetScript("OnDragStop", frame.StopMovingOrSizing)
    StatusFrame:Show()
end</SpellName>


Is there any reason why this does not work?

Note: I did try removing the

StatusFrame:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8X8",})


In case it just couldn't find the BgFile, no difference. :) Also tried writing it like this:
 

StatusFrame:SetBackdrop({bgFile = [[Interface\Buttons\WHITE8X8]],})

Any help would be appreciated cheers! :)

This is a copy paste from my other post, since i realized that i posted i the wrong forum. :)

Edit: I even tried changing it to use lua script as a condition and then just leave the spellname empty liket his:
 

<LuaScript>if not FrameCreated then
	StatusFrame=CreateFrame("Frame");
	StatusFrame:ClearAllPoints();
	StatusFrame:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8X8",});
	StatusFrame:SetBackdropColor(0,0,0,.4);
	StatusFrame:SetHeight(60);
	StatusFrame:SetWidth(122);
	StatusFrame:SetPoint("TOPLEFT",ChatFrame1, 0,90);
	StatusFrame:SetMovable(true);
	StatusFrame:EnableMouse(true);
	StatusFrame:RegisterForDrag('LeftButton');
	StatusFrame:SetScript('OnDragStart', frame.StartMoving);
	StatusFrame:SetScript('OnDragStop', frame.StopMovingOrSizing);
	FrameCreated = true
end</LuaScript>

 

Link to comment
Share on other sites

After hours and hours of doing this and that, i finally figured the error lies within wrobot. Apparently it dones't translate \\ into /
So as soon as i changed

StatusFrame:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8X8",});

into

StatusFrame:SetBackdrop({bgFile = "Interface/Buttons/WHITE8X8",});

Everything worked.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...