Author Topic: [Request] tables - a shot "howto"  (Read 2129 times)

0 Members and 1 Guest are viewing this topic.

Offline Snooze

  • Scripter
  • Viking
  • ******
  • Posts: 606
  • Karma: +54/-3
    • DiXBoT Website
[Request] tables - a shot "howto"
« 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..

PtokaX forum

[Request] tables - a shot "howto"
« on: 22 March, 2004, 16:15:17 »

Offline Corayzon

  • Lord
  • ***
  • Posts: 464
  • Karma: +1/-0
(No subject)
« Reply #1 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
« Last Edit: 22 March, 2004, 16:44:09 by Corayzon »

Offline Snooze

  • Scripter
  • Viking
  • ******
  • Posts: 606
  • Karma: +54/-3
    • DiXBoT Website
(No subject)
« Reply #2 on: 22 March, 2004, 17:55:58 »
Thanks Corayzon,

I'm now one step closer to understanding



**Snooze

Offline Corayzon

  • Lord
  • ***
  • Posts: 464
  • Karma: +1/-0
(No subject)
« Reply #3 on: 23 March, 2004, 03:41:47 »
np dude... if u need anymore help just ask ;)

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
(No subject)
« Reply #4 on: 24 March, 2004, 23:13:54 »
posted a how-to about tables and array's here

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Offline Corayzon

  • Lord
  • ***
  • Posts: 464
  • Karma: +1/-0
(No subject)
« Reply #5 on: 25 March, 2004, 00:24:46 »
once again...thats great help!

PtokaX forum

(No subject)
« Reply #5 on: 25 March, 2004, 00:24:46 »