PtokaX forum

Archive => Archived 5.1 boards => Finished Scripts => Topic started by: [NL]Daddy-Bear? on 19 January, 2007, 16:42:57

Title: Line builder in main chat 5.0-5.1
Post by: [NL]Daddy-Bear? on 19 January, 2007, 16:42:57
Hello it?s me again.
I found an old script I wands wrote.

It?s very simple Lua  but is it is working.  ;)

This is it what de lua does:
It will build two lines in main, word for word.
After a delay it will repeat again. The delay is settable.
If you like you can off course change those lines.
Have fun with it. (Even it?s an oldie from me)

**********************************************************
A have tested it, I notice after lua was running in main the Newbie?s start to use /fav and /regme more as els.
**********************************************************


--[[
*********************  name: Line builder in main chat v 1.00 *********************
********************* by [NL]Daddy-Bear?  made in 2006  *********************

]]

-- *********************   Settings   *********************

k = 0 -- Yust a ccounter don't chance
kk = 2 -- Yust a ccounter don't chance
delay = 14000 -- Interval between announcements.   (1000 = 4.75 min)
CommOn = "+lon" -- Start the script.
CommOff = "+loff" -- Stop the script.
StartOn = "1" -- Start script by starting this lua  ["1"=yes "0"=no]

-- *********************   End off Settings   *********************

Bot = "Daddys-line-maker" -- Name for bot

function Main()
frmHub:RegBot(Bot)
SetTimer(400)  -- Yust a ccounter don't chance  !!!
if StartOn == "1" then
StartTimer()
end
end

function ChatArrival(user, data)
s,e,cmd = string.find(data, "%b<>%s+(%S+)(%S+)")
if (cmd==CommOn) and user.bOperator then
user:SendData(Bot,"\r\n\r\n\t--<< Text script has started >>--\r\n\r\n")
StartTimer()
return 1
elseif (cmd==CommOff) and user.bOperator then
StopTimer()   
user:SendData(Bot,"\r\n\r\n\t--<< Text script has stopped >>--\r\n\r\n")
return 1
end
end

function OnTimer()
k = k + 1
if k == 301 * kk then
SendToAll("Register")
end
if k == 302 * kk then
SendToAll("Register your")
end
if k == 303 * kk then
SendToAll("Register your self")
end
if k == 304 * kk then
SendToAll("Register your self type")
end
if k == 305 * kk then
SendToAll("Register your self type in")
end
if k == 306 * kk then
SendToAll("Register your self type in main")
end
if k == 307 * kk then
SendToAll("Register your self type in main chat:")
end
if k == 308 * kk then
SendToAll("Register your self type in main chat:  !regme")
end
if k == 309 * kk then
SendToAll("Register your self type in main chat:  !regme (space)")
end
if k == 310 * kk then
SendToAll("Register your self type in main chat:  !regme (space) password.")
end

-- Here is a  delay between the two lines  (time is the count from 310 to 600)

if k == 600 * kk then
SendToAll("Type")
end
if k == 601 * kk then
SendToAll("Type in")
end
if k == 602 * kk then
SendToAll("Type in main")
end
if k == 603 * kk then
SendToAll("Type in main chat:")
end
if k == 604 * kk then
SendToAll("Type in main chat:   /fav")
end
if k == 605 * kk then
SendToAll("Type in main chat:   /fav add")
end
if k == 606 * kk then
SendToAll("Type in main chat:   /fav add this")
end
if k == 607 * kk then
SendToAll("Type in main chat:   /fav add this hub to")
end
if k == 608 * kk then
SendToAll("Type in main chat:   /fav add this hub to your")
end
if k == 609 * kk then
SendToAll("Type in main chat:   /fav add this hub to your favorites.")
end
if k == delay then k = 0
end
end


Respectfully,

[NL]Daddy-Bear?  

-------------------------------------------------------
Title: Re: Line builder in main chat 5.0-5.1
Post by: ??']['??l? on 22 January, 2007, 13:00:49
this would be nice script, but it doesn`t work in my hub...
Nothing happens when i try to start this script...
I`m using PtokaX DC Hub 0.3.5.1 with lua 5.02...
I disabled all the other scripts, but it still don`t work... :-\
Title: Re: Line builder in main chat 5.0-5.1
Post by: [NL]Daddy-Bear? on 22 January, 2007, 15:43:21
Dear ??']['??l??S ,

In the first upload from 18-1-07 was a little mistake  ::) I chains that on 19-1-07.

Just to make shore I tested it here again.
With px 5.1.0 up to 5.1.2 and also the div lua 5.0 up to 5.1
It works here fine.
Also it runs also already in other deferens hubs.

After starting the script it takes about 4 min before the first line is coming.

I hope you get it running.

(If there are others with the same problem please gif a reply)


Respectfully,

[NL]Daddy-Bear?  
Title: Re: Line builder in main chat 5.0-5.1
Post by: ??']['??l? on 22 January, 2007, 18:21:34
sorry my mistake... there went something wrong when i copied and pasted the code....
Now when i tried third time it works fine....
:) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :)
Thanks for the great script....
Title: Re: Line builder in main chat 5.0-5.1
Post by: [NL]Daddy-Bear? on 03 February, 2007, 17:31:05
Dear ??']['??l??S ,

Thanks for this nice feedback m8.
Its making me also happy >>   ;)  ;)  ;)  ;)  ;)  ;)  ;)  ;)

;D  ;D  ;D  ;D  ;D
Respectfully,

[NL]Daddy-Bear?