PtokaX forum

Lua 5.3/5.2/5.1 Scripts (for PtokaX 0.4.0.0 and newer) => Help with scripts => Topic started by: atonal on 02 June, 2008, 11:41:01

Title: newapi_Line builder 1.0
Post by: atonal on 02 June, 2008, 11:41:01
 Hi this scripts or bot is workink wel in to the main chat

my question is if yuo guys can make it this bot or scripts for see in to the box under chat , becacuse in to the main some user dont care to see in main chat this massages.

here is the scripts







--[[
*********************  Line builder in main chat New API  Version  1.0 *********************
********************* By [NL]Daddy-Bear?   November 2007  *********************

Based on the Line builder in main chat 5.0-5.1 Version  1.01 from [NL]Daddy-Bear? .
Made in Feb 2007

]]

-- -------------------------------------------  User Settings  -------------------------------------------

linedelay = 2 -- Interval between lines.   (in seconds)
repeet = 225 -- Interval between sctript from start again.   (in seconds >> 3600 = 1 Hour)
CommOn = "+lon" -- Start the script.
CommOff = "+loff" -- Stop the script.
StartOn = "1" -- Start script by starting this lua  ["1"=yes "0"=no]

-- ---------------------  you me add or delete lines yust keep the same layout ---------------------

lines = {


[1] ":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.::.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:",
[2] "-=Register Yourself Today! And Type--> !regme password <-- Your Own Password=-",
[3] "-=Type --> !rules <-- In Mainchat For The Rules Of This Hub=-",
[4] "-=Don't Share Or Search For Forbidden Files, You Will Be Kicked For It=-",
[5] "-=Type --> !network <-- In Mainchat, To See More Hubs From This Network=-",
[6] "-=Type --> !faq <-- Shows The DC++ Faq=-",
[7]   ":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.::.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:",

}
nrOfLines = 7 --  Nuber of line's above , in this case 7


-- ------------------------------------------- End of User Settings -------------------------------------------

-- ------------------------------------------- don't chance below !! -------------------------------------------


k = 0 -- Yust a ccounter don't chance
kk = 0 -- Yust a ccounter don't chance
nuword = 0 -- Yust a ccounter don't chance
Nr = 1 -- Yust a ccounter don't chance

Sec  = 1000
Min  = 60*Sec
Hour = 60*Min
Day  = 24*Hour
delay = repeet
Bot = "Daddys-line-maker" -- Name for bot
function OnStartup()
Nr,wTimer = 1,nil

if StartOn == "1" then
tmr = TmrMan.AddTimer(1*Sec)
end
end
function ChatArrival(user,data)
Core.GetUserAllData(user)
s,e,cmd = string.find(data, "%b<>%s+(%S+)(%S+)")
if (cmd==CommOn) and user.bOperator then
Core.SendToNick(user.sNick,"<"..Bot.."> \r\n\r\n\t--<< Text script has started >>--\r\n\r\n")
tmr = TmrMan.AddTimer(1*Sec)
return true
elseif (cmd==CommOff) and user.bOperator then
TmrMan.RemoveTimer(tmr)  
Core.SendToNick(user.sNick,"<"..Bot.."> \r\n\r\n\t--<< Text script has stopped >>--\r\n\r\n")
return true
end
end
function Split(Nr)
Text,tmp = "",{}
if lines[Nr] == nil then Nr = 1 end
for Word in string.gmatch(lines[Nr],"%S+") do
table.insert(tmp,Word)
wTimer,C = 1,1
end
end
function Send(C)
if tmp[C] == nil then
nuword = 0
wTimer = nil
else
Text = Text..tmp[C].. " "
if nuword == 1 then Core.SendToAll(Text)
end
end
end
function Now(sh)
if wTimer then
Send(C)
C = C+1
else
Split(Nr)
Nr = Nr+1
end
end
function OnTimer(tmr)
if k == 1 then nuword = 1
end
if k == 2 and nuword == 1 then Now(sh)
k = 2 - 1
end
if k == linedelay + 2 then nuword = 0 k = 0
end
if Nr <= nrOfLines + 1 then k = k + 1
end
if Nr >= nrOfLines + 2 then kk = kk + 1
end
if kk >= delay then kk = 0
k = 0
Nr = 1
Split(Nr)
end
end







Edit by CrazyGuy --> Added code block around code
Title: Re: newapi_Line builder 1.0
Post by: CrazyGuy on 02 June, 2008, 15:32:45
Quote from: atonal on 02 June, 2008, 11:41:01
Hi this scripts or bot is workink wel in to the main chat

my question is if yuo guys can make it this bot or scripts for see in to the box under chat , becacuse in to the main some user dont care to see in main chat this massages.

here is the scripts


I'm not sure I'm understanding what you exactly want.
First I thought you wanted a conversion to new API, until I saw that was already done.
If you are referring to the status bar in a client when you say " in to the box under chat " then I can read the request like this:

You want the messages to show into the status bar instead of mainchat because users do not read chat ? ???

I take it the attached Poll was a joke right ? Btw, I voted "hi" , and not "hi"  ;D

Also, when you paste alot of code, try to place it in a code block as I've done for you now.
You can find that as the #-symbol above the smileys when you type your post.

So, clearify the request please  :)
Title: Re: newapi_Line builder 1.0
Post by: [NL]Daddy-Bear? on 07 June, 2008, 14:39:04
Hello it?s me again.

Hello atonal.
I think this what you mend follow the link ;)
http://forum.ptokax.org/index.php?topic=7424.0

Respectfully,

[NL]Daddy-Bear?