need some help with this complete fun script.
 

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

need some help with this complete fun script.

Started by thunder-droopy, 11 August, 2006, 18:28:15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

thunder-droopy

hi peeps,

can anyone help me?
i use this complete fun script, but since i've instaleld leviathan 2.7 i get this error when i star up complete fun.
Syntax D:\ptokax hub 2\scripts\Complete fun.lua:576: attempt to call a table value
can anyone tel me what is wrong and how i solve this problem?
thnx already!
greetz droopy

this is the script code:
Bot = "Ravebabe"

trigall=1 

trigw = { 
 

fav={ 
"Yeah [CURUSER], bijna goed, probeer dit -----> /fav ", 
"Hmm, ik denk dat je dit bedoelde [CURUSER] ?-----> /fav ", 
"probeer dit [CURUSER]-------> /fav ", 
"[CURUSER], dit zal beter gaan -----> /fav ", 
"dat begrijpt ie niet [CURUSER] --> /fav <-- begrijpt ie wel. ?;-) " 
}, 

etc etc etc.... 

yeah={ 
"yes", 
"yep", 
"uh huh", 
"100%", 
"party on dude!", 
"eg wel", 
"uh-hu", 
"oh yes", 
"op cker!", 
"wat dachie dan", 
"roger!", 
"10-4 !", 
"klopt!!", 
"you rock!", 
"sure", 
"euh...jij zegt het [CURUSER]", 
"tralalalala", 
"exact!", 
"kee dan!" 
}, 

} 


function Main() 
end 

function ChatArrival(curUser, data) 

status=string.sub(data,1,string.len(data)-1) 
-- parse the command 
s,e,cmd = string.find( status, "%b<>%s+(%S+)" ) 

if (cmd=="+quiet") then 
trigall=0 
SendToAll(Bot, " Hmf, Okidoki I will be quiet :(( ") 
return 1 
elseif (cmd=="+speak") then 
trigall=1 
SendToAll(Bot, " Okay, I will talk to you again :-)") 
return 1 
end 


if( string.sub(data, 1, 1) == "<" ) then 
-- get the msg only using regular expression 
s,e,msg = string.find(data, "%b<>([%a ]+)") 
-- look in the table 
if trigall==1 then 
for key, value in trigw do 
for key2, value2 in value do 

if( string.find( string.lower(msg), key) ) then 
else break 
end 

if( string.find( string.lower(msg), "!me") ) then 
t="**"..curUser.sName 
data=string.gsub (msg, "!me", t, 1 ) 
end 

SendToAll( data ) -- send the original data 

SetTimer(1800) 
StartTimer() 
answer, x = string.gsub(value[math.random(1,table.getn(value))], "%b[]", curUser.sName) 

return 1; -- tell the hub we have processed the data 
end 
end 
end 
end 

function OnTimer() 
SendToAll( Bot , answer ) -- send bot's answer 
StopTimer() 
end 
end--------------------------------------------------------------------------------

bastya_elvtars

In that line, there should be a for k,v in tbl do -like thingy. Now rewrite this to be like this: for k,v in pairs(tbl) do
Everything could have been anything else and it would have just as much meaning.

SMF spam blocked by CleanTalk