PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: Barticus on 19 October, 2005, 23:55:09

Title: GetID, SetID syntax in if statement?
Post by: Barticus on 19 October, 2005, 23:55:09
local FrameID = getglobal("FR_TargetFrame1"):GetID()
if FrameID=="Off" then
...

I've tried every combination of things to get this condition to fire, and it won't.  So I'm thinking either the ID of the frame cannot be stored as a variable to be tested against, or I just don't know the proper syntax for calling it up.  This is very central to my script, so I'm really hoping there's a method for making this work.

Thanks in advance,

Barticus
Title:
Post by: bastya_elvtars on 20 October, 2005, 00:05:43
getglobal("FR_TargetFrame1")

What is this?
Title:
Post by: Barticus on 20 October, 2005, 00:10:16
QuoteOriginally posted by bastya_elvtars
getglobal("FR_TargetFrame1")

What is this? getglobal is only for the C API, it has no use in LUA, also slows it down. (If we think the same...)

it refers to an XML document, and works perfectly in every other facet of my script.

I'm working on a mod for World of Warcraft.
Title:
Post by: bastya_elvtars on 20 October, 2005, 00:16:24
local FrameID = getglobal("FR_TargetFrame1"):GetID()

Either the function call is wrong, or the return value is nil. Is print(type(getglobal("FR_TargetFrame1"))) outputting "table"?
Title:
Post by: Barticus on 20 October, 2005, 00:28:43
heh, apparantly "GetID" only works in a conditional as an integer.

Got 'er fixed, but I thank you for your attention.