PtokaX forum

Archive => Archived 5.0 boards => Finished Scripts => Topic started by: Dessamator on 23 April, 2005, 13:55:24

Title: The Wave
Post by: Dessamator on 23 April, 2005, 13:55:24
--lua5(by Dessamator)
-- Wave by DirtyFingers
-- on/off and more.. by Hawk
-- only ops can start/stop the wave by yepyepyep4711 (no, I don't expect anyone to be impressed ;D)

wavepart = "??..??''???``''??..??_"
--          1234567890123456789012
pos = 1
wholewave = string.rep(wavepart,4)
active = 0
function Main()
SetTimer(200)
end


function OnTimer()
if pos > 1 then
pos = pos-1
else
pos = 22
end
local c = string.sub(wavepart,pos,pos)
wholewave = c..string.sub(wholewave,1,string.len(wholewave)-1)
--SendToAll("",c.."\t"..string.sub(wholewave,string.len(wholewave)-1,string.len(wholewave)-1))
SendToAll("*",wholewave.." <*>")
end


function ChatArrival (curUser, sData)
command=string.sub(sData,1,string.len(sData)-1)
s,e,cmd = string.find(command,"%b<>%s+(%S+)")
if curUser.bOperator then
if cmd=="+waveon" then
StartTimer()
active = 1
elseif cmd=="+waveoff" then
  StopTimer()
active = 0
end
end
if active ~= 0 then
local s,i
_,i = (string.find(sData,"<"..curUser.sName.."> "))
if i ~= nil then
s = string.sub(sData,i+1,string.len(sData)-1)
if ( string.sub(sData, 1, 4) == "$To:" ) then
s,e,g,h,j = string.find(sData,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")
j = string.sub(j,1,string.len(j)-1)
SendPmToNick(g,h,j)
  else
if string.len(s) < string.len(wholewave) then
wholewave = s .. string.sub(wholewave,string.len(s))
else
wholewave = string.sub(s,string.len(wholewave))
end
end
end
return 1
end
end
Title:
Post by: ~~~~?Master?~~~~ on 04 May, 2005, 18:44:57
i keep getting this message


wave.lua:8: function arguments expected near `='
Title:
Post by: Dessamator on 04 May, 2005, 21:36:57
QuoteOriginally posted by ~~~~?Master?~~~~
i keep getting this message


wave.lua:8: function arguments expected near `='

no errors here, try to copy the script again !!
Title:
Post by: ~~~~?Master?~~~~ on 07 May, 2005, 21:18:28
i tryed butt kept getting the same msg


strange.....

btw there are a lote of scripts that don't work at my ptokax...
Title:
Post by: Dessamator on 07 May, 2005, 21:33:13
QuoteOriginally posted by jiten
QuoteOriginally posted by ~~~~?Master?~~~~
i'm keep getting this msg function arguments expected near `=' in line 8


can you help me??



thnx greetzz
What PtokaX version are you using?
Btw, the code to copy is the one between the
Best regards,

jiten
Title:
Post by: BeeR on 08 May, 2005, 04:54:06
QuoteOriginally posted by ~~~~?Master?~~~~
i keep getting this message


wave.lua:8: function arguments expected near `='

must be u that copy it wrong
works perfect for me :]
Title:
Post by: ~~~~?Master?~~~~ on 08 May, 2005, 09:43:19
it works i found the problem.......jumble was messing with the script..... thnx  anyway
Title: Re: The Wave
Post by: ??']['??l? on 15 August, 2006, 16:28:27
\scripts\wave.lua:43: malformed pattern (missing `]')

I get this error in ptokax script editor, when i start the wave...

Anybody knows what`s the problem?

Thanks... ;)