GetID, SetID syntax in if statement?
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

GetID, SetID syntax in if statement?

Started by Barticus, 19 October, 2005, 23:55:09

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Barticus

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

bastya_elvtars

#1
getglobal("FR_TargetFrame1")

What is this?
Everything could have been anything else and it would have just as much meaning.

Barticus

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.

bastya_elvtars

#3
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"?
Everything could have been anything else and it would have just as much meaning.

Barticus

heh, apparantly "GetID" only works in a conditional as an integer.

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

SMF spam blocked by CleanTalk