PtokaX forum

Development Section => Your Developing Problems => Topic started by: Snooze on 22 March, 2004, 16:15:17

Title: [Request] tables - a shot "howto"
Post by: Snooze on 22 March, 2004, 16:15:17
well.. as the Subject say, im looking for a shot howto on tables ... and if possible a few excamples ...

What I had in mind were adding commands to tables though having a hard time understanding it from looking at some of the HUGE scripts that uses it :(
So ... any help will be great :))


**Snooze
- always learning..
Title:
Post by: Corayzon on 22 March, 2004, 16:43:23
tri this dude...hopefully will help a bit...

sBot = "testbot"

function Main()

-create table named tTable
tTable = {}

-create field in table named hubname and set it to "this is stored in hubname"
tTable["hubname"] = "this is stored in hubname"

-send hubname to hub
SendToAll(sBot, tTable["hubname"])

-creat table someuser inside tTable
tTable["someuser"] = {}

-create field called "kickcount" in table tTable["someuser"]
tTable["someuser"]["kickcount"] = 1

-send someuser["kickcount"] to hub
SendToAll(sBot, tTable["someuser"]["kickcount"])

-tTable["someuser"]["kickcount"] ++
tTable["someuser"]["kickcount"] = tTable["someuser"]["kickcount"] + 1

-resend someuser["kickcount"] to hub
SendToAll(sBot, tTable["someuser"]["kickcount"])

end

hope it helped
Title:
Post by: Snooze on 22 March, 2004, 17:55:58
Thanks Corayzon,

I'm now one step closer to understanding



**Snooze
Title:
Post by: Corayzon on 23 March, 2004, 03:41:47
np dude... if u need anymore help just ask ;)
Title:
Post by: plop on 24 March, 2004, 23:13:54
posted a how-to about tables and array's here (http://board.univ-angers.fr/thread.php?threadid=1699&boardid=4&styleid=1&page=1)

plop
Title:
Post by: Corayzon on 25 March, 2004, 00:24:46
once again...thats great help!