· 10 years ago · Aug 29, 2016, 01:46 PM
1package require sqlite3
2set kdbfile "/home/pi/eggdrop/bots/gav/kinksters.db"
3if {![file exists $kdbfile]} {
4 sqlite3 kdb $kdbfile
5 kdb eval {CREATE TABLE xy_kinksters (k_nick TEXT PRIMARY KEY , k_money INTEGER, k_status TEXT, k_position TEXT, k_owned INTEGER, k_owner TEXT)}
6 kdb close
7}
8
9proc joingame {nick host hand chan text} {
10 global kdbfile
11 sqlite3 kdb $kdbfile
12 if {[kdb exists {SELECT 1 FROM profile where k_nick like $nick}]} {
13 putquick "NOTICE $nick :You have already joined the game."
14 } else {
15 kdb eval {INSERT INTO xy_kinksters (k_nick, k_money, k_status, k_position, k_owned, k_owner) VALUES ($nick, 0, "NONE", "NONE", "NO", "NONE")}
16 putquick "NOTICE $nick :You have joined the game. You have no status and you are not owned. You have have $0!"
17 putquick "NOTICE $nick :You each cash by talking in channel."
18 putquick "NOTICE $nick :You can set your position using the !position command"
19 putquick "NOTICE $nick :See !pos_help for position descriptions."
20 putquick "NOTICE $nick :Use !not_plaing to remove yourself from the game (keeping current status)"
21}