Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Lua not working in fight class editor

Featured Replies

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! :)

 

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>
  • Author

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.

Not sure if you saw my answer on Discord, but I recommend getting Bugsack and Buggrabber, you'll still see the Lua errors of injected code that way.
That usually can put you on the right path.

  • Author
7 hours ago, Matenia said:

Not sure if you saw my answer on Discord, but I recommend getting Bugsack and Buggrabber, you'll still see the Lua errors of injected code that way.
That usually can put you on the right path.

I saw your post, and i have both. Thing is, it's not lua errors, it's a 'compile' bug from wrobot to lua output @ wow. Which means the errors you get in-game say nothing about the error. An error that i would get as an example would be you are missing an \ in front of n (It would never be this specific.) Where when reading my code i'd be like "I have a \ in front of n, what are you talking about?". So most of the errors i have been encountering, has been because i'm using advanced lua instead of just small snippets. So it's not as thoroughly tested and fixed. :)

22 hours ago, Ordush said:

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.

Why should wrobot translate \\ to / ? :blink:

  • Author
Just now, iMod said:

Why should wrobot translate \\ to / ? :blink:

 

"translate" was just a rough term. In lua \\ = backslash but for some reason when you use wrobot \\ turns into \ wen it spits out the code. Just like when you wanna do \n for newline you have to do \\n :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.