Thread Tools Display Modes
05-29-10, 08:52 AM   #1
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,961
I'm afraid the parenthesis and semi-colons are all my fault Torhal. As you said, I am used to c++ and alot of it is habit now rofl.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
05-29-10, 11:11 AM   #2
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
I come from a C and C++ background as well, but broke myself of the habit rather quickly - I just think of Lua in natural-language terms...

Code:
if not insane then RunAway() end
versus

Code:
if (!crazy) {
    do_flee();
}
Code examples can be rather interesting when first waking up.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote
05-29-10, 12:40 PM   #3
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
hehe thanks torhal, and crystal

to torhal int he code you were asking what to insert on the else function, if it happens to be that else it will insert the new table with its new date

to crystal

lol thank you i am working with tonumber atm.. not willing to post the progress, because i may just need to find out on my own, and mean whole i am getting confused why everything is made to be in the code rofl
(understand what it does, but no thinking why do i do that)P
  Reply With Quote
05-29-10, 03:20 PM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,961
Originally Posted by clowcadia View Post
hehe thanks torhal, and crystal

to torhal int he code you were asking what to insert on the else function, if it happens to be that else it will insert the new table with its new date

to crystal

lol thank you i am working with tonumber atm.. not willing to post the progress, because i may just need to find out on my own, and mean whole i am getting confused why everything is made to be in the code rofl
(understand what it does, but no thinking why do i do that)P
Good, ask the question to yourself. Take the code out. Put it in. Print the value if one exists and then see if that helps you answer the question
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
05-29-10, 05:17 PM   #5
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
Originally Posted by clowcadia View Post
<snip>
to torhal int he code you were asking what to insert on the else function, if it happens to be that else it will insert the new table with its new date
<snip>
You have this in the code:

Code:
	tinsert(sessionInfo)
The reason I was asking what is being inserted is that tinsert is shorthand for table.insert() which is use like this:

Code:
	table.insert(table, value)
In your code, you are inserting absolutely nothing into the sessionInfo table.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote
05-30-10, 02:28 AM   #6
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
been reading around tables,and ready programming with lua, and the explanations are very complex, and the coding is not very relative with the functions we use for wow. i had read such sites before i came here, and hence the reason i am still in this topic even now after been taught by graceful crystal. i find that programming with lua is for more intermediate coders, who have coded other languages that are just as complex like c++. where as i have only really coded HTML back maybe 5-6 years ago, and never bothered to touch php
so please spare me the frustration, and either guide me in the right way maybe help me understand the programming with lua site with examples. or give up on me
i personally dont ask for all your time, i just hope that i get some kind of help at some point. we are on forum only because we reply if we wish to and post if we need to. i do not expect someone to do this for me but i hope that someone could help me before my mind blows up from rocket science

i got 2 problems that cant be found in any documentation, or too complex to relate to
Code:
sessionValue = tonumber(sessionCount);
sessionInfo = { 
}
tinsert( sessionInfo, currentDate , sessionValue )
hmm understand
but is there a limit to what the value is?
because i got my value a subtable == [currentDate]
but when i do tinsert( sessionInfo, [currentDate] )
id gives me an erro
been trying this as well on it but nothing
tonumber(sessionValue)

btw the currentDate = date(its variables) and it displays the data correct in saved variables

Code:
local function recordingSessionInfo()
sessionCount = sessionCount + 1;
sessionInfo = sessionInfo or {}
sessionValue = tonumber(sessionCount);
sessionInfo = { 
}
tinsert( sessionInfo, currentDate, sessionCount )

end
Code:
local function onEvent(self,event,...)
----------------------------------------------
 if ( event == "ADDON_LOADED" ) then
addonLoadedCount = addonLoadedCount + 1;
sessionCount = sessionCount + 2;

  if ( addonLoadedCount == 3 ) then
  print("GVLT Loaded")
   
   recordingSessionInfo();

Last edited by clowcadia : 05-30-10 at 03:52 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Trying to see guild bank transaction information


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