Calling this sort of Tables, help me...
 

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

Calling this sort of Tables, help me...

Started by NightLitch, 12 December, 2003, 17:00:15

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

NightLitch

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
//NL

NightLitch

Could I get some help here guys... plz...

have read in manual but no success...

/NL
//NL

NightLitch

Miss DirtyFinger's Table lessons

/NL
//NL

NightLitch

//NL

pHaTTy

SendToAll(UserInfos.username1.Name)


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

NightLitch

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

pHaTTy

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!

NightLitch

ThX for the good start atleast, ThX pH?tt?.

/NL
//NL

pHaTTy

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

tezlo

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

NightLitch

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

SMF spam blocked by CleanTalk