PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: yepyepyep4711 on 25 March, 2004, 19:56:27

Title: Do the wave, man, do the wave
Post by: yepyepyep4711 on 25 March, 2004, 19:56:27
Hi all,

this is a script with a big WOW effect when you launch it. I promise :D

I post it here because it's working. It would be nice though if someone could add a on/off function, which it lacks. Previous tries of adding an on/off-switch were discarded because they caused the wave to carry only single words and no phrase anymore. Who's up to it?

-- Wave by DirtyFingers

wavepart = "??..??''???``''??..??_"

--          1234567890123456789012

pos = 1

wholewave = strrep(wavepart,4)


function Main()

SetTimer(200)

StartTimer()

end

function OnTimer()

if pos > 1 then

pos = pos-1

else

pos = 22

end

local c = strsub(wavepart,pos,pos)

wholewave = c..strsub(wholewave,1,strlen(wholewave)-1)

--SendToAll("",c.."\t"..strsub(wholewave,strlen(wholewave)-1,strlen(wholewave)-1))

SendToAll("*",wholewave.." <*>")

end


function DataArrival (curUser, sData)

local s,i

_,i = (strfind(sData,"<"..curUser.sName.."> "))

s = strsub(sData,i+1,strlen(sData)-1)

if strlen(s) < strlen(wholewave) then

wholewave = s .. strsub(wholewave,strlen(s))

else

wholewave = strsub(s,strlen(wholewave))

end

end

cheers
Title:
Post by: ??????Hawk?????? on 25 March, 2004, 20:09:00


-- Wave by DirtyFingers

wavepart = "??..??''???``''??..??_"

--          1234567890123456789012

pos = 1

wholewave = strrep(wavepart,4)


function Main()

SetTimer(200)

StartTimer()

end

function OnTimer()

if pos > 1 then

pos = pos-1

else

pos = 22

end

local c = strsub(wavepart,pos,pos)

wholewave = c..strsub(wholewave,1,strlen(wholewave)-1)

--SendToAll("",c.."\t"..strsub(wholewave,strlen(wholewave)-1,strlen(wholewave)-1))

SendToAll("*",wholewave.." <*>")

end


function DataArrival (curUser, sData)
command=strsub(sData,1,strlen(sData)-1)
s,e,cmd = strfind(command,"%b<>%s+(%S+)")
if cmd=="+waveon" then
StartTimer()
elseif cmd=="+waveoff" then
 StopTimer()
end

local s,i

_,i = (strfind(sData,"<"..curUser.sName.."> "))

s = strsub(sData,i+1,strlen(sData)-1)

if strlen(s) < strlen(wholewave) then

wholewave = s .. strsub(wholewave,strlen(s))

else

wholewave = strsub(s,strlen(wholewave))

end

end



Title:
Post by: yepyepyep4711 on 25 March, 2004, 20:34:02
That was veeeeeeeeery quick. And it works! Thanks Hawk : )

I made it to accept the commands only from ops, because that's how I use it. Cheers and thanks again!

-- Wave by DirtyFingers
-- on/off 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 = strrep(wavepart,4)





function Main()



SetTimer(200)



StartTimer()



end



function OnTimer()



if pos > 1 then



pos = pos-1



else



pos = 22



end



local c = strsub(wavepart,pos,pos)



wholewave = c..strsub(wholewave,1,strlen(wholewave)-1)



--SendToAll("",c.."\t"..strsub(wholewave,strlen(wholewave)-1,strlen(wholewave)-1))



SendToAll("*",wholewave.." <*>")



end





function DataArrival (curUser, sData)

command=strsub(sData,1,strlen(sData)-1)

s,e,cmd = strfind(command,"%b<>%s+(%S+)")

if curUser.bOperator then

if cmd=="+waveon" then

StartTimer()

elseif cmd=="+waveoff" then

  StopTimer()

end

end


local s,i



_,i = (strfind(sData,"<"..curUser.sName.."> "))



s = strsub(sData,i+1,strlen(sData)-1)



if strlen(s) < strlen(wholewave) then



wholewave = s .. strsub(wholewave,strlen(s))



else



wholewave = strsub(s,strlen(wholewave))



end



end
Title:
Post by: yepyepyep4711 on 25 March, 2004, 21:06:29
shit, I have to tamper that good mood. The sript works flawlessly, only PtokaX gives a
Syntax error: attempt to perform arithmetic on local `i' (a nil value)
stack traceback:
   1:  function `DataArrival' at line 116 [file `...gramme\PtokaX-0.330.b15.25.dbg\scripts\wave.lua']

