Author Topic: Calling this sort of Tables, help me...  (Read 2971 times)

0 Members and 1 Guest are viewing this topic.

Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
Calling this sort of Tables, help me...
« 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:

Code: [Select]
-- 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
« Last Edit: 12 December, 2003, 17:01:02 by NightLitch »
//NL

PtokaX forum

Calling this sort of Tables, help me...
« on: 12 December, 2003, 17:00:15 »

Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
(No subject)
« Reply #1 on: 12 December, 2003, 22:47:25 »
Could I get some help here guys... plz...

have read in manual but no success...

/NL
//NL

Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
(No subject)
« Reply #2 on: 12 December, 2003, 22:48:08 »
Miss DirtyFinger's Table lessons

/NL
//NL

Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
(No subject)
« Reply #3 on: 13 December, 2003, 02:07:01 »
Guy's plz..  :))
//NL

Offline pHaTTy

  • Forum Legend
  • ***
  • Posts: 1 916
  • Karma: +5/-1
(No subject)
« Reply #4 on: 13 December, 2003, 02:23:57 »
SendToAll(UserInfos.username1.Name)


try something like that, you may need a bot name
Resistance is futile!

Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
(No subject)
« Reply #5 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 ???
//NL

Offline pHaTTy

  • Forum Legend
  • ***
  • Posts: 1 916
  • Karma: +5/-1
(No subject)
« Reply #6 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....
Resistance is futile!

Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
(No subject)
« Reply #7 on: 13 December, 2003, 02:58:43 »
ThX for the good start atleast, ThX pH?tt?.

/NL
//NL

Offline pHaTTy

  • Forum Legend
  • ***
  • Posts: 1 916
  • Karma: +5/-1
(No subject)
« Reply #8 on: 13 December, 2003, 03:11:25 »
ok here what you got wrong mayeb you can learn from this

here we go hmmmmm ok

Code: [Select]

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
Resistance is futile!

Offline tezlo

  • Triple Ace
  • **
  • Posts: 225
  • Karma: +1/-0
(No subject)
« Reply #9 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

Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
(No subject)
« Reply #10 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
//NL

PtokaX forum

(No subject)
« Reply #10 on: 13 December, 2003, 13:56:14 »