• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

GlobalEvent Lottery System!

<globalevent name="lottery" interval="8500000" event="script" value="lottery.lua"/>
and i got same
 
Ill be releasing my lottery system soon I just need to find time to test it, in the meantime test this

Code:
<globalevent name="lottery" interval="4050000" event="script" value="lottery.lua"/>
 
Code:
> Broadcasted message: "[LOTTERY SYSTEM] Winner: Owner, Reward: mastermind shiel
d! Congratulations! (Next Lottery in 3 Hours)".
[1:8:11.406] mysql_real_query(): INSERT INTO `lottery` (`name`, `item`) VALUES (
'Owner', 'mastermind shield'); - MYSQL ERROR: Table 'thais.lottery' doesn't exis
t (1146)
> Broadcasted message: "[LOTTERY SYSTEM] Winner: Owner, Reward: demon armor! Con
gratulations! (Next Lottery in 3 Hours)".
[1:8:22.187] mysql_real_query(): INSERT INTO `lottery` (`name`, `item`) VALUES (
'Owner', 'demon armor'); - MYSQL ERROR: Table 'thais.lottery' doesn't exist (114
6)
> Broadcasted message: "[LOTTERY SYSTEM] Winner: Owner, Reward: 10 crystal coins
! Congratulations! (Next Lottery in 3 Hours)".
[1:8:33.046] mysql_real_query(): INSERT INTO `lottery` (`name`, `item`) VALUES (
'Owner', 'crystal coin'); - MYSQL ERROR: Table 'thais.lottery' doesn't exist (11
46)
> Broadcasted message: "[LOTTERY SYSTEM] Winner: Owner, Reward: mastermind shiel
d! Congratulations! (Next Lottery in 3 Hours)".
[1:8:43.843] mysql_real_query(): INSERT INTO `lottery` (`name`, `item`) VALUES (
'Owner', 'mastermind shield'); - MYSQL ERROR: Table 'thais.lottery' doesn't exis
t (1146)
i got this and the same error in the time @ghettobird
 
Code:
> Broadcasted message: "[LOTTERY SYSTEM] Winner: Owner, Reward: mastermind shiel
d! Congratulations! (Next Lottery in 3 Hours)".
[1:8:11.406] mysql_real_query(): INSERT INTO `lottery` (`name`, `item`) VALUES (
'Owner', 'mastermind shield'); - MYSQL ERROR: Table 'thais.lottery' doesn't exis
t (1146)
> Broadcasted message: "[LOTTERY SYSTEM] Winner: Owner, Reward: demon armor! Con
gratulations! (Next Lottery in 3 Hours)".
[1:8:22.187] mysql_real_query(): INSERT INTO `lottery` (`name`, `item`) VALUES (
'Owner', 'demon armor'); - MYSQL ERROR: Table 'thais.lottery' doesn't exist (114
6)
> Broadcasted message: "[LOTTERY SYSTEM] Winner: Owner, Reward: 10 crystal coins
! Congratulations! (Next Lottery in 3 Hours)".
[1:8:33.046] mysql_real_query(): INSERT INTO `lottery` (`name`, `item`) VALUES (
'Owner', 'crystal coin'); - MYSQL ERROR: Table 'thais.lottery' doesn't exist (11
46)
> Broadcasted message: "[LOTTERY SYSTEM] Winner: Owner, Reward: mastermind shiel
d! Congratulations! (Next Lottery in 3 Hours)".
[1:8:43.843] mysql_real_query(): INSERT INTO `lottery` (`name`, `item`) VALUES (
'Owner', 'mastermind shield'); - MYSQL ERROR: Table 'thais.lottery' doesn't exis
t (1146)
i got this and the same error in the time @ghettobird


What tfs version do u use? >.<
 
man i fixed it but i want to know plz
how i can put the lottery in my gessior step by step
thankyou
 
the script works but i keep getting this every 5 minutes maybe
Code:
[12/01/2015 19:03:07] [Error - GlobalEvent Interface]
[12/01/2015 19:03:07] data/globalevents/scripts/lottery.lua:onThink
[12/01/2015 19:03:07] Description:
[12/01/2015 19:03:07] data/globalevents/scripts/lottery.lua:18: attempt to get length of local 'list' (a number value)
[12/01/2015 19:03:07] stack traceback:
[12/01/2015 19:03:07]     data/globalevents/scripts/lottery.lua:18: in function <data/globalevents/scripts/lottery.lua:8>
[12/01/2015 19:03:07] [Error - GlobalEvents::think] Couldn't execute event: lottery
 
you want scripts from 2008 to work on tfs 1.1? XD really?
 
Hi, sorry for reviving this old post, i'm having a little trouble with this system, if the player has a name with ', example: Atom'rp, this error is shown in console:error lottery.png

An error in my SQL syntax, this is my table structure, which type could work?
table_structure.png

thanks in advance!
 
Hi, sorry for reviving this old post, i'm having a little trouble with this system, if the player has a name with ', example: Atom'rp, this error is shown in console:View attachment 46728

An error in my SQL syntax, this is my table structure, which type could work?
View attachment 46729

thanks in advance!
You'll need to escape using an additional quote mark

So on line 30 where it uses db.executeQuery change
Lua:
getCreatureName(winner)
to this, so it'll add an additional ' to the name, allowing the escape.
Lua:
getCreatureName(winner):gsub("'", "''")

Here's an example of what it's doing.

Untitled.png
 
Its run on TFS 1.4? I dont have any errors, Gesior works good, but nothing happen in game :(
 
Back
Top