any ideas?
Title:
Post by: H?LL?L?L??nG?L on 25 March, 2004, 21:09:37
Its WOW definately ..Users were like this  8o  8o  8o Really fun script....... have the same error on the arithmetic tho :(
Title:
Post by: ??????Hawk?????? on 25 March, 2004, 23:53:59
sorry for delay .   wife took over mi  puter :-(

-- Wave by DirtyFingers
-- on/off 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 = strrep(wavepart,4)

function Main()
SetTimer(200)
StartTimer()
end


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


function DataArrival (curUser, sData)
command=strsub(sData,1,strlen(sData)-1)
s,e,cmd = strfind(command,"%b<>%s+(%S+)")
if curUser.bOperator then
if cmd=="+waveon" then
StartTimer()
elseif cmd=="+waveoff" then
  StopTimer()
end
end
local s,i
_,i = (strfind(sData,"<"..curUser.sName.."> "))
if i ~= nil then
s = strsub(sData,i+1,strlen(sData)-1)
if strlen(s) < strlen(wholewave) then
wholewave = s .. strsub(wholewave,strlen(s))
else
wholewave = strsub(s,strlen(wholewave))
end
end
end
Title:
Post by: ??????Hawk?????? on 26 March, 2004, 00:25:55
try this one...

removed auto start and removed users message from disturbing the wave  


 -- Wave by DirtyFingers
-- on/off 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 = strrep(wavepart,4)
active = 0
function Main()
SetTimer(200)
end


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


function DataArrival (curUser, sData)
command=strsub(sData,1,strlen(sData)-1)
s,e,cmd = strfind(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 = (strfind(sData,"<"..curUser.sName.."> "))
if i ~= nil then
s = strsub(sData,i+1,strlen(sData)-1)
if strlen(s) < strlen(wholewave) then
wholewave = s .. strsub(wholewave,strlen(s))
else
wholewave = strsub(s,strlen(wholewave))
end
end
return 1
end
end


Title:
Post by: yepyepyep4711 on 26 March, 2004, 19:27:43
oops, I hadn't realised it was capturing the pms as well.

It's not working though. The return 1 is a bad idea because it still posts the pms in the wave, but it also prevents them from reaching their destination. Both could cause major irritation.

So what we need is telling it to capture only the main chat, not any input.

Should anyone care, here's the last functioning version. Use wisely, because it's still posting the pms in the main at the moment.

-- Wave by DirtyFingers
-- on/off switch, off at start by Hawk
-- commands op only, debugging by yepyepyep4711

-- commands are +waveon/+waveoff, guess what they do ;)

wavepart = "??..??''???``''??..??_"

--          1234567890123456789012

pos = 1

wholewave = strrep(wavepart,4)

active = 0

function Main()

SetTimer(200)

end





function OnTimer()

if pos > 1 then

pos = pos-1

else

pos = 22

end

local c = strsub(wavepart,pos,pos)

wholewave = c..strsub(wholewave,1,strlen(wholewave)-1)

--SendToAll("",c.."\t"..strsub(wholewave,strlen(wholewave)-1,strlen(wholewave)-1))

SendToAll("*",wholewave.." <*>")

end





function DataArrival (curUser, sData)

command=strsub(sData,1,strlen(sData)-1)

s,e,cmd = strfind(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 = (strfind(sData,"<"..curUser.sName.."> "))

if i ~= nil then

s = strsub(sData,i+1,strlen(sData)-1)

if strlen(s) < strlen(wholewave) then

wholewave = s .. strsub(wholewave,strlen(s))

else

wholewave = strsub(s,strlen(wholewave))

end

end

--return 1

end

end
Title:
Post by: ??????Hawk?????? on 26 March, 2004, 19:43:34
OK  i tested this  briefly   lemmi know if theres any probs:-))




-- 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 = strrep(wavepart,4)
active = 0
function Main()
SetTimer(200)
end


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


function DataArrival (curUser, sData)
command=strsub(sData,1,strlen(sData)-1)
s,e,cmd = strfind(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 = (strfind(sData,"<"..curUser.sName.."> "))
if i ~= nil then
s = strsub(sData,i+1,strlen(sData)-1)
if ( strsub(sData, 1, 4) == "$To:" ) then
s,e,g,h,j = strfind(sData,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")
j = strsub(j,1,strlen(j)-1)
SendPmToNick(g,h,j)
  else
if strlen(s) < strlen(wholewave) then
wholewave = s .. strsub(wholewave,strlen(s))
else
wholewave = strsub(s,strlen(wholewave))
end
end
end
return 1
end
end

Title:
Post by: H?LL?L?L??nG?L on 27 March, 2004, 02:57:47
Doesnt half make yer eyes go funny 8o   excellent sscript  tho...keepem coming  :P  :P  :P
Title:
Post by: H?LL?L?L??nG?L on 27 March, 2004, 11:02:32
Elo again been playing around with the script and discovered this
If u overload the wave with example:- an ascii (kinda big one) u loose your users. When i did it 1 by 1 my users dissapeared before my very eyes as i watched.......LOL strange 8o
Title: wave script
Post by: gazzer on 27 March, 2004, 12:14:08
hi folks, how the hell do ya start it lol???
ive installed it and tried !waveon !wave !on and of course
!yepyepyep4711

nowt works for me lol
Title: wave
Post by: gazzer on 27 March, 2004, 12:18:56
ok its sorted i just need to wake up and read bloody script LOL
Title:
Post by: acethecase on 27 March, 2004, 12:36:33
:D  :D  :D LOL FUNNY SHIT!!! :D  :D  :D
Title:
Post by: ??????Hawk?????? on 27 March, 2004, 14:55:35
QuoteIf u overload the wave with example:- an ascii (kinda big one) u loose your users. When i did it 1 by 1 my users dissapeared before my very eyes as i watched.......LOL strange

he he he  yea  its quite heavy on the hub you will lose users by connection timeout.  not the actual script disconnecting them but the hub being soo maxed out it cant reply to the users client
Title:
Post by: yepyepyep4711 on 27 March, 2004, 15:26:40
YES!! Hawk, you're damn fast and you're the man. Congrats!

It's working, it does what it should, and doesn't generate errors.

Bravo :D
Title:
Post by: [NL]Pur on 27 March, 2004, 23:23:26
wooowooow

??..??''???``''??..??_??..??''???``''??..??_