PtokaX forum

Development Section => Your Developing Problems => Topic started by: NightLitch on 12 December, 2003, 17:00:15

Title: Calling this sort of Tables, help me...
Post by: NightLitch on 12 December, 2003, 17:00:15
Hey Guy's really miss DirtyFingers two Table WHOTO's...

I want to learn this and how I call them and use them in
a function...

Example then:

-- TABLES --

UserInfos = {
["username1"] = {
Name = "Name",
IP = "IP",
Share = "Share",
Profile = "Profile",
Client = "Client",
Version = "Version",
Slots = "Slots",
Speed = "Speed",
Hubs = "Hubs",
Moce = "Mode",
Kicks = "Kicks",
Kmess = "Kmess",
Bans = "Bans",
Bmess = "Bmess",
},
["username2"] = {
Name = "Name",
IP = "IP",
Share = "Share",
Profile = "Profile",
Client = "Client",
Version = "Version",
Slots = "Slots",
Speed = "Speed",
Hubs = "Hubs",
Moce = "Mode",
Kicks = "Kicks",
Kmess = "Kmess",
Bans = "Bans",
Bmess = "Bmess",
},
}

-- And writing and reading from this two

-- User Name/IP Check

Checker = {
["IP"] = {
"Names",
"Names",
},
["IP"] = {
"Names",
"Names",
},
}

Want to learn this... And don't redirect me to the manual
I have learnd more from you guy's than from the manual...

ThX / NL
Title:
Post by: NightLitch on 12 December, 2003, 22:47:25
Could I get some help here guys... plz...

have read in manual but no success...

/NL
Title:
Post by: NightLitch on 12 December, 2003, 22:48:08
Miss DirtyFinger's Table lessons

/NL
Title:
Post by: NightLitch on 13 December, 2003, 02:07:01
Guy's plz..  :))
Title:
Post by: pHaTTy on 13 December, 2003, 02:23:57
SendToAll(UserInfos.username1.Name)


try something like that, you may need a bot name
Title:
Post by: NightLitch on 13 December, 2003, 02:42:23
So I place a dot (.) between as I do with just two:

Table{}
Table.Nick = "name" -- SendToAll(Bot,"Nick: "..Table.Nick)

like that

but if I have more tables I use it like this:

Table{}
Table.Nick = {
                   "name" = "nick" -- SendToAll(Bot,"Nick: "..Table.Nick.name)
                     },


Am I right ???
Title:
Post by: pHaTTy on 13 December, 2003, 02:49:24
Hmm im not to sure about that........

tezlo is good at this, maybe when hes around he will know the exact answer yep....
Title:
Post by: NightLitch on 13 December, 2003, 02:58:43
ThX for the good start atleast, ThX pH?tt?.

/NL
Title:
Post by: pHaTTy on 13 December, 2003, 03:11:25
ok here what you got wrong mayeb you can learn from this

here we go hmmmmm ok


UserInfos = {
["username1"] = {
Name = "Name",
IP = "IP",
Share = "Share",
Profile = "Profile",
Client = "Client",
Version = "Version",
Slots = "Slots",
Speed = "Speed",
Hubs = "Hubs",
Moce = "Mode",
Kicks = "Kicks",
Kmess = "Kmess",
Bans = "Bans",
Bmess = "Bmess",
},
["username2"] = {
Name = "Name",
IP = "IP",
Share = "Share",
Profile = "Profile",
Client = "Client",
Version = "Version",
Slots = "Slots",
Speed = "Speed",
Hubs = "Hubs",
Moce = "Mode",
Kicks = "Kicks",
Kmess = "Kmess",
Bans = "Bans",
Bmess = "Bmess",
},
}


function Main()
Bot = "GREED"
Test = UserInfos.username1.Name
SendToAll(Bot,Test)
end



Hmm now im confused LOL, as i dont quite understadn what you are trying to accomplish
Title:
Post by: tezlo on 13 December, 2003, 03:19:12
hehe neither do i but theres not much to it..
userinfo.tezlo is the same as userinfo["tezlo"]

you can use the dot notation as long as there are no special characters in the index
you have to use brackets if the index is a variable.. userinfo[user.sName] or even userinfo[user["sName"]]

btw.. functions get called whereas tables get indexed
Title:
Post by: NightLitch on 13 December, 2003, 13:56:14
ThX Guy's, just wanted to understand it...

The code it self has noting to do with it...

Just I playing around...

But now I understand it more...

/NL